Re: Persistent PHP web application?
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Persistent PHP web application? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205745@lists.php.net to get a copy of this message | ||
On Thu, 6 Jan 2005, William Lovaton wrote:
> Hi Rasmus,
>
> El lun, 03-01-2005 a las 14:13 -0500, Rasmus Lerdorf escribió:
> > If you need to do something fancier you can stick things in shared
> > memory. Many of the accelerators give you access to their shared memory
> > segments. For example, the CVS version of pecl/apc provides apc_store()
> > and apc_fetch() which lets you store PHP datatypes in shared memory
> > directly without needing to serialize/unserialize them.
>
> This is great. In my high performance web app I created a PHP library
> that abstracted this to use several backends. For instance I have a
> File backend and a SHM backend that uses the functions provided by the
> sysvshm PHP module. With this functions, do they need to
> serialize/unserialize every time I put/get something in/from the cache??
If you are doing this in user-space PHP, then yes, you will have to
serialize.
> Also I use sysvsem for locking capabilities. does apc take care of the
> locking? does it have an API to do that?
APC takes care of locking and all cache management.
> My experience with shared memory have been great. My production server
> uses a segment of 384MB to cache lots of resultsets and PHP objects and
> the performance is almost unbeatable... well if it serializes then
> pecl/apc will give better performance I guess.
It should, yes. Try it.
-Rasmus