APC Cache仅使用32M内存

发布于 2024-12-23 01:34:04 字数 786 浏览 1 评论 0原文

这是我的配置

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

裂开嘴轻声笑有多痛 2024-12-30 01:34:05

查看手册: 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.

策马西风 2024-12-30 01:34:05

看来,至少在我的情况下,要使其工作,我必须将其添加到 mods-available php 文件夹中的 apcu.ini 中(取决于所使用的版本)像这样 :

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

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 :

extension=apcu.so
apc.shm_size = "64M"
深白境迁sunset 2024-12-30 01:34:05

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

您可能需要从 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.

香草可樂 2024-12-30 01:34:05

这取决于配置,但我必须在这里修改它才能使其工作 /etc/php/8.3/mods-available/apcu.ini 而不是在 '/etc/php/8.3 中/cli/conf.d/20-apcu.ini

sudo nano  /etc/php/8.3/mods-available/apcu.ini

extension=apcu.so
apc.shm_size = 256M
apc.ttl = 7200
apc.user_ttl = 7200
apc.gc_ttl = 3600
apc.enable_cli = 0

It depends on the configuration but I had to modify it here to make it work /etc/php/8.3/mods-available/apcu.iniand not in '/etc/php/8.3/cli/conf.d/20-apcu.ini

sudo nano  /etc/php/8.3/mods-available/apcu.ini

extension=apcu.so
apc.shm_size = 256M
apc.ttl = 7200
apc.user_ttl = 7200
apc.gc_ttl = 3600
apc.enable_cli = 0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文