0

I am running 10 shops on my server, and have setup APC with the recommended settings in apc.ini.

    extension = apc.so    #name dependent on your APC cache install
 

    [APC]
    apc.enabled = 1    # Turn APC cache on
    apc.optimization  = 0    # Experimental keep off
    apc.shm_segments = 1    # Shared memory segments
    apc.shm_size = 128  # Max shared memory dependent on OS
    apc.ttl = 7200
    apc.user_ttl  = 7200
    apc.num_files_hint = 1024
    apc.mmap_file_mask = /tmp/apc.XXXXXX
    apc.enable_cli = 1 # Allow command line php to function
    apc.cache_by_default  = 1 # Enabled, 0 for filters
    apc.max_file_size = 10M # Maximum cached file size
    apc.stat = 1 # 1 for dev, 0 for production, whether the source file is checked for mod date
    #apc.include_once_override = 1 # Use PHP5.3+ for include_once optimization

And it was working well with about 99% hits, and the sites seem to be working well. But at some point of time my

shm.size
became exhaust and all 100% of the memory was used. Which resulted in all the shops stop working showing error of memory pool on line 0. Then I increased the size of that particular variable to 1GB which resulted in fully functioning all the webshops.

So my question is what is the optimized value of the shm.size to be set per webshop and if if I have 20 shops then SHOULD be value be increased by the multiple of 20.

  • you have to measure it cause we don't really know what you are caching and can't estimate – Anton S Jul 02 '12 at 10:39
  • Okai fair enough, but how do I measure it. I have got the apc.php running and working I can see the data, but per website how would i view those data to give me a "rough" figure. – Subesh Pokhrel Jul 02 '12 at 16:55
  • First see magento sys requirements fair guess it tries to cache whats in memory so try with recommended memory limit first and then dig in and see what is cached and how big this is. – Anton S Jul 02 '12 at 21:22

1 Answers1

0

Install apache on your computer, install APC, give it lot of memory, install one shop, browse all the feature of the shop. Use the apc.php file to check the memory used. You get your answer.

If your server have enough memory give APC lot of ram 20Mb for a wordpress 128 for Magento won't be to much.

Check my answer there to know how to configure APC What is causing "Unable to allocate memory for pool" in PHP?

Community
  • 1
  • 1
bokan
  • 3,601
  • 2
  • 23
  • 38