<div dir="ltr"><span style="font-size:12.8px">> generated 0 bytes in 640738 msecs</span><br><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I would look into what is causing your backend to take over 10 minutes to respond to that request.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 11:09 PM, Larry Martell <span dir="ltr"><<a href="mailto:larry.martell@gmail.com" target="_blank">larry.martell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I just set up a django site with nginx and uWSGI. Some pages I go to<br>
work fine, but other fail with a  504 Gateway Time-out. I used to<br>
serve this site with apache and wsgi and these same pages worked fine.<br>
<br>
This is what I see in the nginx error log:<br>
<br>
2016/08/09 16:40:19 [error] 17345#0: *1 upstream timed out (110:<br>
Connection timed out) while reading response header from upstream,<br>
client: 10.250.147.59, server: localhost, request: "GET<br>
/report/CDSEM/MeasurementData/<wbr>?group=&target_name=&recipe=&<wbr>ep=&ppl=&roi_name=&lot=&date_<wbr>time=8%2F1&tool_ids=23&field_<wbr>1=Tool&field_2=Target&field_3=<wbr>Recipe&field_4=Ep&field_5=Lot&<wbr>field_6=Date+Time&field_7=<wbr>Bottom&submit_preview=<wbr>Generate+Report<br>
HTTP/1.1", upstream: "uwsgi://unix:///usr/local/<wbr>motor/motor.sock",<br>
host: "xx.xx.xx.xx", referrer:<br>
"<a href="http://xx.xx.xx.xx/report/CDSEM/MeasurementData/" rel="noreferrer" target="_blank">http://xx.xx.xx.xx/report/<wbr>CDSEM/MeasurementData/</a>"<br>
<br>
When this  happens I see this in the uwsgi error log:<br>
<br>
Tue Aug  9 16:42:57 2016 -<br>
uwsgi_response_writev_headers_<wbr>and_body_do(): Broken pipe<br>
[core/writer.c line 296] during GET<br>
/report/CDSEM/MeasurementData/<wbr>?group=&target_name=&recipe=&<wbr>ep=&ppl=&roi_name=&lot=&date_<wbr>time=8%2F1&tool_ids=23&field_<wbr>1=Tool&field_2=Target&field_3=<wbr>Recipe&field_4=Ep&field_5=Lot&<wbr>field_6=Date+Time&field_7=<wbr>Bottom&submit_preview=<wbr>Generate+Report<br>
(10.250.147.59)<br>
IOError: write error<br>
[pid: 9230|app: 0|req: 36/155] 10.250.147.59 () {46 vars in 1333<br>
bytes} [Tue Aug  9 16:32:16 2016] GET<br>
/report/CDSEM/MeasurementData/<wbr>?group=&target_name=&recipe=&<wbr>ep=&ppl=&roi_name=&lot=&date_<wbr>time=8%2F1&tool_ids=23&field_<wbr>1=Tool&field_2=Target&field_3=<wbr>Recipe&field_4=Ep&field_5=Lot&<wbr>field_6=Date+Time&field_7=<wbr>Bottom&submit_preview=<wbr>Generate+Report<br>
=> generated 0 bytes in 640738 msecs (HTTP/1.1 200) 4 headers in 0<br>
bytes (1 switches on core 0)<br>
<br>
Note the weird timestamps. The first uwsgi message is more then 2<br>
minutes after the nginx message. And the second uwsgi message has a<br>
timestamp before the previous uwsgi message. What's up with that??<br>
<br>
Here is my nginx config:<br>
<br>
worker_processes  1;<br>
<br>
events {<br>
    worker_connections  1024;<br>
}<br>
<br>
http {<br>
    include            mime.types;<br>
    default_type       application/octet-stream;<br>
    keepalive_timeout  65;<br>
    sendfile           on;<br>
<br>
    # set client body size to 20M<br>
    client_max_body_size 20M;<br>
<br>
    include /etc/nginx/sites-enabled/*;<br>
}<br>
<br>
<br>
and here is my local site file:<br>
<br>
# motor_nginx.conf<br>
<br>
# the upstream component nginx needs to connect to<br>
upstream django {<br>
    server unix:///usr/local/motor/motor.<wbr>sock; # for a file socket<br>
}<br>
<br>
# configuration of the server<br>
server {<br>
    # the port your site will be served on<br>
    listen      80;<br>
    # the domain name it will serve for<br>
    server_name localhost;<br>
    charset     utf-8;<br>
<br>
    # max upload size<br>
    client_max_body_size 75M;   # adjust to taste<br>
<br>
    proxy_read_timeout 600;<br>
    proxy_connect_timeout 600;<br>
    proxy_send_timeout 600;<br>
    send_timeout 600;<br>
<br>
    # Django media<br>
    location /media  {<br>
        alias /usr/local/motor/motor/media;<br>
    }<br>
<br>
    location /static {<br>
        alias /usr/local/motor/motor/static;<br>
    }<br>
<br>
    # Finally, send all non-media requests to the Django server.<br>
    location / {<br>
        uwsgi_pass  django;<br>
        include     /usr/local/motor/motor/uwsgi_<wbr>params;<br>
    }<br>
}<br>
<br>
How can I debug or fix this?<br>
<br>
Thanks!<br>
<br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>