Tracking/optimizing slow queries
I'd suggest turning on the slow query log, determining (from the query text) where those are being generated (i.e. from the php interface, or in what part of the C sources, and for what operation). It's ambiguous from your statement: are you seeing 2000+second runtimes, or 2000+ slow queries over some period of time?
It's a good goal, but not necessarily a good bet that you can get rid of all slow queries (aside from the fact that it is a user-defined threshhold
, since they are affected by so many factors. First off you have to take the time to tune your operating system, IO subsystem, and database server for the available hardare. At that point you're in a better state no matter what queries are thrown at the system, and makes it much easier to discern the cause of one.
I've found several instances of misbehaving queries that were able to be optimized, and the zabbix crew were able to get those resolved in the next dot-release after giving details on the running query, circumstances involved, and what was generating them. I've seen a great improvement, but there is obviously still room for improvement. I'm working on tracking down further instances that can be tuned, and any assistance you can give is of benefit to us all.
Currently the biggest violators I see continue to be GUI operations on templates, which appears to perform far more queries/updates than necessary against every host and related table.
/eli
I'd suggest turning on the slow query log, determining (from the query text) where those are being generated (i.e. from the php interface, or in what part of the C sources, and for what operation). It's ambiguous from your statement: are you seeing 2000+second runtimes, or 2000+ slow queries over some period of time?
It's a good goal, but not necessarily a good bet that you can get rid of all slow queries (aside from the fact that it is a user-defined threshhold
, since they are affected by so many factors. First off you have to take the time to tune your operating system, IO subsystem, and database server for the available hardare. At that point you're in a better state no matter what queries are thrown at the system, and makes it much easier to discern the cause of one. I've found several instances of misbehaving queries that were able to be optimized, and the zabbix crew were able to get those resolved in the next dot-release after giving details on the running query, circumstances involved, and what was generating them. I've seen a great improvement, but there is obviously still room for improvement. I'm working on tracking down further instances that can be tuned, and any assistance you can give is of benefit to us all.
Currently the biggest violators I see continue to be GUI operations on templates, which appears to perform far more queries/updates than necessary against every host and related table.
/eli
Comment