在运行10个商店的服务器上设置APC
问题描述:
我在我的服务器上运行了10个商店,并使用apc.ini中的建议设置安装了APC。在运行10个商店的服务器上设置APC
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
,它是用约99%的命中率,以及网站运行良好似乎运作良好。但是在某个时间点,我的
shm.size
变得耗尽,所有的内存都被使用了。导致所有商店停止工作,显示第0行的内存池错误。 然后,我将该特定变量的大小增加到1GB,导致所有网上商店完全正常运行。
所以我的问题是什么是shm.size的最佳值每网店进行设置,如果,如果我有20家商店则应值被增加20
答
多上安装Apache你电脑,安装APC,给它大量的内存,安装一个商店,浏览商店的所有功能。使用apc.php文件检查使用的内存。你得到你的答案。
如果你的服务器有足够的内存给APC很多内存20Mb的wordpress 128的Magento不会太多。
检查我的回答那里知道如何配置APC What is causing "Unable to allocate memory for pool" in PHP?
你必须衡量它,因为我们真的不知道你是什么样的缓存和无法估计 –
冈井不够公平,但我怎么衡量它。我得到了apc.php正在运行并正在工作,我可以看到数据,但是每个网站如何查看这些数据以给我一个“粗略”的数字。 –
首先看到magento sys的要求公平猜测它试图缓存内存中的内容,所以先尝试建议的内存限制,然后深入研究,看看缓存的内容以及它有多大。 –