[Resolved] PHP APC Opcode cache issues

Status
Not open for further replies.
#1
Hi guys,

I have a few problems regarding APC cache. I used SuEXEC Daemon and got APC to work properly for 4 hours. I tried to increase shm size to 2GB, however, litespeed seems to crash and websites don't work. When I reduce it to 1gb, it works again.

Also, is it alright for APC to be enabled system-wide in a shared hosting environment?

Thank you.
 

NiteWave

Administrator
#2
2GB should not be a problem.
I know a user set shm=6GB and working fine. his APC version is 3.1.13, lsphp version is 5.3.28
it's known APC not working well with php 5.4 and above.
what's the lsphp's
Memory Soft Limit (bytes)
Memory Hard Limit (bytes) ?
they should be larger than 2G in your case.

Also, is it alright for APC to be enabled system-wide in a shared hosting environment?
it's ok.
 
#3
What sort of issues should I be expecting? I'm using PHP 5.4 currently.

Soft & Hard limit: 2047M

If I increase shm size, I should always make sure these limits are also increased right?

I still have the default litespeed configs.


Thanks a lot!
 
#5
I followed your advice, opted for Opcache instead.

I have a few questions though. Is the memory consumption limit applied globally or per user shared memory? Also, I used opcache-gui-master for monitoring and find that the file usage only displays cached files for that certain user. Seems odd, it works a lot different than apc. Note that I have CageFS enabled and I'm not sure if this is what causing it.

Thanks a lot!
 

NiteWave

Administrator
#6
>Is the memory consumption limit applied globally or per user shared memory?
neither. per lsphp5 process. a user may launch a few lsphp5 processes.

>Note that I have CageFS enabled and I'm not sure if this is what causing it.
Can you disable CageFS for a while to see if any difference ?
lsws web admin->Configuration->Server->General->Cloud Linux: Disabled
 
#7
Disabled CageFS, still same results. However, I placed the script on separate domains and I confirm that opcache is working. The downside is I can't seem to monitor which files are being cached globally - from a single domain. It would be better if Zend will release their own GUI :)

Thanks for the help NiteWave! I really appreciate it.
 

NiteWave

Administrator
#8
XCache has settings of
xcache.admin.user
xcache.admin.pass
xcache.admin.enable_auth, default is on.
(refer http://xcache.lighttpd.net/wiki/XcacheIni)
this is to prevent one user can know any info of other user's php script in xcache admin page.

e.g., xcache has this built-in mechanism
but looking at OPCache's configuration manul - http://www.php.net/manual/en/opcache.configuration.php
no such settings found.

so I'm not sure either how opcache-gui-master separate user from seeing each other... what's the link of opcache-gui-master you refer ?
 
#10
Thanks. I've quickly gone through the source code, still not understand why yet.
but if you choose xcache, you can see the cached php scripts globally as long as you set those 3 parameters correctly.
xcache.admin.user
xcache.admin.pass
xcache.admin.enable_auth
 
#11
Thanks. I've quickly gone through the source code, still not understand why yet.
but if you choose xcache, you can see the cached php scripts globally as long as you set those 3 parameters correctly.
xcache.admin.user
xcache.admin.pass
xcache.admin.enable_auth
Yep, xcache does have this, used this on a separate server. Will try it instead of opcache and see what would work for me.

Thanks a lot!
 
#12
Hi there!

I got opcache working properly, very bad mistake on my part. Apparently, I switched from suexec daemon to suexec worker at some point. I checked today and lsphp was not set to suexec daemon. Changed the settings back again and opgui is now showing all cached files. :p

Thanks.
 

NiteWave

Administrator
#13
Thank you for the update!

so only xcache is ok for shared hosting.
while showing all accounts' cached files is good for your case, it's a security risk in shared hosting environment. :)
 
#14
I'm actually using zend opcache. Yep, I understand that. Would you recommend listing critical opcache functions in disabled_functions?
 
Status
Not open for further replies.
Top