[GH-ISSUE #414] 504 Gateway Time-out / nginx/1.0.15 #310

Closed
opened 2026-02-27 16:38:49 +03:00 by kerem · 12 comments
Owner

Originally created by @chamambom on GitHub (Sep 2, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/414

My webvirtmgr setup is working perfectly and i have no issues whatsoever except for the webserver optimisation tricks that are failing.

I am trying to clone an 8gig VM from the webinterface (i want to manage all my migrations snapshots from webvirtmgr not virt-manager) and im getting the following error 504 Gateway Time-out on nginx/1.0.15

points to NOTE: 1) My nginx webserver is not using any php fork or proxying apache ,its just nginx
i have tried all the tricks as below

fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;

playing around with the figures and all but alas i am still getting 504 Gateway Time-out / nginx/1.0.15

Originally created by @chamambom on GitHub (Sep 2, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/414 My webvirtmgr setup is working perfectly and i have no issues whatsoever except for the webserver optimisation tricks that are failing. I am trying to clone an 8gig VM from the webinterface (i want to manage all my migrations snapshots from webvirtmgr not virt-manager) and im getting the following error 504 Gateway Time-out on nginx/1.0.15 points to NOTE: 1) My nginx webserver is not using any php fork or proxying apache ,its just nginx i have tried all the tricks as below fastcgi_connect_timeout 300s; fastcgi_send_timeout 300s; fastcgi_read_timeout 300s; fastcgi_buffer_size 128k; fastcgi_buffers 8 128k; playing around with the figures and all but alas i am still getting 504 Gateway Time-out / nginx/1.0.15
kerem closed this issue 2026-02-27 16:38:49 +03:00
Author
Owner

@chamambom commented on GitHub (Sep 2, 2014):

and the irony of it is that the clone gets created..... but i am not so sure if say the vm i am trying to clone is 60g or more ,will it get created

<!-- gh-comment-id:54112944 --> @chamambom commented on GitHub (Sep 2, 2014): and the irony of it is that the clone gets created..... but i am not so sure if say the vm i am trying to clone is 60g or more ,will it get created
Author
Owner

@retspen commented on GitHub (Sep 2, 2014):

You can check the same in console with qemu-img utility.

$ time qemu-img convert -f qcow2 -O qcow2 source_image.img targer_image.img

<!-- gh-comment-id:54186151 --> @retspen commented on GitHub (Sep 2, 2014): You can check the same in console with qemu-img utility. $ time qemu-img convert -f qcow2 -O qcow2 source_image.img targer_image.img
Author
Owner

@chamambom commented on GitHub (Sep 2, 2014):

Hie retspen , before i try the command you gave me , i want to understand you first.Are you saying even if i run the clone command using the terminal , there will be a timeout ?

<!-- gh-comment-id:54193474 --> @chamambom commented on GitHub (Sep 2, 2014): Hie retspen , before i try the command you gave me , i want to understand you first.Are you saying even if i run the clone command using the terminal , there will be a timeout ?
Author
Owner

@AlexH-HankIT commented on GitHub (Sep 2, 2014):

Yes, there is always a timeout. It's normal for webservers. I think the proxy timeout is causing your problems. I saw it once or twice in my own webvirtmgr. You can use these parameters in your 'location /' blog in /etc/nginx/conf.d/webvirtmgr.conf:

    proxy_read_timeout 120;
    proxy_connect_timeout 120;

Adjust the values to something suitable for your environment.

I don't know for sure if this correct, but just test it ;)

<!-- gh-comment-id:54195778 --> @AlexH-HankIT commented on GitHub (Sep 2, 2014): Yes, there is always a timeout. It's normal for webservers. I think the proxy timeout is causing your problems. I saw it once or twice in my own webvirtmgr. You can use these parameters in your 'location /' blog in /etc/nginx/conf.d/webvirtmgr.conf: ``` proxy_read_timeout 120; proxy_connect_timeout 120; ``` Adjust the values to something suitable for your environment. I don't know for sure if this correct, but just test it ;)
Author
Owner

@retspen commented on GitHub (Sep 2, 2014):

Command will show how long an image is cloning. You can change timeout in /var/www/webvirtmgr/conf/gunicorn.conf.py

<!-- gh-comment-id:54196626 --> @retspen commented on GitHub (Sep 2, 2014): Command will show how long an image is cloning. You can change timeout in /var/www/webvirtmgr/conf/gunicorn.conf.py
Author
Owner

@AlexH-HankIT commented on GitHub (Sep 2, 2014):

I wonder if it's possible to create a progress bar?

