ISISComputingGroup / ISISComputingGroup/IBEX

DBSRV/GUI: Reduce cpu load by DBSRV

Aperta
#4,922 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
6
Fork
2
Merge medio
16h 40m
PR unite (30g)
2

Descrizione

As a developer I would like the PVs not to trigger a monitor every second even if the PV hasn't changed, I would also like a single SQL query if possible so the database is less loaded. Finally, think about how often we need to poll the database. This should reduce the cpu load of DBSRV.

See #4648 which may need a different design in the DBSRV.

### Acceptance Criteria

1. PV IOC information triggers a monitor only on content change not every second
1. Poll of database is done on a sensible polling time

### Notes

It maybe that the number of PVs can be reduced so that more information is put into a smaller number of PVs. The current pvs are (`CS:BLOCKSSERVER:{}`):
- `PVS:ALL`
- `PVS:INTEREST:HIGH`
- `PVS:INTEREST:MEDIUM`
- `PVS:INTEREST:FACILITY`
- `PVS:ACTIVE`
These should not update every second the code to do this is `inst_server/DatabaseServer/database_server.py` ln 191 (in DBSVR).
I think the filter in the GUI is slow because it takes the list of all PVs and filters it by the list of interest X PVs and active. This is an `n`x`m` time filter which is quite big. I would suggest the all list has metadata added which is interest level and IOC. The list is then filtered by interest and IOCs that appear in `IOCS` PV. But please think about this yourself.
Code in the GUI is `uk.ac.stfc.isis.ibex.ui.configserver.editing.pvs.PVSelectorPanel.setConfig` the slow bits appear to be:
- `blockPVTable.setRows(config.pvs());`
- `selectionChanged` on source change
- `selectionChanged` on interest change
and possibly the refresh function in `uk.ac.stfc.isis.ibex.ui.configserver.editing.pvs.PVSelectorPanel.addFilterListener`

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia in inst_server/DatabaseServer/database_server.py intorno alla riga 191 e traccia come vengono aggiornati i PV elencati e con quale frequenza viene interrogato il database. Poi esamina PVSelectorPanel.setConfig, selectionChanged e addFilterListener, insieme all’issue #4648. Il lavoro è completato quando le informazioni sui PV vengono monitorate solo in caso di modifica del contenuto e il polling del database usa un intervallo ragionevole senza rallentare il filtraggio della GUI.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend, databases, frontend, performance
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.