httplib creates a new Client every request #3251

Open
opened 2025-11-02 05:05:31 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @lunny on GitHub (Apr 26, 2019).

The client connection will not be reused.

Originally created by @lunny on GitHub (Apr 26, 2019). The client connection will not be reused.
GiteaMirror added the issue/confirmedtype/refactoring labels 2025-11-02 05:05:31 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jun 25, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jun 25, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@6543 commented on GitHub (Sep 17, 2020):

@lunny is this still the case?

back ground info?

@6543 commented on GitHub (Sep 17, 2020): @lunny is this still the case? back ground info?
Author
Owner

@lunny commented on GitHub (Sep 18, 2020):

I think yes. For HTTP/2 , if you request the same site. The http client will reuse the TCP connections. But if you create the client every request, the preformance is slower.

图片
@lunny commented on GitHub (Sep 18, 2020): I think yes. For HTTP/2 , if you request the same site. The http client will reuse the TCP connections. But if you create the client every request, the preformance is slower. <img width="580" alt="图片" src="https://user-images.githubusercontent.com/81045/93540547-917c5580-f986-11ea-8638-f8b8b1b521fb.png">
Author
Owner

@lunny commented on GitHub (Dec 30, 2022):

maybe https://github.com/imroc/req is a better choice.

@lunny commented on GitHub (Dec 30, 2022): maybe https://github.com/imroc/req is a better choice.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3251