-
-
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
400 milliseconds delay using aiohttp #2729
Comments
You see DNS resolving and TCP connection establishment timeout, aiohttp has no special sleeps for it. The time can be huge, it depends on client node, server and network between. P.S. |
My network speed is over 100MBs which I assume is fast enough. |
@karamjaber you could deploy a caching DNS in your network or locally next to the app. Have you tried analysing your network traffic by dumping it via tcpdump (viewable via Wireshark, for example)? |
As far as I know, I think that Windows does a caching DNS and that's why I don't need to implement it by myself. |
Anyway I'm going to close the issue. |
Tried it on 3 different machines in 3 different networks. |
Still no traffic dump or at least a distilled reproducible example. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
I'm using hangups python module to build a solution that leverage messages between client and server.
Hangups uses aiohttp, and it seems like that in the following line in aiohttp it takes him up to 400 milliseconds to perform it:
session.request(method,url,param=param,headers=headers, data=data,proxy=None)
Which eventually calls the function _request in aiohttp\client which calls _wrap_create_connection in aiohttp\connector.py .
The line that causes the delay is
return (yield from self_loop.create_connection(*args,**kwargs))
In connector.py.
Expected behaviour
The maximum time to be less than 50 milliseconds
Actual behaviour
The time it takes can reach 400 milliseconds
Steps to reproduce
run send_message.py under hangups/exampels : ( https://github.com/tdryer/hangups )
Put timer before and after the command
return (yield from self_loop.create_connection(*args,**kwargs))
https://github.com/tdryer/hangups
Your environment
aiohttp version: 2.3.10
The text was updated successfully, but these errors were encountered: