-
Notifications
You must be signed in to change notification settings - Fork 78
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
The API is unavailable in production #279
Comments
Hopefully it fixes #279. See fastapi/fastapi#4041
Possibly it's due to the multiple queries to the database done on every call to the I don't know how we should manage these data, possibly the count should be sent by the worker to a prometheus gateway, instead of computing the count on every call. Another way (at least for the queue) is to use rabbitmq, instead of having the queue logic in the code, surely we can get the metrics easily from there. cc @McPatate ? |
RabbitMQ will resolve some of your problems, but will generate new ones :) Querying mongo should not create that high CPU, as you said, adding indexes should help. |
OK, perfect, I'll try to improve the queries and re-enable the metrics |
Also if you can, you should be able to store all the running jobs in memory without querying the database :) |
* fix: 🐛 reserve 256M for the API and nginx pods The API service seems to need about 52M: ``` process_virtual_memory_bytes 7.59681024e+08 process_resident_memory_bytes 5.2195328e+07 ``` * fix: 🐛 remove the PrometheusMiddleware to reduce the RAM usage Hopefully it fixes huggingface/dataset-viewer#279. See fastapi/fastapi#4041
It seems like a known error: fastapi/fastapi#4041.
Possibly due to a middleware (maybe
PrometheusMiddleware
here: https://github.com/huggingface/datasets-server/blob/main/services/api/src/api/app.py#L48)The text was updated successfully, but these errors were encountered: