Skip to content
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

Performance of api/v2/exercisebaseinfo/?limit=900 #1694

Open
bbkz opened this issue Jun 11, 2024 · 1 comment
Open

Performance of api/v2/exercisebaseinfo/?limit=900 #1694

bbkz opened this issue Jun 11, 2024 · 1 comment

Comments

@bbkz
Copy link
Contributor

bbkz commented Jun 11, 2024

Use case

In my setup, when i open /exercise/overview/ it takes 2-3 minutes to load the content of api/v2/exercisebaseinfo/?limit=900. I run it on raspberry's and similar, so it may just be a hardware limitation.

Workaround

So i came up with the following workaround. I set EXERCISE_CACHE_TTL to 25 hours and run a cronjob every 24 hours to warm up the cache:

python3 manage.py warmup-exercise-api-cache --force

This way it will reset the TTL of the exercise cache every 24 hours. This work fine and it is blazing fast now ;-) I think updating a exercise will warmup it's cache induvidually so, i don't have to wait till the next day for the updates (but i am not sure).

Proposal

It would be nice if the warmup-exercise-api-cache could be refactured similar to sync_exercises, so that celery task can be created. This would eliminate the fact that a cronjob is needed to warmup the cache.

@rolandgeider
Copy link
Member

mhh, yes, that does sound like a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants