-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
We should use aihttp instead of requests (what about wikidata ?) #22
Comments
A simple solution for wikidata is to use https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor |
@sumit-158 I found a good lib : https://asyncer.tiangolo.com/ (it's 0.0.1 but as explained in the intro this is not a problem) This will have lots of benefits:
|
@alexgarel I was doing some tests(just for fun!) on the response timing with possible methods and I got this result process-time of response (The value is from the current main branch le., single facet)
I was also thinking if we can run it with Gunicorn might decrease compute time (I'm not so sure!) |
@sumit-158 I guess that the limiting factor here is our requests time. And the longest might be the wikidata, which needs two requests. Passing to gunicorn is about handling a lot of concurrent request, not reducing latency of a single request. |
The requests library does not seems to be async framework compatible… it blocks the thread while it should release it for the
This would make our server very unresponsive to a lot of requests.
We have to use either aihttp or requests-future instead (or any popular library for that.
We have the problem with wikidata lib which use urllib.request… we should see if we could monkeypatch the code for that…
The text was updated successfully, but these errors were encountered: