repeated gets with keep-alive #5564
-
Kind of new to the library here and new with the requirement of needing to use keep-alive. I guess I should also mention this is a client side use case. Having skimmed over the RFC for HTTP/1.1 for keep-alive and what I believe I should expect... each of my GET requests originate from from a new port and I'm getting log entries that a new TLS handshake was started. The server is behind Cloudflare and the the response return times start off really nice (of course anything faster would be better) but after a small number of requests the responses go from 10-20 ms to 200-500 ms. I have seen the examples out there where aio-http can make an insane number of request-response cycles per second but they are all showing hits to a wide range of domains - not sustained conversations to a single domain as in my use case. Just started reviewing the client.py file here, making sure I'm understanding the documentation and examples correctly. Any pointers/help parallel to this effort would be great. TIA |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Probably need a code example that demonstrates the problem in order for someone to help out. |
Beta Was this translation helpful? Give feedback.
-
Why would you expect keep-alive to use a different port? It is specifically designed to reuse an existing TCP connection that is already established. Hence the same pairs of source host/port + destination host/port on the transport level are used (for sending HTTP requests the to the same remote host:port). |
Beta Was this translation helpful? Give feedback.
Probably need a code example that demonstrates the problem in order for someone to help out.