tags:

views:

82

answers:

1

Hi,

I have websites developed in PHP. Im using Opcode cache.

But because Opcode cache like eAccelerator or APC is cached in RAM, I needs too much RAM.

So Im looking for any project or technique which cache the PHP Opcode in hard disk.

Thanks so much

(my website is not generate money, so Im thinking about cheaper solution)

+1  A: 

all op-code caches allow you to configure the maximum size of shared memory used (look for a configuration option with shm - for SHared Memory - in the name, eg. apc.shm_size). so you can control that they don't use too much ram.

some caches also allow you to cache on disk instead/besides of caching in ram:

the question is if a small amount of shared memory or a disk only cache gains you anything in performance compared to plain php without op-code cache. as always when using a cache, you should benchmark this.

ax
thank you,..But after using "disk_only" in eAccelerator and restart lighttpd, my RAM usage is still high for php-cgi. Do I need to reboot the server?
Mwebe Nkrumah
did you use `disk_only` for all `eaccelerator.keys`, `eaccelerator.sessions`, and `eaccelerator.content`? did you try tuning other eaccelerator parameters? how are you measuring your ram usage? are you sure it is php and not something else causing the high load? did you try XCache <http://xcache.lighttpd.net/ >, made by a lighttpd developer?
ax
yes I use "disk_only" for all "eaccelerator.keys", "eaccelerator.sessions", and "eaccelerator.content". I use "top" to see RAM usage. Im not using XCache. UPDATE: After reboot server also not works, and when change "disk_only" to "shm_only", the virtual memory also used too. It looks like my server just ignore the new setting.
Mwebe Nkrumah
how are you applying the settings? via php.ini? what does the output of phpinfo() say?
ax
Im applying the settings in "/etc/php.d/eaccelerator.ini". The phpinfo() of eAccelerator is here: http://img717.imageshack.us/img717/7960/screenshotj.png
Mwebe Nkrumah