Node event log queries are slow (over 1 second)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Graham Binns | ||
1.7 |
Fix Released
|
High
|
Graham Binns |
Bug Description
I turned on slow query logging in postgresql and noticed that node event log queries are taking over 1 second to complete:
2014-12-13 17:10:30 UTC LOG: duration: 1386.208 ms statement: SELECT "maasserver_
2014-12-13 17:10:34 UTC LOG: duration: 1171.199 ms statement: SELECT "maasserver_
There's no way to clear these log entries, and I have 100+ nodes, each with over 10,000 event log entries.
Related branches
- Raphaël Badin (community): Approve
-
Diff: 69 lines (+29/-8)2 files modifiedsrc/maasserver/views/nodes.py (+19/-8)
src/maasserver/views/tests/test_nodes.py (+10/-0)
- Raphaël Badin (community): Approve
-
Diff: 432 lines (+382/-8)4 files modifiedsrc/maasserver/migrations/0121_recompute_storage_size.py (+1/-0)
src/maasserver/migrations/0122_add_eventtype_level_index.py (+373/-0)
src/maasserver/models/eventtype.py (+1/-1)
src/maasserver/views/nodes.py (+7/-7)
tags: | added: oil |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas: | |
milestone: | next → none |
I am very surprised this is so slow, since the query is limited to only 5 results. Must just be to the overall size of the table.
A cleaning system is need to make sure that the event log doesn't get to large, maybe so many entries per node or only so many days old. The number of days would probably be the best allowing it to be tune-able.