geopython / geopython/GeoHealthCheck

Slow response in web app

Offen
#326 8 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
92
Forks
75
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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);

```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql, python
Bereich
backend, databases, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.