uwsgi: OSError: write error during GET request

对着背影说爱祢 提交于 2020-05-29 10:23:18

问题


Here is the error log that I received when I put my application in the long run.

Oct 22 11:41:18 uwsgi[4613]: OSError: write error
Oct 22 11:41:48 uwsgi[4613]: Tue Oct 22 11:41:48 2019 - uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 341] during GET /api/events/system-alarms/ 
Nov 19 19:11:01 uwsgi[30627]: OSError: write error
Nov 19 19:11:02 uwsgi[30627]: Tue Nov 19 19:11:02 2019 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /api/statistics/connected-clients/?type=auto&required_fields=0,11 

Also, I need to know the reason for the os write error and a broken pipe in detail.


回答1:


Faced a similar issue before, it happens when the client makes a request and then closes it (either because server took too long to respond or client has been disrupted) but uwsgi is still processing that request.

From the Tags I notice that you are using nginx+uwsgi configuration, there are multiple ways to solve this :

  • Find your most time consuming request and match it between nginx and uwsgi(harakiri). Note that this doesn't work when client itself disrupts.
  • On your nginx config set uwsgi_ignore_client_abort on for uwsgi routes.
  • Or you can just disable logging of write errors ignore-write-errors = true.


来源:https://stackoverflow.com/questions/59026602/uwsgi-oserror-write-error-during-get-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!