Hi
I just installed a Zabbix/PostgreSQL system and noticed that there are very frequent updates of one row in the 'ids' table. The effect is that even though I am only monitoring a single 24 port Cisco switch, the CPU load on my Zabbix server is permanently around 2. I turned on PostgreSQL's statistics collection and found out that the 'ids' table is being updated by far most frequently. In fact it's soo bad that the normal data collection is being delayed.
I am using SVN checkout 4239.
zabbix=# select usename,current_query from pg_stat_activity;
usename | current_query
----------+------------------------------------------------------------------------------------------------
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
postgres | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | select nextid from ids where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
(27 rows)
zabbix=# select * from pg_stat_user_tables order by n_tup_upd desc limit 10;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del
-------+------------+----------------+----------+--------------+----------+---------------+-----------+-----------+-----------
16448 | public | ids | 4 | 40 | 117204 | 117204 | 0 | 39070 | 0
16982 | public | profiles | 0 | 0 | 592 | 556 | 0 | 146 | 0
16898 | public | items | 4 | 6736 | 4907 | 11841 | 0 | 63 | 0
17105 | public | triggers | 17 | 18394 | 1856 | 1856 | 0 | 48 | 0
17059 | public | sessions | 38 | 112 | 0 | 0 | 1 | 18 | 0
16771 | public | functions | 90 | 97380 | 4774 | 4774 | 0 | 4 | 0
17049 | public | services_links | 0 | 0 | 0 | 0 | 0 | 0 | 0
17164 | public | valuemaps | 0 | 0 | 0 | 0 | 0 | 0 | 0
16425 | public | dhosts | 0 | 0 | 0 | 0 | 0 | 0 | 0
16647 | public | history_uint | 0 | 0 | 6731 | 0 | 0 | 0 | 0
(10 rows)
Markus
I just installed a Zabbix/PostgreSQL system and noticed that there are very frequent updates of one row in the 'ids' table. The effect is that even though I am only monitoring a single 24 port Cisco switch, the CPU load on my Zabbix server is permanently around 2. I turned on PostgreSQL's statistics collection and found out that the 'ids' table is being updated by far most frequently. In fact it's soo bad that the normal data collection is being delayed.
I am using SVN checkout 4239.
zabbix=# select usename,current_query from pg_stat_activity;
usename | current_query
----------+------------------------------------------------------------------------------------------------
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
postgres | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | update ids set nextid=nextid+1 where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | select nextid from ids where nodeid=0 and table_name='events' and field_name='eventid'
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
zabbix | <IDLE>
(27 rows)
zabbix=# select * from pg_stat_user_tables order by n_tup_upd desc limit 10;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del
-------+------------+----------------+----------+--------------+----------+---------------+-----------+-----------+-----------
16448 | public | ids | 4 | 40 | 117204 | 117204 | 0 | 39070 | 0
16982 | public | profiles | 0 | 0 | 592 | 556 | 0 | 146 | 0
16898 | public | items | 4 | 6736 | 4907 | 11841 | 0 | 63 | 0
17105 | public | triggers | 17 | 18394 | 1856 | 1856 | 0 | 48 | 0
17059 | public | sessions | 38 | 112 | 0 | 0 | 1 | 18 | 0
16771 | public | functions | 90 | 97380 | 4774 | 4774 | 0 | 4 | 0
17049 | public | services_links | 0 | 0 | 0 | 0 | 0 | 0 | 0
17164 | public | valuemaps | 0 | 0 | 0 | 0 | 0 | 0 | 0
16425 | public | dhosts | 0 | 0 | 0 | 0 | 0 | 0 | 0
16647 | public | history_uint | 0 | 0 | 6731 | 0 | 0 | 0 | 0
(10 rows)
Markus
Comment