Virtualmin을 실행해도 여전히 약 1GB의 여유 메모리가 있고 Apache 로그가 가득 찼습니다.
[mpm_prefork:error] [pid 119747] (11)Resource temporarily unavailable: AH00159: fork: Unable to fork new process
<IfModule mpm_prefork_module>
StartServers 20
MinSpareServers 50
MaxSpareServers 100
MaxRequestWorkers 1000
Serverlimit 2000
MaxConnectionsPerChild 10000
</IfModule>
이것이 도움이 된다면:
user@vps:~$ ulimit -a
real-time non-blocking time (microseconds, -R) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1541537
max locked memory (kbytes, -l) 524288
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 62987
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
나는 또한 PHP-FPM을 실행하고 있으므로 설정은 다음과 같습니다. 60을 100으로 변경하려고 시도했지만 차이는 없습니다.
[154754643814302]
user = user
group = user
listen.owner = user
listen.group = user
listen.mode = 0660
listen = /var/php-fpm/154754643814302.sock
pm = dynamic
pm.max_children = 100
pm.start_servers = 8
pm.min_spare_servers = 1
pm.max_spare_servers = 30
php_value[upload_tmp_dir] = /home/user/tmp
php_value[session.save_path] = /home/user/tmp
php_value[error_log] = /home/user/logs/php_log
php_value[log_errors] = On
답변1
문제를 발견한 것 같습니다. 예를 들어 Apache 시작 파일의 systemd 서비스 섹션에 TasksMax=2000을 추가하여 작업 제한을 조정합니다.
root@vps:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2023-11-04 12:23:42 AEDT; 51s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 2444581 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 2444589 (apache2)
Tasks: 614 (limit: 614)
Memory: 261.7M
CGroup: /system.slice/apache2.service
├─2444589 /usr/sbin/apache2 -k start
├─2444590 /usr/sbin/apache2 -k start
├─2444591 /usr/sbin/apache2 -k start