chore:API Docker 환경 설정 (Queue Worker, Scheduler, OPcache 추가)
- supervisord.conf에 queue-worker 1개 + scheduler 추가 - opcache.ini 생성 (MNG 설정과 동일, 256MB) - docker-compose.yml에 opcache.ini 볼륨 마운트 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
33
sam/docker/api/opcache.ini
Normal file
33
sam/docker/api/opcache.ini
Normal file
@@ -0,0 +1,33 @@
|
||||
; OPcache 설정 (성능 향상)
|
||||
; PHP OPcode 캐시를 활성화하여 애플리케이션 성능을 크게 향상시킵니다
|
||||
|
||||
[opcache]
|
||||
; OPcache 활성화
|
||||
opcache.enable=1
|
||||
|
||||
; CLI 환경에서도 OPcache 활성화 (개발 환경)
|
||||
opcache.enable_cli=1
|
||||
|
||||
; OPcache 메모리 사용량 (MB)
|
||||
; 256MB 권장 (프로젝트 크기에 따라 조정) - 개발 환경 성능 향상
|
||||
opcache.memory_consumption=256
|
||||
|
||||
; 내부 문자열 버퍼 크기 (MB)
|
||||
opcache.interned_strings_buffer=16
|
||||
|
||||
; 최대 가속화 파일 수
|
||||
opcache.max_accelerated_files=20000
|
||||
|
||||
; 타임스탬프 검증 활성화 (개발 환경)
|
||||
; 프로덕션에서는 0으로 설정하여 성능 최적화
|
||||
opcache.validate_timestamps=1
|
||||
|
||||
; 재검증 주기 (초) - 개발 환경 성능 향상을 위해 단축
|
||||
; validate_timestamps가 1일 때만 사용됨
|
||||
opcache.revalidate_freq=1
|
||||
|
||||
; 빠른 종료 활성화
|
||||
opcache.fast_shutdown=1
|
||||
|
||||
; 최적화 레벨 (0-7, 높을수록 느리지만 더 최적화됨)
|
||||
opcache.optimization_level=0x7FFFBFFF
|
||||
36
sam/docker/api/supervisord.conf
Executable file
36
sam/docker/api/supervisord.conf
Executable file
@@ -0,0 +1,36 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:php-fpm]
|
||||
command=/usr/local/sbin/php-fpm
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g "daemon off;"
|
||||
|
||||
[program:queue-worker]
|
||||
command=php /var/www/api/artisan queue:work database --sleep=3 --tries=3 --timeout=1800 --max-jobs=100 --max-time=3600
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
numprocs=1
|
||||
directory=/var/www/api
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=5
|
||||
startretries=3
|
||||
stopwaitsecs=1830
|
||||
stdout_logfile=/var/www/api/storage/logs/queue-worker.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stderr_logfile=/var/www/api/storage/logs/queue-worker-error.log
|
||||
stderr_logfile_maxbytes=5MB
|
||||
|
||||
[program:scheduler]
|
||||
command=bash -c "while true; do php /var/www/api/artisan schedule:run --no-interaction; sleep 60; done"
|
||||
process_name=%(program_name)s
|
||||
numprocs=1
|
||||
directory=/var/www/api
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=0
|
||||
stdout_logfile=/var/www/api/storage/logs/scheduler.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stderr_logfile=/var/www/api/storage/logs/scheduler-error.log
|
||||
stderr_logfile_maxbytes=5MB
|
||||
Reference in New Issue
Block a user