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
  #1  
Old 06-17-2011, 08:38 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Default Trying to use APC but it seems to be clearing out?

I am very new to Litespeed but I must say I have been hugely impressed by it's performance. We went from a dedicated server with server loads around 1 to a vps hybrid and using Litespeed and server loads barely go over .30.

I am trying to use some sort of cache and have found a lot of conflicting information in what can or can't be used.

I would like to use APC or xcache. I have them both installed and they both work to an extent. Both seem to reset after so many seconds or minutes almost like the web server is restarted.

I am only trying one at a time, as I know you can't have two opcode caches running at the same time. I also have php suexec enabled for users home directory in the configuration for litespeed.

It is a CentOS server using Cpanel. Any help would be appreciated.
Reply With Quote
  #2  
Old 06-17-2011, 09:44 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
For either opcode cache to work, php suEXEC needs to be disabled (Admin Console -> Configuration -> Server -> General -> Load Apache Configuration File -> PHP suEXEC => No)
Reply With Quote
  #3  
Old 06-17-2011, 09:50 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
I did turn the suEXEC option off last night and was using xcache and it still seemed like it was resetting every 30 seconds to a minute. When I first set it like that last night it seemed like it was working good and had over 35,000 hits showing and then it reset and after that it seemed to reset about every minute.
Reply With Quote
  #4  
Old 06-17-2011, 10:47 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
With PHP suEXEC off, PHP runs as Webserver user (dedicated hosting) instead of individual account user. Opcode cache would _not_ work in the shared hosting environment. It resets frequently in shared environment as you described.

Please turn suEXEC off and see issue re-appears.
Reply With Quote
  #5  
Old 06-17-2011, 12:18 PM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Ok, I turned suEXEC off and turned xcache back on.

About every 10 minutes or so it is like it is resetting. All of the hits that are showing on the xcache admin along with memory usage get cleared out and starts over again.

Here are my settings displayed in xcache admin:
Version 1.3.2
Modules Built cacher
Readonly Protection N/A
Cache Init Time 2011-06-17 14:15:29
Cache Instance Id 28592
Opcode Cache enabled, 134,217,728 bytes, 1 split(s), with 8192 slots each
Variable Cache enabled, 33,554,432 bytes, 1 split(s), with 8192 slots each
Shared Memory Schemes mmap

Directive Local Value Master Value
xcache.admin.enable_auth On On
xcache.cacher On On
xcache.coredump_directory no value no value
xcache.count 1 1
xcache.gc_interval 300 300
xcache.mmap_path /dev/zero /dev/zero
xcache.readonly_protection 1 1
xcache.shm_scheme mmap mmap
xcache.size 128M 128M
xcache.slots 8K 8K
xcache.stat On On
xcache.test no value no value
xcache.ttl 3600 3600
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 7200 7200
xcache.var_size 32M 32M
xcache.var_slots 8K 8K
xcache.var_ttl 3600 3600
Reply With Quote
  #6  
Old 06-17-2011, 12:33 PM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
I just upped the size of the shared memory to 64MB and set the xcache.size to 48MB to see if that makes any difference. The kernel was set to 32MB originally. I am only guessing that it was clearing it out because of filling the shared memory?
Reply With Quote
  #7  
Old 06-17-2011, 04:11 PM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
The new memory settings at first seemed like it was working but it still ends up resetting itself. I don't know it if it litespeed that is restarting or what might be causing it. I don't know enough to figure out what to look for that would be causing it.
Reply With Quote
  #8  
Old 06-17-2011, 05:22 PM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
I wanted to try APC also and it is doing the same thing. Resetting way before the ttl setting would kick in.
Reply With Quote
  #9  
Old 06-17-2011, 11:27 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
what's the APC settings in php.ini ?
Reply With Quote
  #10  
Old 06-18-2011, 03:56 AM
NUTNDUN NUTNDUN is offline
Member
 
Join Date: Jun 2011
Posts: 17
Here are my settings for APC:
------------------
extension="apc.so"
apc.shm_size="128M"
apc.num_files_hint="1000"
apc.user_entries_hint="4096"
apc.ttl="3600"
apc.user.ttl="3600"
apc.max_file_size="1M"
apc.gc_ttl="7200"
apc.stat="0"
-----------------



and here are my settings I have for xcache:
---------------------
[xcache-common]
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
auto_globals_jit = Off

[xcache.admin]
xcache.admin.user = "adm"
xcache.admin.pass = "pw"

[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 96M
xcache.count = 1
xcache.slots = 4K
xcache.ttl = 3600
xcache.gc_interval = 300
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.cacher = On

;var settings
xcache.var_size = 4M
xcache.var_count = 1
xcache.var_slots = 4K

;var ttl settings
xcache.var_ttl = 3600
xcache.var_maxttl = 7200
xcache.var_gc_interval = 300



It doesn't matter which one I use, they both clear out after a while and well before the ttl setting is reached. 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.
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 01:50 PM.



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