
前提
EC2上でDjango+nginx+gunicornの環境を構築してみたのですが、502 Bad Gatewayと出てきます。
$sudo systemctl status gunicorn.service
でgunicorn.serviceの状態を表示するとActive: failed (Result: oom-kill)となっており、gunicornが起動していませんでした。
実現したいこと
Active: failed (Result: oom-kill)を解決し、gunicornを起動したい。
発生している問題・エラーメッセージ
$sudo systemctl status gunicorn.service
gunicorn.service - gunicorn daemon Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) Active: failed (Result: oom-kill) since Wed 2022-11-23 09:13:34 UTC; 1min 10s ago Process: 56834 ExecStart=/home/ubuntu/ll_env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/project/project.sock project.wsgi:applic> Main PID: 56834 (code=exited, status=0/SUCCESS) CPU: 10.299s Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: File "/home/ubuntu/ll_env/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: self.reap_workers() Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: File "/home/ubuntu/ll_env/lib/python3.8/site-packages/gunicorn/arbiter.py", line 530, in reap_workers Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: self.log.warning( Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: File "/home/ubuntu/ll_env/lib/python3.8/site-packages/gunicorn/glogging.py", line 261, in warning Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: self.error_log.warning(msg, *args, **kwargs) Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: Message: 'Worker with pid %s was terminated due to signal %s' Nov 23 09:13:34 ip-172-31-7-214 gunicorn[56834]: Arguments: (57048, 9) Nov 23 09:13:34 ip-172-31-7-214 systemd[1]: gunicorn.service: Failed with result 'oom-kill'. Nov 23 09:13:34 ip-172-31-7-214 systemd[1]: gunicorn.service: Consumed 10.299s CPU time.



回答2件
あなたの回答
tips
プレビュー