Trying to use APC but it seems to be clearing out?

prandah

Well-Known Member
#42
hello webizen
i have little confuse

[root@poseidon php]# /usr/local/lsws/fcgi-bin/lsphp5 -i | egrep -i 'apc|xcache|eaccelarator'
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
XCache
XCache Support => enabled
xcache.admin.enable_auth => On => On
xcache.cacher => On => On
xcache.coredump_directory => no value => no value
xcache.count => 1 => 1
xcache.gc_interval => 0 => 0
xcache.mmap_path => /dev/zero => /dev/zero
xcache.readonly_protection => 0 => 0
xcache.shm_scheme => mmap => mmap
xcache.size => 0 => 0
xcache.slots => 8K => 8K
xcache.stat => On => On
xcache.test => 0 => 0
xcache.ttl => 0 => 0
xcache.var_count => 1 => 1
xcache.var_gc_interval => 120 => 120
xcache.var_maxttl => 0 => 0
xcache.var_size => 0 => 0
xcache.var_slots => 8K => 8K
xcache.var_ttl => 0 => 0
xcached enable

but when i check

[root@poseidon lsws]# fcgi-bin/lsphp5 -v
PHP 5.2.17 (litespeed) (built: Nov 23 2011 17:33:56)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
[root@poseidon lsws]#
 

webizen

Well-Known Member
#43
I have to take it back.

you need to be in /usr/local/lsws/fcgi-bin/ to check lsphp5.

for below, it is likely you are in a different directory (.../php) that has a copy of php.ini with "extension=xcache.so" in it.

[root@poseidon php]# /usr/local/lsws/fcgi-bin/lsphp5 -i | egrep -i 'apc|xcache|eaccelarator'
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
...
However, your fcgi-bin/lsphp5 uses a copy of php.ini with *NO* "extension=xcache.so" (xcache not enabled). that's why 'fcgi-bin/lsphp5 -v' shows no xcache. To find out which php.ini your lsphp5 uses, do following.
/usr/local/lsws/fcgi-bin/lsphp5 -i| grep php.ini
So in your case, lsphp5 doesn't not have xcache enabled.
 

prandah

Well-Known Member
#45
hello
i have install it
but i still confused

PHP:
HTTP/1.0 200 OK

X-Powered-By: PHP/5.2.17

Cache-Control: private

Pragma: private

Content-Type: text/html; charset=ISO-8859-1

X-UA-Compatible: IE=7

Content-Encoding: gzip

Content-Length: 19414
Date: Sun, 27 Nov 2011 10:15:05 GMT

Server: LiteSpeed

X-Cache: MISS from wire.clearos.lan

X-Cache-Lookup: MISS from wire.clearos.lan:3128

Via: 1.0 wire.clearos.lan:3128 (squid/2.6.STABLE21)

Connection: keep-alive
how to know xcache work ?
 

azn_romeo_4u

Well-Known Member
#48
I'm having problems. I used the build php with xcache and memcached check in the lsws admin page. I noted down the install directory for xcache.so

When I check php -v it says xcache is installed. But when I view a phpinfo on a web page no xcache is installed.

zend_extension = "/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/xcache.so"
[xcache.admin]
xcache.admin.auth = off
xcache.admin.enable_auth = off
xcache.admin.user = "test"
xcache.admin.pass = "098f6bcd4621d373cade4e832627b4f6"
;xcache.admin.pass = "53f018f2ee1fc4fb7ad2be1cc7b9ed43"
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 256M
xcache.cacher="On"
xcache.coredump_directory=""
xcache.count="8"
;xcache.coveragedump_directory="/tmp/pcov/"
xcache.optimizer="Off"
xcache.readonly_protection="Off"
xcache.test="Off"
xcache.slots="8K"
xcache.readonly_protection = Off
xcache.ttl="3600"
xcache.gc_interval = 300
xcache.var_size = 4M
xcache.var_count = 8
xcache.var_slots = 1K
; default ttl
xcache.var_ttl = 3600
xcache.var_maxttl = 7200
xcache.var_gc_interval = 300
 

prandah

Well-Known Member
#50
When I check php -v it says xcache is installed. But when I view a phpinfo on a web page no xcache is installed.
if you check from php -v i think it's wrong
try fcgi-bin/lsphp5 -v

if you check with php -v alsi it just chect your server
and not your litespeed CMIIW

example :

[root@xxxx lsws]# fcgi-bin/lsphp5 -v
PHP 5.2.17 (litespeed) (built: Nov 23 2011 17:33:56)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
with the ionCube PHP Loader v4.0.11, Copyright (c) 2002-2011, by ionCube Ltd., and
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend Technologies
[root@xxxx lsws]#
 
Last edited:

semprot

Well-Known Member
#51
maybe you refer:
http://xcache.lighttpd.net/wiki/Faq#Whyismycachebeingcleared

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.
Here it is (while i open litespeed admin on whm)
Code:
root@mybox [~]# pstree -p | grep litespeed
        |-litespeed(28249)-+-httpd(28250)
        |                  |-litespeed(28251)-+-admin_php(32375)
        |                  |                  |-{litespeed}(28253)
        |                  |                  `-{litespeed}(28254)
        |                  `-litespeed(28252)-+-lsphp5(28271)-+-lsphp5(32446)
        |                                     |-{litespeed}(28255)
        |                                     `-{litespeed}(28256)
ok, this suggest me might that reason ....
please post the lsphp5's setting:
Server -> External App -> lsphp5: View
Here it is
Code:
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) : 1024M
Memory Hard Limit (bytes) : 1024M
Process Soft Limit : 500
Process Hard Limit : 500
What setting should i change? Max idle time to -1?
 

semprot

Well-Known Member
#57
please memo down the pid of parent lsphp5, see if it changes too.
in your previous post,

parent lsphp5 pid is 28271
Here is my result now

Code:
root@mybox[~]# pstree -p | grep litespeed
        |-litespeed(10551)-+-httpd(10552)
        |                  |-litespeed(10553)-+-lsphp5(10559)-+-lsphp5(14546)
        |                  |                  |-{litespeed}(10555)
        |                  |                  `-{litespeed}(10556)
        |                  `-litespeed(10554)-+-lsphp5(10595)-+-lsphp5(13525)
        |                                     |-{litespeed}(10557)
        |                                     `-{litespeed}(10558)
Yes it is changed now, so it seems litespeed was restarted?
 
Last edited:
#58
yes, if pid of litespeed changed, it must have been restarted.

litespeed may restart to fix 503 error automatically.
in a site with buggy php script, this may be helpful without whole site down.
 

semprot

Well-Known Member
#59
yes, if pid of litespeed changed, it must have been restarted.

litespeed may restart to fix 503 error automatically.
in a site with buggy php script, this may be helpful without whole site down.
Usually when i got an 503 error and LS was restarted, i got an e-mail notification. Why i didn't get any notification?

Is there any log that i can check to see why it happened?
I tried to open "Server Log Viewer" but there are too many.
 
Top