Python中文
首页
教程
问答
标签
搜索
登录
注册
如何跟踪Python/Django/uwsgi/nginx timeou
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我有以下设置。。。在</p> <ul> <li>nginx监听公共端口80并将请求代理到<code>localhost:10000</code></li> <li>运行django站点1的uwsgi监听本地主机:10000和生成一些网页。它还对<code>localhost:10001</code>上的web服务进行一些调用</li> <li>运行django site2的uwsgi监听<code>localhost:10001</code>,它对<code>otherhost:1234</code>上的web服务进行一些调用</li> </ul> <p>当<code>otherhost</code>正忙时,某些请求最多需要10分钟才能完成。不幸的是,整整2分钟后,nginx给出了一个<code>502 Bad Gateway</code>。在</p> <p>据我所知,问题是。。。在</p> <h3>nginx超时:</h3> <p>我相信这不太可能,因为那是504,但我用的是:</p> <pre><code>proxy_read_timeout 1800; proxy_connect_timeout 1800; </code></pre> <h3>uwsgi 1超时:</h3> <p>我要像这样启动uwsgi(在两种情况下)</p> ^{pr2}$ <h3>Django站点1呼叫站点2:</h3> <p>电话是这样打的:</p> <pre><code> response = urllib.request.urlopen(Url, urlencode(Data).encode("utf-8"), timeout=1800).read().decode("utf-8") </code></pre> <h3>站点2呼叫其他站点:</h3> <p>{cd7>正在使用的库。我配置了10分钟的超时。我认为这不太可能,因为设置为2s会导致http500超时。。。在</p> <p>我已经扫描了我的代码库<code>timeout</code>(和<code>120</code>,<code>120000</code>,甚至在绝望中<code>2</code>),但我找不到设置超时的任何地方——我假设这是来自<em>的某个</em>的默认值。在</p> <p>如果我跳过nginx而执行以下操作:</p> <pre><code>curl -m1800 -XGET 'http://localhost:10000/UI/Url' </code></pre> <p>我明白了</p> <blockquote> <p>curl: (52) Empty reply from server</p> </blockquote> <p>一分钟后。在</p> <p>有什么明显的东西我遗漏了吗?有什么好方法来追踪这个?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>尝试增加<a href="http://wiki.nginx.org/HttpUwsgiModule" rel="nofollow">uwsgi_read_timeout</a>。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何为此数据帧创建散点图?
1 回答
如何为此编写Django模板
6 回答
如何为此表达式编写正则表达式?
9 回答
如何为步进电机选择合适的值?
8 回答
如何为每15分钟间隔的日期时间行(在新列中)添加标签?
10 回答
如何为每一列创建汇总表?
8 回答
如何为每一组groupbyPandas做滚动“得到假人”
1 回答
如何为每一行分别运行函数(python)?
2 回答
如何为每一行生成一个随机数?
6 回答
如何为每一轮将pytorch模型输出存储到numpy
8 回答
如何为每个.py-fi文件创建单独的zip文件
1 回答
如何为每个<li class=”“><a>找到最近的上述同级<li>?
2 回答
如何为每个CSV列生成特定的文件?
10 回答
如何为每个csv文件使用read_csv,即使它是空的?PythonPandas
8 回答
如何为每个CSV文件创建单独的Pandas数据帧并给它们起有意义的名称?
9 回答
如何为每个datetime和每个id创建一行?
1 回答
如何为每个Django型号选择赋予不同的颜色
2 回答
如何为每个Django模型实例安排一个周期性的芹菜任务?
5 回答
如何为每个Django视图设置一个装饰器?
9 回答
如何为每个for循环迭代分配变量
6 回答