Using APC and clearing cache w/ LSWS

#1
I have finally figured out why apc_clear_cache('user') does not work on LSWS. It looks like each page runs with it's own PHP process ID and looks like that is unique to the slice(for lack of better word) of APC.

I can identify this by using getmypid() and found that clear is fine when running same ID. Does anyone know how to flush all of the user cache for each ID?

In past we were forced to do a LSWS restart, but now with traffic increasing it is causing problems. Must be some work around?

Chris
 
#3
Thanks.. are there any other security or performance issue with this change? This is NOT a shared server and we have a cluster running LSWS mutli-core ent licenses
 
#5
OK I tried it but did not seem to work. Every time I hit an APC cahce it was still running with different PHP process ID. And the same thing when I ran the cache clear. It is alway a different PHP process ID so it only flushes the cahce entries with same PHP process ID.


Are we talking about the same thing? If so, any other ideas?
 
#7
pstree -p|egrep "ls|lite"
|-litespeed(18609)-+-httpd(18610)
| `-litespeed(18613)---lsphp5(18614)---lsphp5(19220


of course just one of the many nodes
 
#8
From a production node


pstree -p|egrep "ls|lite"
|-litespeed(31137)-+-httpd(31146)
| |-litespeed(31152)---lsphp5(31153)-+-lsphp5(776)
| | |-lsphp5(1944)
| | `-lsphp5(31744)
| |-litespeed(31154)---lsphp5(31162)-+-lsphp5(1809)
| | |-lsphp5(4677)
| | `-lsphp5(30535)
| |-litespeed(31155)---lsphp5(31163)-+-lsphp5(25791)
| | |-lsphp5(28574)
| | `-lsphp5(31290)
| |-litespeed(31156)---lsphp5(31164)-+-lsphp5(22181)
| | |-lsphp5(24985)
| | |-lsphp5(31284)
| | `-lsphp5(31299)
| |-litespeed(31157)---lsphp5(31169)-+-lsphp5(2041)
| | |-lsphp5(15169)
| | |-lsphp5(22329)
| | |-lsphp5(26968)
| | `-lsphp5(31326)
| |-litespeed(31158)---lsphp5(31166)-+-lsphp5(12822)
| | |-lsphp5(28274)
| | |-lsphp5(30816)
| | `-lsphp5(31332)
| |-litespeed(31159)---lsphp5(31165)-+-lsphp5(1262)
| | |-lsphp5(2251)
| | |-lsphp5(2252)
| | |-lsphp5(2253)
| | |-lsphp5(17069)
| | |-lsphp5(21901)
| | |-lsphp5(30962)
| | `-lsphp5(31266)
| `-litespeed(31160)---lsphp5(31161)-+-lsphp5(2015)
| |-lsphp5(2377)
| |-lsphp5(17068)
| |-lsphp5(23984)
| |-lsphp5(25758)
| `-lsphp5(31212)
|-lsphp5(27110)
 

NiteWave

Administrator
#9
in your example, there are 8 groups of lsphp5, lsphp5 in one group share 1 APC cache. for example, lsphp5 pid=31153,776,1944,31744 are in one group. the parent process is 31153, the rest are child processes and share APC cache created by 31153.

but share cache between groups of lsphp5 is not possible at present or not implemented feature yet in APC, please refer share cache between FAST CGI processes
 
#10
OK so looks liek the only way to flush is to do LSWS restart... Any idea why this seems to always generate a 503 restart email?

We have done this in the past but recently started getting emails - granted traffic is way up this time of year:

LiteSpeed Web server ***** on ****** restarts automatically to fix 503 Errors.

Is it safe to assume something was not graceful and users got error?
 
#11
not quite understand your question... but I think apc_clear_cache('user') caused 503 error.

to avoid this 503, may need modify the code? for example, before call apc_clear_cache('user'), first check if it exists?
 
Top