-
Notifications
You must be signed in to change notification settings - Fork 17
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
Very slow response time #139
Comments
I ran these tests locally as well, and when I move After a few tests, I discovered that Code: import httpx
for i in range(100):
httpx.HTTPTransport() Result:
|
After a few more tests, I discovered that the So the example above can be changed to this: import ssl
import certifi
for i in range(100):
context = ssl.SSLContext()
context.load_verify_locations(certifi.where()) I'm not sure how urllib3 handles this problem. |
I've found this. So using it out of endpoint is a correct decision, I guess. It also mentions "explicit" closure. I guess client gets closed eventually (?) |
Simply use a single client for your application and don't close it. Your operating system will clean up everything after the programme has finished. |
I'll do that then. Thanks! |
Hi, I'm getting very low server response time compared to
requests_cache
.Here are some screenshots from
locust
comparingrequests_cache
on the left andhishel
on the rightI was testing response time also with code provided in documentation. It wasn't as fast as
requests_cache
but still not 3 RPS.app.py
api.py
If I declare
hishel.AsyncCacheClient
outside a function and use withoutwith
then I get about 145 RPS.The text was updated successfully, but these errors were encountered: