php APC Cache 仅使用 32M 内存

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8653402/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 05:11:04  来源:igfitidea点击:

APC Cache use only 32M memory

phpshared-memoryapc

提问by tarlyun

Here my config

这是我的配置

extension = apc.so

apc.enabled = 1
apc.shm_size = 128M
apc.shm_segments = 1
apc.gc_ttl = 7200
apc.ttl = 0
apc.num_files_hint = 1024
apc.file_update_protection = 2
apc.max_file_size = 5M
apc.stat_ctime = 1
apc.mmap_file_mask=/tmp/apc.XXXXXX

apc.filter="-/usr/share/phpMyAdmin/.*"

APC INFO: APC Version 3.1.3p1 PHP Version 5.3.3 APC Host .._._ (mysite.com) (127.0.0.1) Server Software Apache/2.2.15 (CentOS) Shared Memory 1 Segment(s) with 30.0 MBytes (mmap memory, pthread mutex locking)

APC 信息:APC 版本 3.1.3p1 PHP 版本 5.3.3 APC 主机 ._._ (mysite.com) (127.0.0.1) 服务器软件 Apache/2.2.15 (CentOS) 共享内存 1 段,30.0 MB(mmap 内存,pthread 互斥锁)

Runtime Settings apc.shm_size 128M

运行时设置 apc.shm_size 128M

[[email protected] ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
kernel.shmmax = 134217728

What i must do to increase APC memory?

我必须怎么做才能增加 APC 内存?

回答by The Nail

Have a look at the manual: http://php.net/manual/en/apc.configuration.php, furthermore, note the difference between size and maximum size.

看看手册:http://php.net/manual/en/apc.configuration.php此外,注意大小和最大大小之间的区别。

回答by T0xicCode

I'll repeat the solution here (because it was listed as a comment of the accepted solution):

我将在这里重复该解决方案(因为它被列为已接受解决方案的评论):

You might need to remove the "M" from the apc.shm_sizeconfiguration value. The number is expected to be in megabytes, and some php versions will fail to parse the value and revert to the default (30 or 32 MB) if the given value is not a number.

您可能需要从apc.shm_size配置值中删除“M” 。该数字预计以兆字节为单位,如果给定的值不是数字,某些 php 版本将无法解析该值并恢复为默认值(30 或 32 MB)。

回答by jirarium

It seems , at least in my case , that for this to work I have to add it to apcu.inifound in mods-availablephp folder(depending on version used) like this :

似乎,至少在我的情况下,要使其正常工作,我必须将其添加到mods-availablephp 文件夹(取决于使用的版本)中的apcu.ini中,如下所示:

extension=apcu.so
apc.shm_size = "64M"