LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Trying to use APC but it seems to be clearing out?

Reply
 
Thread Tools Display Modes
  #11  
Old 06-18-2011, 04:48 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Quote:
I think it has something to do with the number of processes in some way from what I read on the xcache website in the faq section
maybe you refer:
http://xcache.lighttpd.net/wiki/Faq#...hebeingcleared

then how many litespeed processes are running on your server?
#pstree -p | grep litespeed

what you observed is just the reason why on shared hosting environment, only eAccelerator is recommended. all php processes can share the opcode cache under a single disk folder, like /tmp/eaccelerator. usually, php suExec is enabled in such environment. APC and XCache only keep opcode cache in memory. so each group of php processes will have its own cache.
Reply With Quote
  #12  
Old 06-18-2011, 04:54 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Here is the output of the command you posted:

pstree -p | grep litespeed
|-litespeed(20208)-+-httpd(20209)
| `-litespeed(20210)-+-lsphp5(1343)---sh(5522)---convert(5523)


php suEXEC has been disabled since it was mentioned two days ago.
Reply With Quote
  #13  
Old 06-18-2011, 05:00 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
ok, this suggest me might that reason ....
please post the lsphp5's setting:
Server -> External App -> lsphp5: View
Reply With Quote
  #14  
Old 06-18-2011, 05:08 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Here are the settings:

Name lsphp5

Address uds://tmp/lshttpd/lsphp5.sock

Notes Not Set

Max Connections 35

Environment
PHP_LSAPI_MAX_REQUESTS=500
PHP_LSAPI_CHILDREN=35

Initial Request Timeout (secs) 60

Retry Timeout (secs) 0

Persistent Connection Yes

Connection Keepalive Timeout Not Set

Response Buffering No

Auto Start Yes

Command $SERVER_ROOT/fcgi-bin/lsphp5

Back Log 100

Instances 1

suEXEC User Not Set

suEXEC Group Not Set

Run On Start Up Not Set

Max Idle Time 10

Priority 0

Memory Soft Limit (bytes) 450M

Memory Hard Limit (bytes) 500M

Process Soft Limit 200

Process Hard Limit 200
Reply With Quote
  #15  
Old 06-18-2011, 05:10 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
change "Max Idle Time" 10 to -1
Reply With Quote
  #16  
Old 06-18-2011, 05:18 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Ok, will try it and let you know how it goes.
Reply With Quote
  #17  
Old 06-18-2011, 06:17 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
I thought for sure it was good to go because that was the longest it lasted without being reset. It got up to about 69,000 hits and then it cleared out again.
Reply With Quote
  #18  
Old 06-18-2011, 09:24 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Quote:
pstree -p | grep litespeed
|-litespeed(20208)-+-httpd(20209)
| `-litespeed(20210)-+-lsphp5(1343)---sh(5522)---convert(5523)
APC or xcache is associated with a lsphp5 process(or a group of processes:a parent process, a few child processes). in example of above case, it's lsphp5 which pid=1343. if in some reason, this process is killed and a new lsphp5 process is started by its parent litespeed(in above example, pid=20210), then you'll notice opcode cache is cleared.

so monitor lsphp5's pid at the same time while monitoring the cache hits number. if the pid changes, the issue is turned to be how to keep it longer and what's reason it's killed and restarted again.
Reply With Quote
  #19  
Old 06-21-2011, 11:31 PM
cmanns cmanns is offline
Senior Member
 
Join Date: Jun 2010
Posts: 100
Quote:
Originally Posted by NiteWave View Post
maybe you refer:
http://xcache.lighttpd.net/wiki/Faq#...hebeingcleared

then how many litespeed processes are running on your server?
#pstree -p | grep litespeed

what you observed is just the reason why on shared hosting environment, only eAccelerator is recommended. all php processes can share the opcode cache under a single disk folder, like /tmp/eaccelerator. usually, php suExec is enabled in such environment. APC and XCache only keep opcode cache in memory. so each group of php processes will have its own cache.
We've used Xcache for over 4 years with fastcgi. Over a year now with lsws

Set max requests to like 2k or so, set a few more instances. Set xcache to /dev/shm with 64mb mem

We get great performance in an env with dosenz of suexec php users. We get about 2-3 tops per vhost so they cache hit good. Also set childs lower and parents 2-4.

APC and EA suck. I've tried them on and off over the years, xcache gives us lowest php exec and low cpu usage.
__________________
-William C.Manns Owner of XenServ Co
Need LiteSpeed Hosting, Server Tuning, or Other Help I'm your guy

http://xenserv.com http://evilpuma.com
Reply With Quote
  #20  
Old 06-22-2011, 03:52 PM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
I agree xcache is much faster. I have been running eaccelerator for a little bit and it seemed to do the same reset but not as often. I just switched it back to xcache and the page loading is almost twice as fast.

If it only resets once an hour I can live with that. I will tweak the settings some more over the next couple of days and maybe even try some of the settings that you mentioned.

I did change these settings:

PHP_LSAPI_MAX_REQUESTS=1
PHP_LSAPI_CHILDREN=50

and I still have keep alive set to -1.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:43 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.