Re: Re: shared memory on php servers?
| From: | Sebastian Krebs | Date: | Tue, 04 Dec 2012 11:25:09 +0000 |
| Subject: | Re: Re: shared memory on php servers? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319784@lists.php.net to get a copy of this message | ||
2012/12/4 Stuart Dallas <stuart@3ft9.com>
> On 4 Dec 2012, at 10:51, rene7705 <rene7705@gmail.com> wrote:
>
> > I would also like to hear any thoughts on how to efficiently add,
> > delete and edit data in this large and deep array structure from
> > multiple sessions at nearly the same time..
> >
> > On Tue, Dec 4, 2012 at 11:49 AM, rene7705 <rene7705@gmail.com> wrote:
> >> Hi folks..
> >>
> >> I'm wondering, what's the fastest way to put a large and deep array()
> >> structure in shared memory on a PHP server?
>
> Split the data up into smaller pieces. There's rarely a valid reason to
> store a huge array of data as a single blob. It's an array, so it breaks up
> by the first level of keys at the very least.
>
> Look at APC, memcached, and redis. These are the most popular ways to
> store data in shared memory. Note that APC is a PHP extension so you can
> only access the shared memory from one machine, whereas memcached and redis
> are separate daemons so you can access them from multiple servers.
>
> Also, as Sebastian says, a database is another option unless you have a
> good reason to want the data in shared memory rather than a DB.
>
Beside that you can have Databases in memory too, like SQLite on a
tmpfs-mount, or a specialized memory-persistent database engine :)
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
github.com/KingCrunch