3
votes

I am trying to change the timeout for Gunicorn on a Python 3.7 Amazon Linux 2 (Version 3.1) Elastic Beanstalk deploy. My Procfile looks like:

web: gunicorn --bind :8000 --workers 3 --threads 2 --timeout 300 application.application:application

But I still seem to be getting the default 30 second timeout.

My nginx config in .ebextensions looks like:

files:
  "/etc/nginx/conf.d/timeout.conf" :
    mode: "000644"
    owner: root
    group: root
    content: |
      keepalive_timeout 600;
      proxy_connect_timeout 600;
      proxy_send_timeout 600;
      proxy_read_timeout 600;
      send_timeout 600; 
      fastcgi_send_timeout 600; 
      fastcgi_read_timeout 600;

Any help would be appreciated.

1
Hello, I'm facing the same issue. I would like to ask a question about that. How can I configure procfile? Where did you added it in your source folder?Aslı Kök
Create a file called Procfile in the root of your deployed application folderBennett Tomlin

1 Answers

3
votes

Since you are using Amazon Linux 2 (AL2), setting nginx options through /etc/nginx/conf.d/timeout.conf is not supported. This would explain why they don't have any effect.

For AL2, nginx settings should be set using .platform/nginx/conf.d/ folder as show here.

Thus, you could try the following. Have a file .platform/nginx/conf.d/myconfig.conf with the content of:

keepalive_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600; 
fastcgi_send_timeout 600; 
fastcgi_read_timeout 600;