Skip to content

Commit d91e1e6

Browse files
Refactor worker-laravel command and reduce numprocs for better resource management
1 parent b5535ba commit d91e1e6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

InstaRepas/nixpacks.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ mkdir -p /app/storage/framework/{cache,sessions,views}
2626
chown -R www-data:www-data /app/storage
2727
chmod -R 775 /app/storage
2828
29-
3029
# Start supervisor
3130
supervisord -c /etc/supervisord.conf -n
3231
'''
@@ -79,12 +78,12 @@ stderr_logfile=/var/log/worker-phpfpm.log
7978
"worker-laravel.conf" = '''
8079
[program:worker-laravel]
8180
process_name=%(program_name)s_%(process_num)02d
82-
command=bash -c 'exec php /app/artisan queue:work --sleep=3 --tries=3 --max-time=3600'
81+
command=bash -c 'cd /app && php artisan queue:work --sleep=3 --tries=3 --max-time=3600'
8382
autostart=true
8483
autorestart=true
8584
stopasgroup=true
8685
killasgroup=true
87-
numprocs=12
86+
numprocs=2
8887
startsecs=0
8988
stopwaitsecs=3600
9089
stdout_logfile=/var/log/worker-laravel.log

nixpacks.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ mkdir -p /app/storage/framework/{cache,sessions,views}
2626
chown -R www-data:www-data /app/storage
2727
chmod -R 775 /app/storage
2828
29-
3029
# Start supervisor
3130
supervisord -c /etc/supervisord.conf -n
3231
'''
@@ -79,12 +78,12 @@ stderr_logfile=/var/log/worker-phpfpm.log
7978
"worker-laravel.conf" = '''
8079
[program:worker-laravel]
8180
process_name=%(program_name)s_%(process_num)02d
82-
command=bash -c 'exec php /app/artisan queue:work --sleep=3 --tries=3 --max-time=3600'
81+
command=bash -c 'cd /app && php artisan queue:work --sleep=3 --tries=3 --max-time=3600'
8382
autostart=true
8483
autorestart=true
8584
stopasgroup=true
8685
killasgroup=true
87-
numprocs=12
86+
numprocs=2
8887
startsecs=0
8988
stopwaitsecs=3600
9089
stdout_logfile=/var/log/worker-laravel.log

0 commit comments

Comments
 (0)