question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

http pipelining over single TCP connection

See original GitHub issue

Does grequests support http pipelining? Multiple requests (“Connection: keep-alive”) over single TCP connection without waiting for answer.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
spyoungtechcommented, Aug 10, 2020

@qo4on I had a thought about this over the weekend. I wonder if your problem would be solved by avoiding using a session altogether – As in, creating a new session for every request.

My theory is that interleaved requests using the same underlying TCP connection are causing your problem. By default, when you use a session, the TCP connections will be reused. If you do not use a session object, a new session will be created for each request, which should also mean a new TCP connection will be created for each request.

You will have to pass in any necessary headers/cookies to each request, but I think this may help you send multiple requests concurrently, instead of needing to do them all serially.

1reaction
qo4oncommented, Aug 11, 2020

Thanks. I wrote a message to their support team and they fixed some errors. Finally this code works. I have no idea why it works, but it works, it returns fd = [1, 2, 3, 4, 5...] as it should. I tried to do the same with httpx and had incorrect values for all files fd = [1, 1, 1, 1, 1...].

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP pipelining - Wikipedia
HTTP pipelining is a feature of HTTP/1.1 which allows multiple HTTP requests to be sent over a single TCP connection without waiting for...
Read more >
Connection management in HTTP/1.x - MDN Web Docs - Mozilla
Pipelining is the process to send successive requests, over the same persistent connection, without waiting for the answer. This avoids latency ...
Read more >
Using HTTP Pipelining to hide requests - DigiNinja
Pipelining allows multiple requests to be grouped together and sent over a single TCP connection, this eliminates the need to setup and tear ......
Read more >
HTTP Keep-Alive, Pipelining, Multiplexing and Connection ...
HTTP /2 introduced the notion of a stream, which allows a bidirectional flow of bytes to be exchanged over a persistent TCP connection....
Read more >
HTTP 1.1 Pipelining is not supported with Envoy - AskF5
HTTP /1.1 without pipelining: Each HTTP request over the TCP connection must be responded to before the next request can be made. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found