irm https://get.activated.win | iex
管理员启动 选 3 1
irm https://get.activated.win | iex
管理员启动 选 3 1
[opcache]
zend_extension=opcache.so
opcache.enable=1 # 必开启
opcache.memory_consumption=256 # 共享内存大小,框架项目建议256M+
opcache.interned_strings_buffer=16 # 字符串缓存,8-16M
opcache.max_accelerated_files=32531 # 缓存文件数,需大于项目文件总数(建议用小质数集如16229/32531)
opcache.revalidate_freq=60 # 60秒检查文件更新
opcache.fast_shutdown=1 # 加速请求关闭时的内存回收
opcache.validate_timestamps=1 # 生产环境保持=1以热更新,=0需手动重置
opcache.save_comments=0 # 若不依赖注解,设为0以节省内存
realpath_cache_size = 4096k # 默认未开启,建议设为4M
realpath_cache_ttl = 120 # 缓存有效期,适合文件结构稳定的生产环境
更新代码后通过opcache_reset()或重启PHP-FPM刷新缓存
$key = QiyuKey::APPKEY;
$now = time();
$post = [
'appKey' => $key,
'time' => $now,
];
$checksum = sha1(QiyuKey::APPSECRET . md5(json_encode($post)) . $now);
$url = "https://xxx.com/v2/staff/list/new?appKey={$key}&time={$now}&checksum={$checksum}";
$ret = self::httpPost($url, $post);ps -aux --sort=-%cpu|head -10|grep php
ps -aux --sort=-%mem|head -10|grep php
ps -aux|grep php|awk '{cpu+=$3;count++} END {print "PHP进程数:",count,"平均CPU使用率:",cpu/count"%"}'
pkill -f "addUserBadge clc"