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

Go Back   LiteSpeed Support Forums > External Applications > PHP > [solved] High APC Fragmentation but Low Usage

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2012, 08:55 PM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Question [solved] High APC Fragmentation but Low Usage

I have a strange problem, APC fragmentation seems increasing through time, although usage is low.

Apc stats image is attached below.



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.BHafv6
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	3048M
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
Any clue what should i change?
Attached Images
File Type: jpg apc-1.jpg (50.9 KB, 12 views)
__________________
I use litespeed

Last edited by NiteWave; 12-11-2012 at 05:15 PM..
Reply With Quote
  #2  
Old 12-10-2012, 04:06 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
I guess it may due to variable cache. if php script use apc_delete(), then it may cause fragment illustrated in the screenshot. to experiment, you can temporarily disable variable cache to watch the fragment status.
Reply With Quote
  #3  
Old 12-10-2012, 08:11 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
I guess it may due to variable cache. if php script use apc_delete(), then it may cause fragment illustrated in the screenshot. to experiment, you can temporarily disable variable cache to watch the fragment status.
How to temporarily disable variable cache?

However since first post, i've doubled shm size (6gb now), and fragmentation is still ugly.

Attached Images
File Type: jpg apc-3.jpg (51.3 KB, 12 views)
__________________
I use litespeed
Reply With Quote
  #4  
Old 12-10-2012, 06:19 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
did some search, have not found a simple way to disable user variable cache.

for fragment, it's more relating to add/delete cache entry frequently.
since you set
apc.ttl 0
apc.user_ttl 7200
which add operation can be 0 if shared memory always have free space(in your case). but if php script use apc_delete() to delete cache entry purposely, it will cause fragment.
Reply With Quote
  #5  
Old 12-10-2012, 07:39 PM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
did some search, have not found a simple way to disable user variable cache.

for fragment, it's more relating to add/delete cache entry frequently.
since you set
apc.ttl 0
apc.user_ttl 7200
which add operation can be 0 if shared memory always have free space(in your case). but if php script use apc_delete() to delete cache entry purposely, it will cause fragment.
My site has guests & logged in visitors. For guests, the view is cached entirely by APC (i think) to speedup site. Considering the amount of guests and cached pages, i agree maybe add operation is frequent. But apc_delete is not used frequently on my site i believe, because i set the script to cache on long time (5 hours).
__________________
I use litespeed
Reply With Quote
  #6  
Old 12-10-2012, 08:26 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
you can search apc_delete() and apc_cas() in php source if these functions exist

any configuration options in your site's php script regarding apc?

also change the settings of
apc.user_entries_hint 4096
to 10, to 16K(16384) etc, see the status of fragment.
Reply With Quote
  #7  
Old 12-10-2012, 08:42 PM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
you can search apc_delete() and apc_cas() in php source if these functions exist

any configuration options in your site's php script regarding apc?

also change the settings of
apc.user_entries_hint 4096
to 10, to 16K(16384) etc, see the status of fragment.
I've checked the code, there is no apc_delete() & apc_cas(), but the apc_store() uses third parameter (the TTL -- that i set to 5 hours)
PHP Code:
apc_store($this->id($id), $value$vbulletin->options['vbo_ttl']); 
And there is apc_clear_cache, but i believe the apc_clear_cache is called manually from admin page. And i've just changed apc.user_entries_hint to 16384

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.gcrVQI
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	6144M
apc.slam_defense	1
apc.stat	0
apc.stat_ctime	0
apc.ttl	0
apc.use_request_time	1
apc.user_entries_hint	16384
apc.user_ttl	7200
apc.write_lock	1
__________________
I use litespeed
Reply With Quote
  #8  
Old 12-11-2012, 10:36 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Update: after i set "apc.user_entries_hint" to higher number, fragmentation was better, i think it is solved. Thanks
__________________
I use litespeed
Reply With Quote
  #9  
Old 12-11-2012, 06:14 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
thanks, a good example to discover apc.user_entries_hint behavior which most people(include both of us) may not know of. experience gained
Reply With Quote
Reply

Tags
apc, fragmentation

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 04:41 PM.



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