MySQL server has gone away と SNMP first network errorについて

いつもお世話になっております。

◆環境
Zabbix2.0.3、RHEL5.5、mysql5.0.77
server01:Zabbixサーバ
hogehoge01,02,03:監視対象サーバ

現在、上記環境でZabbixサーバを稼働させているのですが、
zabbix_server.logに下記ログが出力されております。
サーバは落ちておらず、監視アイテムの値も取得出来ております。
mysqld.logには何も出力されていませんでした。

------------------------------------------------------------------------------
29076:20130101:073051.549 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29080:20130101:104733.288 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge02' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29078:20130101:175852.413 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29076:20130101:200452.406 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29076:20130102:055652.944 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29084:20130102:102052.761 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29080:20130103:045653.411 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29078:20130103:135734.364 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge02' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29078:20130104:064654.242 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29082:20130104:162254.497 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29080:20130105:004654.354 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29076:20130106:014055.188 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29082:20130106:204856.520 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29078:20130107:013655.709 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29082:20130107:102142.007 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge02' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29076:20130107:120857.583 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29084:20130107:152617.195 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='server01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29076:20130107:220457.519 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29078:20130108:080458.410 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='hogehoge01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
29084:20130108:081618.345 [Z3005] query failed: [2006] MySQL server has gone away [select hostid,status from hosts where host='server01' and status in (0,1) and proxy_hostid is null and hostid between 0 and 99999999999999]
------------------------------------------------------------------------------

my.cnfの編集も行っております。
------
innodb_file_per_table
innodb_buffer_pool_size=512M
innodb_log_file_size=64M
default-character-set=utf8
------

wait_timeout値はデフォルトのままです。
# mysql -u root -e 'show variables like "wait_timeout"'
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+

監視項目数は以下になります。
アイテム数 (有効/無効/取得不可)   1718 (1686 / 0 / 32)
1秒あたりの監視項目数(Zabbixサーバーの要求パフォーマンス) 15.63

過去の投稿の中で、監視アイテム数は1000くらいまでなら問題なく監視出来るという
回答がありましたが、監視アイテム数が多すぎるのでしょうか。
監視アイテム数を減らす以外の解決法やアドバイス等ありましたらよろしくお願いします。

また、下記ログもzabbix_server.logに出力されていたのですが、上記ログに関係するものなのでしょうか。

------------------------------------------------------------------------------
29072:20130107:185624.134 enabling SNMP checks on host [hogehoge03]: host became available
29073:20130107:185716.517 SNMP item [ifDescr] on host [hogehoge03] failed: first network error, wait for 15 seconds
29075:20130107:185731.403 resuming SNMP checks on host [hogehoge03]: connection restored
29073:20130107:185738.682 SNMP item [hrProcessorLoad] on host [hogehoge03] failed: first network error, wait for 15 seconds
29075:20130107:185759.477 SNMP item [hrProcessorLoad] on host [hogehoge03] failed: another network error, wait for 15 seconds
29075:20130107:185820.500 SNMP item [hrProcessorLoad] on host [hogehoge03] failed: another network error, wait for 15 seconds
29075:20130107:185835.517 resuming SNMP checks on host [hogehoge03]: connection restored
------------------------------------------------------------------------------

コメント表示オプション

お好みのコメント表示方法を選び「設定の保存」をクリックすると変更が反映されます。
ユーザー TNK の写真

サーバの処理能力が低い可能性も考えられます。

多少不足している程度であれば、デフォルトで1時間に1回実行され
るハウスキーピングの処理の時間帯のみ「MySQL server has gone
away」が発生してしまうのは、よく見かけるのですが、ログを見る
限り1時間ごとよりも頻繁に発生しているようです。

Zabbixサーバを稼働させているサーバのCPUやメモリサイズはどの
程度のものを利用されていますか?

あと、SNMPのアイテムのfirst network errorは関係ないと思いま
す。
SNMPでリトライを行ったとしても、mysqlへのアクセスが滞るよう
な原因になるとは考えられません。

ユーザー toku1975 の写真

TNKさん

ZabbixサーバのCPUとメモリサイズは以下になります。
CPU: 1vCPU(2.4MHz)
メモリ: 1024MB

現在、監視アイテム数が約1700程度あるのですが、この場合どの程度のCPUとメモリサイズが必要になるのでしょうか。
(メモリサイズは倍に増やす予定です)

ユーザー TNK の写真

全体のメモリが1GBしかない環境で、MySQLに512MB以上割り当てて
しまうと、OSとZabbixのためのメモリが不足してしまうと思います。

全体的なバランスを取るには、トータルのメモリが1GBのままであ
るならば、innodb_buffer_pool_sizeの値を少し小さくした方がよ
いでしょう。

OSがi386版なのかx86_64版なのかと同じサーバで何をどれだけ稼働
させているのかがわからないのですが、Zabbixを活用したり、top
コマンド、vmstatコマンド、sarコマンドなどを利用してswapが頻
発しないように調整されてみてはいかがでしょうか?

あと、パフォーマンスに関しては、トータルでの監視項目数よりも
1秒あたりの監視項目数の方がよりパフォーマンスに直結してくる
と思います。
登録されている監視項目数が多くても各項目の監視間隔が長ければ、
スペックの低いサーバでも監視は可能です。

秒間15.63程度であれば、32bit版で2vCPUで、メモリサイズを調整
すれば、トータル1GBのメモリでも監視できたような気がします。
ただし、64bit版を利用されているのであれば、より多くのメモリ
が必要です。

トータルのメモリサイズを追加するか、innodb_buffer_pool_size
の値を少し小さくしてみて頂けませんでしょうか?

ユーザー toku1975 の写真

TNKさん

ご回答いただきありがとうございます。
OSはx86_64版になります。
トータルのメモリサイズは2GBに増やしてしばらく様子を見ましたが状況は変わらなかったため、
innodb_buffer_pool_sizeの値を少し小さくして、しばらく様子を見たいと思います。
後日、結果を連携させていただきます。