<!-- gh-comment-id:54208834 --> @AlexH-HankIT commented on GitHub (Sep 2, 2014): I wonder if it's possible to create a progress bar?
Author
Owner

@retspen commented on GitHub (Sep 4, 2014):

It is very hard and this only as effect

<!-- gh-comment-id:54502785 --> @retspen commented on GitHub (Sep 4, 2014): It is very hard and this only as effect
Author
Owner

@retspen commented on GitHub (Sep 5, 2014):

Update nginx config for changing timeout. https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr

<!-- gh-comment-id:54607465 --> @retspen commented on GitHub (Sep 5, 2014): Update nginx config for changing timeout. https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr
Author
Owner

@chamambom commented on GitHub (Sep 5, 2014):

Hie Anatoliy

I had already changed timeout in /var/www/webvirtmgr/conf/gunicorn.conf.py
and i seem to have noticed a change after i increased the timeout.....
does it mean i have to remove it and use this instead
http://gunicorn.conf.py

server {
listen 80 default_server;

server_name $hostname;
#access_log /var/log/nginx/webvirtmgr_access_log;

location /static/ {
    root /var/www/webvirtmgr/webvirtmgr; # or /srv instead of /var
    expires max;
}

location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Forwarded-Proto $remote_addr;
    proxy_connect_timeout 600;
    proxy_read_timeout 600;
    proxy_send_timeout 600;
}

}

On Fri, Sep 5, 2014 at 12:13 PM, Anatoliy Guskov notifications@github.com
wrote:

Update nginx config for changing timeout.
https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr


Reply to this email directly or view it on GitHub
https://github.com/retspen/webvirtmgr/issues/414#issuecomment-54607465.

<!-- gh-comment-id:54620359 --> @chamambom commented on GitHub (Sep 5, 2014): Hie Anatoliy I had already changed timeout in /var/www/webvirtmgr/conf/gunicorn.conf.py and i seem to have noticed a change after i increased the timeout..... does it mean i have to remove it and use this instead http://gunicorn.conf.py server { listen 80 default_server; ``` server_name $hostname; #access_log /var/log/nginx/webvirtmgr_access_log; location /static/ { root /var/www/webvirtmgr/webvirtmgr; # or /srv instead of /var expires max; } location / { proxy_pass http://127.0.0.1:8000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Proto $remote_addr; proxy_connect_timeout 600; proxy_read_timeout 600; proxy_send_timeout 600; } ``` } On Fri, Sep 5, 2014 at 12:13 PM, Anatoliy Guskov notifications@github.com wrote: > Update nginx config for changing timeout. > https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr > > — > Reply to this email directly or view it on GitHub > https://github.com/retspen/webvirtmgr/issues/414#issuecomment-54607465.
Author
Owner

@retspen commented on GitHub (Sep 5, 2014):

After added parallel connections in gunicorn.conf.py timeout paramert doesn't work normally. Only nginx timeout works normally.

<!-- gh-comment-id:54621568 --> @retspen commented on GitHub (Sep 5, 2014): After added parallel connections in gunicorn.conf.py timeout paramert doesn't work normally. Only nginx timeout works normally.
Author
Owner

@chamambom commented on GitHub (Sep 5, 2014):

I see , let me clone 20G,40G and 60G vms and see if the timeout is fixed
http://gunicorn.conf.py

On Fri, Sep 5, 2014 at 3:01 PM, Anatoliy Guskov notifications@github.com
wrote:

After added parallel connections in gunicorn.conf.py timeout paramert
doesn't work normally. Only nginx timeout works normally.


Reply to this email directly or view it on GitHub
https://github.com/retspen/webvirtmgr/issues/414#issuecomment-54621568.

<!-- gh-comment-id:54625301 --> @chamambom commented on GitHub (Sep 5, 2014): I see , let me clone 20G,40G and 60G vms and see if the timeout is fixed http://gunicorn.conf.py On Fri, Sep 5, 2014 at 3:01 PM, Anatoliy Guskov notifications@github.com wrote: > After added parallel connections in gunicorn.conf.py timeout paramert > doesn't work normally. Only nginx timeout works normally. > > — > Reply to this email directly or view it on GitHub > https://github.com/retspen/webvirtmgr/issues/414#issuecomment-54621568.
Author
Owner

@chamambom commented on GitHub (Sep 6, 2014):

i think its working now , if the vm size is a bit larger ,i guess i will have to play around with the timeout settings

<!-- gh-comment-id:54703844 --> @chamambom commented on GitHub (Sep 6, 2014): i think its working now , if the vm size is a bit larger ,i guess i will have to play around with the timeout settings
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#310
No description provided.