Professional Documents
Culture Documents
For those who have no clue about what Zabbix is here is a short description as stated on Zabbix web
site.
Zabbix is an enterprise-class open source distributed monitoring solution. In this article we will
discuss about how to optimize MySQL as load on Zabbix might lead to various problems.
Recommendation 1.
tmpdir=/mytmp
You'll have to mkdir /mytmp and the numeric uid and gid values for your mysql user+group need to
go on that line. Then you should be able to mount /mytmp and use tmpfs for mysql's temp directory.
Recommendation 2.
innodb_buffer_pool_size=12000M
innodb_flush_method=O_DIRECT
Recommendation 3.
Other parameters
innodb_file_per_table
Use file_per_table to keep tablespaces more compact and use "optimize table" periodically. And
when you set this value in my.cnf you don't get an actual file_per_table until you run an optimize on
all the tables. This'll take a long time on the large zabbix history* and trends* tables.
log_slow_queries=/var/log/mysql.slow.log
thread_cache_size=4
It seems to affect the hit rate of Threads_created per Connection in 'show global status' -- with it set
to 4 i had 3228483 Connections and 5840 Threads_created, which is a 99.2% hit rate -- higher
number of Threads_created is worse.
query_cache_limit=1M
query_cache_size=128M
tmp_table_size=256M
max_heap_table_size=256M
table_cache=256
This was also based on other tuning docs, but based on the number of tables in a zabbix database
with 73 tables in zabbix plus temp tables and mysql tables and stuff that this was appropriate.
max_connections = 300
I jacked this up because i had a measured max conns of 50 and wanted headroom and configuring
connections is reasonably cheap in mysql
innodb_flush_log_at_trx_commit=2
I had tried this before and not seen a huge benefit, but the consultant advised that since i didn't care
about strict ACID that this would help a lot for high volume writes.
join_buffer_size=256k
read_buffer_size=256k
read_rnd_buffer_size=256k
Try keeping these values no higher than this, because they are per-thread buffers. I had run into
conflicting recommendations on the net to increase the size of the join_buffer_size in particular.