-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server closes connection before sending data #370
Comments
I've made my own investigation. Appeared that siege sends a get request with "Connection: close" header. This works fine for the same functionality, written on Tornado framework. |
@oicnysa thanks for investigation. I filed an issue in asyncio: python/asyncio#248 |
Thanks. I've read your post in asyncio. Will try to patch by myself, but I'm not so familiar with aiohttp code. So maybe if you will have some time, you could describe more detailed, where "code to patch" situated. I mean, of course, not "/usr/lib/pithon/site-packages/aiohttp", but classes and methods. :) |
@oicnysa good fix requires changes in asyncio: we need for new API. To get rid of annoying prints (
It will disable logging. I still did not investigated why |
I think it is because I've tried it on virtualbox(maybe it couldn't handle so many sockets). Now I've managed to test aiohttp with siege and Connection: Keep-Alive on more powerful machine(Dell PowerEdge R200). But the results were bad comparing to Tornado and siege with "Connection: Close". |
Tornado has more complex static files handling: it supports RANGE and content caching like LAST-MODIFIED and so on. Anyway, for static files the best way is to use proxy server like nginx. |
Thanks for information Andrew! |
I've tried master version and it is performing very well. |
I have a very simple file server using Aiohttp:
When I test it using siege tool with, for example, such command:
It raises a lot of exceptions like this:
And the amount of data transferred is very small. I assume that the socket closes before the file is fully sent to the user. I would be very appreciated for some suggestion. Thank you in advance! UPD:
template2.html
/root/async directory contains template2.html and server script file(code mentioned at the start). /root/async/files directory contains some dummy files of 15b, 15kb and 15mb sizes.
UPD: the exception is not risen for small files.
UPD: This exception is raised from connetion_lost function of web.py:
The text was updated successfully, but these errors were encountered: