Understanding of whats necessary to properly configure PHP Selector, e.g., APC settings and similar parameters
Announcement
Collapse
No announcement yet.
PHP Selector Configuration (Especially APC)
Collapse
X
-
Hi,
Id like to ask for advice...Im confused and I admit it. :-)
Weve tested PHP Selector for some time. Our native PHP configuration includes cPanels version of eAccelerator (installed via EasyApache). But we want to offer PHP Selector so users can choose their own opcode cache and other PHP modules.
When we were researching this, CL told us that PHP Selector includes optimal default settings for things like APC, so we didn need to configure any of that. We did adjust a few basic variables like PHP memory, max upload size, etc.
Initial testing went well, including APC.
After deployment, now users report that APC is unusable. When they activate it, they cannot access their WordPress admin area (the request just times out). In the rare cases they can access the admin area, all admin pages show 404s. Error logs are full of "could not allocate memory for pool" messages.
I put in a ticket with CL, and they told me this is due to incorrect APC configuration. They pointed me to several generic documents on how to properly configure APC (mask settings, etc.).
I am confused because I thought that all this was configured simply by installing PHP Selector (at least for basic settings), and because we didn have any issues like this before. In addition, since our native PHP configuration doesn include APC, I am not sure how we could configure it anyway.
So Im hoping someone can tell me:
- What do we need to do in order to configure APC to work properly in PHP Selector (if it is not indeed automatic as we thought)?
- What other things are not automatically configured as we thought? In other words, what other things do we need to configure to enable our users to avoid similar issues with other modules?
Thanks and best regards (and happy holidays),
Mark
-
The APC itself could not cause such issues, the only thing when it could be is due to extremely high apc.shm_size value, larger then mem/pmem from lvectl. When running through LiteSpeed please also be sure to set Memory Soft Limit and Memory Hard Limit to at least 650/800M ( Admin Console --> Configuration --> Server --> External App --> lsphp5) .
In most cases the difference is really in how busy user is.
Anyway if there are some issues after enabling APC we would like to check it directly on a server, create a ticket for us and we will try to help.
Comment
-
Ah, and about APC adjustment, if you use it from our PHP-Selector you have to adjust /opt/alt/php53/etc/http://php.d.all/apc.ini file (for php53 as example) , then use cagefsctl --rebuild-alt-php-ini to actually push changes to users.
Comment
-
Actually, Bogdan, may I ask for the recommended APC configuration settings in CloudLinux-supplied alt PHP versions for these two scenarios:
1) A shared hosting server with 16 GB RAM and about 400 sites.
2) A private VPS with 4 GB RAM running 1 busy site. Even though it is not a shared situation, we recommended CloudLinux for the security and performance benefits (CageFS, PHP Selector, mod_lsapi, etc.).
Thanks!
Mark
Comment
-
From what I know for shared server apc.shm_size should be set to 128M .
For a personal server with single website (single user) its better to calculate personal shm_size, this could be done with apc.php file (which is placed in /usr/share/alt-phpXX-pecl-apc/apc.php for every php version), just copy it to domain folder, set right permissions and open in browser, you will get a nice report about APC. You have to look into Hits & Misses columns on the right, and also to Memory Usage. The best APC works when Hits goes to 99% . You can start from settings shm_size to 128M then increase if you see it eats up all memory. Just remember to leave it running for few minutes to actually build some cache.
Here is a screen of it : http://pbrd.co/1rUsNY3
Comment
-
Hi Bogdan,
Thanks for this information. A followup question regarding shared hosting:
If we set the shared server apc.shm_size to 128, is that too high? That gives every use 128M, correct? I think that might use up the RAM quickly on a server with a few dozen accounts, right? Or am I misinterpreting the way the setting is implemented?
Thanks,
Mark
Comment
Comment