I analysed work zabbix with database (in our case it is postgresql) and now posting result of using requests.
Working of system around for 2 minutes appeared (Here is results >1000 counts):
Full code of requesets:
Optimization:
Maybe such often operations should you do in memory and then commit frequently into database?
Working of system around for 2 minutes appeared (Here is results >1000 counts):
Code:
count | request ---------------------------------------------------- 1883 | select 0,lastvalue from 4594 | insert into history_uint - insert new data of items 4594 | select num,value_min,value_avg,value_max from trends_uint - insert or update new data of items 5201 | select distinct function,parameter,itemid,lastvalue - re-calculate and updates values of FUNCTIONS related to the item 5201 | select distinct t.triggerid,t.expression,t.description,t.url,t.comments,t.status,t.value,t.priority,t.type - re-calculate and updates values of TRIGGERS related to the item 5296 | update items set - update item info after new value is received
select 0,lastvalue from functions where functionid=34639
insert into history_uint (clock,itemid,value) values (1251179685,19837,10)
select num,value_min,value_avg,value_max from trends_uint where itemid=19837 and clock=1251179685
select distinct function,parameter,itemid,lastvalue from functions where itemid=22541
select distinct t.triggerid,t.expression,t.description,t.url,t.com ments,t.status,t.value,t.priority,t.type from triggers t,functions f,items i where i.status<>3 and i.itemid=f.itemid and t.status=0 and f.triggerid=t.triggerid and f.itemid=24617
update items set nextcheck=1251179740,prevvalue=lastvalue,prevorgva lue=NULL,lastvalue='0.190000',lastclock=1251179685 where itemid=19840
insert into history_uint (clock,itemid,value) values (1251179685,19837,10)
select num,value_min,value_avg,value_max from trends_uint where itemid=19837 and clock=1251179685
select distinct function,parameter,itemid,lastvalue from functions where itemid=22541
select distinct t.triggerid,t.expression,t.description,t.url,t.com ments,t.status,t.value,t.priority,t.type from triggers t,functions f,items i where i.status<>3 and i.itemid=f.itemid and t.status=0 and f.triggerid=t.triggerid and f.itemid=24617
update items set nextcheck=1251179740,prevvalue=lastvalue,prevorgva lue=NULL,lastvalue='0.190000',lastclock=1251179685 where itemid=19840
Maybe such often operations should you do in memory and then commit frequently into database?