There have been a number of performance related bugs over time which are in various states, so this may duplicate some past concerns, but I could not find a currently active bug which reflects the issue in a recent MAAS version.
I have multiple MAAS regions each with several hundred servers in them. Over time, the web interface becomes increasingly slow to load the list of systems. For example, I timed refreshing the Machines tab on a server with 295 machines to load. It took 3 minutes and 45 seconds to load!
Inspection of the database shows a huge server events table:
postgres=# \c maasdb
You are now connected to database "maasdb" as user "postgres".
maasdb=# SELECT nspname || '.' || relname AS "relation",
maasdb-# pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
maasdb-# FROM pg_class C
maasdb-# LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
maasdb-# WHERE nspname NOT IN ('pg_catalog', 'information_schema')
maasdb-# AND C.relkind <> 'i'
maasdb-# AND nspname !~ '^pg_toast'
maasdb-# ORDER BY pg_total_relation_size(C.oid) DESC
maasdb-# LIMIT 5;
relation | total_size
------------------------------------+------------
public.maasserver_event | 24 GB
public.metadataserver_scriptresult | 73 MB
public.metadataserver_nodeuserdata | 27 MB
public.maasserver_node | 1320 kB
public.maasserver_neighbour | 1256 kB
(5 rows)
maasdb=#
We have adopted the undesirable practice of truncating the events table periodically with:
truncate table public.maasserver_event;
... and this immediate speeds things up and makes the web interface usable again.
I think possibly our heavy use of DHCP is a contributor to the bloat of this table, because I believe that DHCP lease renewals are logged as events in this table - though I may be wrong on that.
Is there something we can do to make this more manageable? Either an event log rotation/pruning mechanism, or perhaps we don't need to log as much into this table?
$ dpkg -l '*maas*'|cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============================-======================================-============-=============================================
un maas <none> <none> (no description available)
ii maas-cli 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS client and command-line interface
un maas-cluster-controller <none> <none> (no description available)
ii maas-common 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS server common files
ii maas-dhcp 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS DHCP server
un maas-dns <none> <none> (no description available)
ii maas-proxy 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS Caching Proxy
ii maas-rack-controller 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all Rack Controller for MAAS
ii maas-region-api 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all Region controller API service for MAAS
ii maas-region-controller 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all Region Controller for MAAS
un maas-region-controller-min <none> <none> (no description available)
un python-django-maas <none> <none> (no description available)
un python-maas-client <none> <none> (no description available)
un python-maas-provisioningserver <none> <none> (no description available)
ii python3-django-maas 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS server Django web framework (Python 3)
ii python3-maas-client 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS python API client (Python 3)
ii python3-maas-provisioningserver 2.6.1-7832-g17912cdc9-0ubuntu1~18.04.1 all MAAS server provisioning libraries (Python 3)
See also: https:/ /bugs.launchpad .net/maas/ +bug/1860619 though that bug says "Fix Committed", I don't believe it's addressing the problem of database bloat.