geopython / geopython/GeoHealthCheck
Slow response in web app
- Lingua principale
- Python
- Stelle
- 92
- Fork
- 75
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Describe the bug**
The application is really slow, or even stops working, if there is a high number of services configured and / or there are too many historical records in the database.
**To Reproduce**
Publish a high number of services (ie. 800) , keep 90 days of history and check services every hour.
Looks like the home page tries to load too many records from the database trying to show the general stats of the instance and the web app fails.
**Expected Behavior**
The web app loads successfully.
**Suggestion**
In addition to reduce the number of days of history and frequency of checks it could help to include some indexes in the database.
For example:
```sql
CREATE INDEX run_res_ident_idx
ON public.run (resource_identifier);
CREATE INDEX res_tag_res_ident_idx
ON public.resource_tags (resource_identifier);
CREATE INDEX res_tag_tag_idx
ON public.resource_tags (tag_id);
CREATE INDEX resource_res_type_idx
ON public.resource (resource_type);
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start at the home page's general-statistics query path and inspect its reads from the run, resource_tags, and resource tables. Reproduce the slowdown with many services and 90 days of history, then use database query analysis to identify the bottleneck and verify that the web app loads successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql, python
- Ambito
- backend, databases, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100