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

Go Back   LiteSpeed Support Forums > External Applications > PHP > [solved] Rapid APC Caching Causes Fragmentation

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2012, 01:56 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Question [solved] Rapid APC Caching Causes Fragmentation

I have a feature on my website to cache visitor guests on each page.

If i enabled that feature - which means apc stores lot of things (page) rapidly, because i have lot of visitors, fragmentation increases overtime, and i have to restart httpd sometimes.

If i disable that feature, everything is fine.

Here is my APC setting
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	/home/apc/apc.m8wvpV
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
Here is some of my lsws setting
Code:
PHP_LSAPI_MAX_REQUESTS=2500
PHP_LSAPI_CHILDREN=35
LSAPI_AVOID_FORK=1
I think the saved visitor cache is a kind of "full generated-html code", so for example the cache "size" for each page could reach +- 100kb.
Does that mean i should increase apc.user_entries_hint to more than 100kb?
__________________
I use litespeed

Last edited by NiteWave; 12-14-2012 at 06:28 PM..
Reply With Quote
  #2  
Old 12-14-2012, 04:04 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
Quote:
Does that mean i should increase apc.user_entries_hint to more than 100kb?
no, user_entries_hint is number of enties, each entry size is 100kb if your guess right.
Reply With Quote
  #3  
Old 12-14-2012, 06:52 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
no, user_entries_hint is number of enties, each entry size is 100kb if your guess right.
so if i want to cache variable that has X kb in size, user_entries_hint must be exactly minimal X kb in size to avoid defragmentation?
__________________
I use litespeed
Reply With Quote
  #4  
Old 12-14-2012, 07:54 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
Quote:
so if i want to cache variable that has X kb in size, user_entries_hint must be exactly minimal X kb in size to avoid defragmentation?
no, it's not much related. do you know how many variables will be cached ?
say there are 100 variables, then set user_entries_hint a bit larger than 100, e.g., 120 will avoid fragmentation.
Reply With Quote
  #5  
Old 12-14-2012, 08:15 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
no, it's not much related. do you know how many variables will be cached ?
say there are 100 variables, then set user_entries_hint a bit larger than 100, e.g., 120 will avoid fragmentation.
Sorry i still don't understand.

If i want to cache 3 variables at same script execution :
PHP Code:
$one '1234567890';// 10 characters
$two '123456789012345';// 15 characters
$three '12345678901234567890';// 20 characters 
user_entries_hint should be larger than which one?
  • > 3 (number of variables)
  • > 45 (10 characters + 15 characters + 20 characters)
  • > 20 (max characters on all variables)
__________________
I use litespeed
Reply With Quote
  #6  
Old 12-14-2012, 08:20 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
the 1st one:
> 3 (number of variables)
Reply With Quote
  #7  
Old 12-14-2012, 08:32 AM
semprot semprot is offline
Member
 
Join Date: Apr 2012
Posts: 41
Quote:
Originally Posted by NiteWave View Post
the 1st one:
> 3 (number of variables)
Thanks...
__________________
I use litespeed
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 11:09 AM.



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