来自uWsgi的回复丢失了

时间:2014-10-15 13:31:37

标签: mysql django nginx uwsgi

我有一个通过Nginx和uWsgi以及远程Mysql DB托管的django应用程序。在一个非常简单的请求中: 我在uwsgi.log中随机获得502以下错误有时候它有效,有时候不行......我找不到任何理由来证明什么时候没有用......有人能帮助我理解最新情况以及如何解决它?

*** HARAKIRI ON WORKER 1 (pid: 26789, try: 1) ***
HARAKIRI: -- wchan> 0
*** backtrace of 26789 ***
uwsgi(uwsgi_backtrace+0x29) [0x451c09]
uwsgi(what_i_am_doing+0x19) [0x452069]
/lib64/libc.so.6 [0x399da302d0]
/lib64/libpthread.so.0(read+0x4b) [0x399e20daab]
/usr/lib64/mysql/libmysqlclient_r.so.15(vio_read+0x38) [0x2b03e853ab98]
/usr/lib64/mysql/libmysqlclient_r.so.15(vio_read_buff+0x43) [0x2b03e853abf3]
/usr/lib64/mysql/libmysqlclient_r.so.15 [0x2b03e853bdf8]
/usr/lib64/mysql/libmysqlclient_r.so.15(my_net_read+0x199) [0x2b03e853c1f9]
/usr/lib64/mysql/libmysqlclient_r.so.15(cli_safe_read+0x6f) [0x2b03e8535d5f]
/usr/lib64/mysql/libmysqlclient_r.so.15 [0x2b03e8536bc9]
/usr/lib64/mysql/libmysqlclient_r.so.15(mysql_real_query+0x1e) [0x2b03e853553e]
/array/purato/python/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.so [0x2b03e82d27e9]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x6185) [0x2b03e18e36b5]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187359c]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0xddd) [0x2b03e18de30d]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187359c]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0xddd) [0x2b03e18de30d]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187349d]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e1857f9f]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e18a2f4a]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x1127) [0x2b03e18de657]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f]
/array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187349d]
/array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548]
/array/purato/python/lib/libpython2.6.so.1.0(PyEval_CallObjectWithKeywords+0x56) [0x2b03e18dc906]
uwsgi(python_call+0x20) [0x45f240]
uwsgi(uwsgi_request_wsgi+0x11c) [0x4619ec]
uwsgi(wsgi_req_recv+0x8f) [0x41ef7f]
uwsgi(simple_loop_run+0xc5) [0x44d3c5]
uwsgi(uwsgi_ignition+0x132) [0x44ffc2]
uwsgi(uwsgi_worker_run+0x252) [0x450262]
uwsgi(uwsgi_start+0x13ad) [0x45169d]
uwsgi(main+0x1be6) [0x454f36]
/lib64/libc.so.6(__libc_start_main+0xf4) [0x399da1d9c4]
uwsgi [0x419fe9]
*** end of backtrace ***
HARAKIRI: --- uWSGI worker 1 (pid: 26789) WAS managing request /brizer/ since Tue Oct 13 12:01:51 2014 ---
*** HARAKIRI ON WORKER 1 (pid: 26789, try: 2) ***
DAMN ! worker 1 (pid: 26789) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 27845)

有人知道这件事吗?

2 个答案:

答案 0 :(得分:0)

你是uwsgi的Harakiri启用。尝试没有Harakiri。

答案 1 :(得分:0)

您有一个mysql查询需要超过10秒才能生成响应。 10秒后,harakiri被触发摧毁你的过程。您显然可以增加或删除harakiri,但它只会缓解严重的性能问题。您应该修复/ v2 / cost /生成的查询。如果您难以识别它,请启用mysql slow_query log