APC Cache and Fragmentation

Discussion in 'General' started by eagle eyes, Oct 23, 2012.

  1. eagle eyes

    eagle eyes New Member

    My APC is showing

    Fragmentation: 100.00% (296.0 KBytes out of 296.0 KBytes in 218 fragments)

    Free: 296.1 KBytes (0.2%) Hits: 266255 (94.4%)
    Used: 191.7 MBytes (99.8%)

    Code:
    apc.cache_by_default	1
    apc.canonicalize	1
    apc.coredump_unmap	0
    apc.enable_cli	0
    apc.enabled	1
    apc.file_md5	0
    apc.file_update_protection	2
    apc.filters	
    apc.gc_ttl	600
    apc.include_once_override	0
    apc.lazy_classes	0
    apc.lazy_functions	0
    apc.max_file_size	1M
    apc.mmap_file_mask	
    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	192M
    apc.slam_defense	1
    apc.stat	1
    apc.stat_ctime	0
    apc.ttl	3600
    apc.use_request_time	1
    apc.user_entries_hint	4096
    apc.user_ttl	3600
    apc.write_lock	1
    What do i have to do here? I am running Litespeed 4.2 in suexec daemon mode.
  2. eagle eyes

    eagle eyes New Member

    More stats can be seen below.

    Please let me know what to do please.


  3. webizen

    webizen New Member

    High fragmentation usually means memory allocated is not enough. Try increase apc.shm_size 384M or bigger.
  4. eagle eyes

    eagle eyes New Member

    all pages on server turn white when i increase it to 350mb
  5. webizen

    webizen New Member

    increase memory limit in LSPHP5 External App in Admin Console (Configuration => Server => External App). likely it is not enough to hold allocation for APC.
  6. eagle eyes

    eagle eyes New Member

    Which variable exactly can you point out?

    That value has to be the same for apc.shm_size also?

    If you enable PM i can send you the apc stats URL.
  7. eagle eyes

    eagle eyes New Member

    These are the current settings. When i set apc.shm_size to 350M i got blank white pages all over the sites.

  8. eagle eyes

    eagle eyes New Member

    And set apc.shm_size 500M

    After 7 minutes up time it is now using close 499M and fragmentation is back to 100 percent.
  9. eagle eyes

    eagle eyes New Member

    These are the current settings.
  10. webizen

    webizen New Member

    seems you have alot of php files to cache. you may increase apc.shm_size and memory_limit (soft/hard) again.
  11. eagle eyes

    eagle eyes New Member

    Increased apc size to 700M and memory to 2000M. Still getting the same results. :/
  12. eagle eyes

    eagle eyes New Member

    Increase apc size to 1024M and memory to 3000M. But seems like it will be the same results as it is approaching the 1024M soon, is there anything else that i should be looking at?
  13. eagle eyes

    eagle eyes New Member

    Set apc size to 1500M and memory to 3000M. Can't really tell if the issue of fragmentation is fixed or not since either APC or Litespeed just restarts every around ~50 minutes.

    Help please.
  14. NiteWave

    NiteWave Administrator

  15. eagle eyes

    eagle eyes New Member

    apc.filters should be set to what? number of files to cache?

    Any idea why APC (Or is it Litespeed) restarts every 1 hour and some minutes or so? Is that an issue or is it normal?
  16. NiteWave

    NiteWave Administrator

    >apc.filters should be set to what? number of files to cache?
    no, should not. please refer:
    http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters

    >Any idea why APC (Or is it Litespeed) restarts every 1 hour and some minutes or so? Is that an issue or is it normal?
    there are many reasons to cause litespeed restarting. for example, you host thousands of accounts/virtual hosts under litespeed or apache. modifying configuration of a virtual host will cause a litespeed restart. if only host a few virtual hosts, and configuration is fixed, you will see litespeed will run there for weeks/months without restarting.

Share This Page