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

semprot

Well-Known Member
#63
my apc is clearing out again even my litespeed is not restarted (i compared the apc uptime & litespeed uptime). apc uptime is about 6 mins, while the lsws uptime is about 30 mins now.

It started to happen after my physical server restart. It was fine before.

my memory usage is low.. about 12 percent.

any idea what to check? :confused:
 

semprot

Well-Known Member
#65
if you have PHP suEXEC (http://www.litespeedtech.com/docs/webserver/config/general/#phpSuExec) enabled (for shared hosting), APC uptime will be like this.
It is disabled and i use dedicated server.
Litespeed uptime is very good (1 day+ -- since previous restart).
But APC uptime is 36 mins or so.

Any idea?

Code:
Runtime Settings
apc.cache_by_default	1
apc.canonicalize	1
apc.coredump_unmap	0
apc.enable_cli	1
apc.enabled	1
apc.file_md5	0
apc.file_update_protection	2
apc.filters	
apc.gc_ttl	3600
apc.include_once_override	0
apc.lazy_classes	0
apc.lazy_functions	0
apc.max_file_size	20M
apc.mmap_file_mask	/tmp/apc.nyEjzk
apc.num_files_hint	1000
apc.preload_path	
apc.report_autofilter	0
apc.rfc1867	0
apc.rfc1867_freq	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_
apc.rfc1867_ttl	3600
apc.serializer	default
apc.shm_segments	1
apc.shm_size	1024M
apc.slam_defense	1
apc.stat	0
apc.stat_ctime	0
apc.ttl	0
apc.use_request_time	1
apc.user_entries_hint	4096
apc.user_ttl	7200
apc.write_lock	1
Thanks.

Addition : i got this tips on stackoverflow :
"How many Litespeed processes do you have? I'm afraid that if you have more than 1 process, you'll have the same problem as with fastcgi/suphp, so you should try to recompile APC with --disable-apc-mmap".

How to know how many litespeed process that i have? i use 2 cpu license.
Code:
root@mybox [~]# pstree -p | grep litespeed
        |-litespeed(19722)-+-httpd(19723)
        |                  |-litespeed(19724)-+-lsphp5(19730)-+-lsphp5(19734)
        |                  |                  |-{litespeed}(19726)
        |                  |                  `-{litespeed}(19728)
        |                  `-litespeed(19725)-+-lsphp5(19772)-+-lsphp5(19809)
        |                                     |-{litespeed}(19727)
        |                                     `-{litespeed}(19729)
 
Last edited:

whatsup

Active Member
#67
Same problems here also

Been reading different treads about this. Just upgraded to Litespeed 1 CPU version one month ago. I am now testing out Nginx also to see if I can get it to our server to work properly with APC.
 

webizen

Well-Known Member
#68
It is disabled and i use dedicated server.
Litespeed uptime is very good (1 day+ -- since previous restart).
But APC uptime is 36 mins or so.

Any idea?

Code:
Runtime Settings
apc.cache_by_default	1
apc.canonicalize	1
apc.coredump_unmap	0
apc.enable_cli	1
apc.enabled	1
apc.file_md5	0
apc.file_update_protection	2
apc.filters	
apc.gc_ttl	3600
apc.include_once_override	0
apc.lazy_classes	0
apc.lazy_functions	0
apc.max_file_size	20M
apc.mmap_file_mask	/tmp/apc.nyEjzk
apc.num_files_hint	1000
apc.preload_path	
apc.report_autofilter	0
apc.rfc1867	0
apc.rfc1867_freq	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_
apc.rfc1867_ttl	3600
apc.serializer	default
apc.shm_segments	1
apc.shm_size	1024M
apc.slam_defense	1
apc.stat	0
apc.stat_ctime	0
apc.ttl	0
apc.use_request_time	1
apc.user_entries_hint	4096
apc.user_ttl	7200
apc.write_lock	1
Thanks.

Addition : i got this tips on stackoverflow :
"How many Litespeed processes do you have? I'm afraid that if you have more than 1 process, you'll have the same problem as with fastcgi/suphp, so you should try to recompile APC with --disable-apc-mmap".

How to know how many litespeed process that i have? i use 2 cpu license.
Code:
root@mybox [~]# pstree -p | grep litespeed
        |-litespeed(19722)-+-httpd(19723)
        |                  |-litespeed(19724)-+-lsphp5(19730)-+-lsphp5(19734)
        |                  |                  |-{litespeed}(19726)
        |                  |                  `-{litespeed}(19728)
        |                  `-litespeed(19725)-+-lsphp5(19772)-+-lsphp5(19809)
        |                                     |-{litespeed}(19727)
        |                                     `-{litespeed}(19729)
Our lab test shows '--disable-apc-mmap' makes no difference.
 

NiteWave

Administrator
#70
Code:
- litespeed uptime is good, but
- apc uptime is bad
if you refresh the apc stats page repeatly,
check the apc.mmap_file_mask value, like /tmp/apc.nyEjzk,
you should see 2 different files, corresponding 2 groups of lsphp5.
 

semprot

Well-Known Member
#71
Code:
- litespeed uptime is good, but
- apc uptime is bad
if you refresh the apc stats page repeatly,
check the apc.mmap_file_mask value, like /tmp/apc.nyEjzk,
you should see 2 different files, corresponding 2 groups of lsphp5.
I see no "apc.mmap_file_mask" on my stats page. I think because my APC was compiled with "--disable-apc-mmap".
Should i recompile APC with mmap?
(as far as i remember, when my APC had mmap, i only saw 1 apc.mmap_file_mask value on stats page)

If not, what should i do?
 

NiteWave

Administrator
#72
Should i recompile APC with mmap?
yes, please. we study the option -disable-apc-mmap in 2 ways:
1.by reading the APC source code
2.actual tests

as we pointed out in previous thread: it not working at all.
--enable-apc-mmap is enabled by default since APC 3.0.18.
so it's a better method than --disable-apc-mmap which is default before 3.0.18

i only saw 1 apc.mmap_file_mask value on stats page
please refresh repeatedly, it should have 2 values if you have 2 groups of lsphp5
root@mybox [~]# pstree -p | grep litespeed
|-litespeed(19722)-+-httpd(19723)
| |-litespeed(19724)-+-lsphp5(19730)-+-lsphp5(19734)
| | |-{litespeed}(19726)
| | `-{litespeed}(19728)
| `-litespeed(19725)-+-lsphp5(19772)-+-lsphp5(19809)
| |-{litespeed}(19727)
| `-{litespeed}(19729)
one group is lsphp5(19730), another one is lsphp5(19772)
 

semprot

Well-Known Member
#73
yes, please. we study the option -disable-apc-mmap in 2 ways:
1.by reading the APC source code
2.actual tests

as we pointed out in previous thread: it not working at all.
--enable-apc-mmap is enabled by default since APC 3.0.18.
so it's a better method than --disable-apc-mmap which is default before 3.0.18


please refresh repeatedly, it should have 2 values if you have 2 groups of lsphp5


one group is lsphp5(19730), another one is lsphp5(19772)
I have recompiled APC with mmap enabled.

But i still see 1 value. Is it the cause of my problem?

FYI i have LSAPI_AVOID_FORK=1 , i don't know whether it is related with 1 mmap or not.
Code:
root@mybox [~]# pstree -p | grep litespeed
        |-litespeed(24846)-+-httpd(24847)
        |                  |-litespeed(24848)-+-lsphp5(24856)-+-lsphp5(24857)
        |                  |                  |-{litespeed}(24850)
        |                  |                  `-{litespeed}(24851)
        |                  `-litespeed(24849)-+-lsphp5(24901)-+-lsphp5(24904)
        |                                     |-{litespeed}(24852)
        |                                     `-{litespeed}(24853)
Code:
apc.cache_by_default	1
apc.canonicalize	1
apc.coredump_unmap	0
apc.enable_cli	1
apc.enabled	1
apc.file_md5	0
apc.file_update_protection	2
apc.filters	
apc.gc_ttl	3600
apc.include_once_override	0
apc.lazy_classes	0
apc.lazy_functions	0
apc.max_file_size	20M
apc.mmap_file_mask	/tmp/apc.3iYCNd
apc.num_files_hint	1000
apc.preload_path	
apc.report_autofilter	0
apc.rfc1867	0
apc.rfc1867_freq	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_
apc.rfc1867_ttl	3600
apc.serializer	default
apc.shm_segments	1
apc.shm_size	1024M
apc.slam_defense	1
apc.stat	0
apc.stat_ctime	0
apc.ttl	0
apc.use_request_time	1
apc.user_entries_hint	4096
apc.user_ttl	7200
apc.write_lock	1
 

NiteWave

Administrator
#74
But i still see 1 value. Is it the cause of my problem?
should not be possible.

maybe your site's traffic is idle ? if so, you can generate some traffic and test again. also, you can create a script to access apc.php for 100 or 1000 times, grep "Uptime" and "apc.mmap_file_mask" every time, should be able to see 2 values.
 
Top