APC Cache仅使用32M内存
这是我的配置
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 信息: 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 互斥锁)
运行时设置 apc.shm_size 128M
[[email protected] ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
kernel.shmmax = 134217728
我必须做什么来增加APC内存?
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)
Runtime Settings
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看手册: https://www.php.net/manual /en/apcu.configuration.php,
此外,请注意大小和最大大小之间的区别。Have a look at the manual: https://www.php.net/manual/en/apcu.configuration.php,
furthermore, note the difference between size and maximum size.看来,至少在我的情况下,要使其工作,我必须将其添加到 mods-available php 文件夹中的 apcu.ini 中(取决于所使用的版本)像这样 :
It seems , at least in my case , that for this to work I have to add it to apcu.ini found in mods-available php folder(depending on version used) like this :
我将在这里重复该解决方案(因为它被列为已接受解决方案的注释):
您可能需要从
apc.shm_size
配置值中删除“M”。该数字预计以兆字节为单位,如果给定值不是数字,某些 php 版本将无法解析该值并恢复为默认值(30 或 32 MB)。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_size
configuration 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.这取决于配置,但我必须在这里修改它才能使其工作
/etc/php/8.3/mods-available/apcu.ini
而不是在'/etc/php/8.3 中/cli/conf.d/20-apcu.ini
It depends on the configuration but I had to modify it here to make it work
/etc/php/8.3/mods-available/apcu.ini
and not in'/etc/php/8.3/cli/conf.d/20-apcu.ini