开发者

Broken Pipe in Django dev server - What does this actually mean?

I can't quite figure out a pattern to why/when I开发者_如何学C see it. Cheers.


By "pipe" it means the TCP connection between the server and the browser. By "broken" it means closed.

You'll see broken pipes when somebody closes their browser window, hits stop, or sometimes just from timing out because something else breaks the connection.

The confusing thing is that the python process likely won't notice that the connection is closed until it tries to write to it, which could be well after the connection closes.


I get this error when a browser closes a connection (it can time out, or can be manually closed). Normally it happens when I send too many connections to runserver at once (i.e. I'm serving static media, and loading a heavy page for the first time).

Django's runserver should not be used in production, and it doesn't handle concurrent connections with any grace. If this happens a lot, you can consider using something like django_cpserver or gunicorn in development, but you don't get as much debug information out of them in the console.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