eAccelerator settings for PHP/Centos/Apache
Posted
by
bobbyh
on Server Fault
See other posts from Server Fault
or by bobbyh
Published on 2011-02-24T21:37:04Z
Indexed on
2011/02/24
23:26 UTC
Read the original article
Hit count: 318
I have eAccelerator installed on a server running Wordpress using PHP/Apache on CentOS. I am occassionally getting persistent "white pages", which presumably are PHP Fatal Errors (although these errors don't appear in my error_log). These "white pages" are sprinkled here and there throughout the site. They persist until I go to my eAccelerator control.php page and clear/clean/purge my caches, which suggests to me that I've configured eAccelerator improperly.
Here are my current /etc/php.ini settings:
memory_limit = 128M;
eaccelerator.shm_size="64"
, where shm.size is "the amount of shared memory eAccelerator should allocate to cache PHP scripts" (see http://eaccelerator.net/wiki/Settings)eaccelerator.shm_max="0"
, where shm_max is "the maximum size a user can put in shared memory with functions like eaccelerator_put ... The default value is "0" which disables the limit"eaccelerator.shm_ttl="0"
- "When eAccelerator doesn't have enough free shared memory to cache a new script it will remove all scripts from shared memory cache that haven't been accessed in at least shm_ttl seconds. By default this value is set to "0" which means that eAccelerator won't try to remove any old scripts from shared memory."eaccelerator.shm_prune_period="0"
- "When eAccelerator doesn't have enough free shared memory to cache a script it tries to remove old scripts if the previous try was made more then "shm_prune_period" seconds ago. Default value is "0" which means that eAccelerator won't try to remove any old script from shared memory."eaccelerator.keys = "shm_only"
- "These settings control the places eAccelerator may cache user content. ... 'shm_only' cache[s] data in shared memory"
On my phpinfo page, it says:
memory_limit 128M
Version 0.9.5.3
andCaching Enabled true
On my eAccelerator control.php page, it says
- 64 MB of total RAM available
Memory usage 77.70% (49.73MB/ 64.00MB)
- 27.6 MB is used by cached scripts in the PHP opcode cache (I added up the file sizes myself)
- 22.1 MB is used by the cache keys, which is populated by the Wordpress object cache.
My questions are:
- Is it true that there is only 36.4 MB of room in the eAccelerator cache for total "cache keys" (64 MB of total RAM minus whatever is taken by cached scripts, which is 27.6 MB at the moment)?
- What happens if my app tries to write more than 22.1 MB of cache keys to the eAccelerator memory cache? Does this cause eAccelerator to go crazy, like I've seen?
- If I change eaccelerator.shm_max to be equal to (say) 32 MB, would that avoid this problem?
- Do I also need to change shm_ttl and shm_prune_period to make eAccelerator respect the MB limit set by shm_max?
Thanks! :-)
© Server Fault or respective owner