在讲Zabbix优化之前,先来看看Zabbix Server 的逻辑架构图:
对于上图中,架构组件的描述:
常用的架构: 说明:Zabbix最简单的架构,常用于监控主机比较少的情况下。
分布式架构: Server-Proxy-Agentd模式。 说明:Zabbix分布式架构,常用于监控主机比较多的情况下,使用Zabbix Proxy进行分布式监控,有效的减轻了Zabbix Server端的压力。
调整配置文件:Zabbix_Server.conf Zabbix进程参数调整:
1 2 3 4 5 6 | StartPollers=80 StartPingers=10 StartPollersUnreachable=80 StartIPMIPollers=10 StartTrappers=20 StartDBSyncers=8 |
---|
值得注意的是,当Zabbix的Pollers数量过多时(超过limit默认值1024),需要对系统的limit的参数大小进行修改。
1 2 3 4 5 | shell> vi /etc/security/limit.conf * hard nofile 65536 * soft nofile 65536 * hard nproc 65536 * soft nproc 65536 |
---|
Zabbix In-Memory Cache参数优化(以下值仅做参考):
ValueCacheSize=256M
HistoryIndexCacheSize = 64M
TrendCacheSize=64M
HistoryCacheSize=128M
CacheSize=128M
VMwareCacheSize=64M
调整MySQL配置文件:my.cnf或my.ini,在[mysqld]酌情修改参数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | [client] port = 3306 socket = /var/lib/mysql/mysql.sock [mysql] prompt="\u@mysqldb \R:\m:\s [\d]> " no-auto-rehash [mysqld] user= mysql port = 3306 datadir = /data/mysql/ socket = /var/lib/mysql/mysql.sock pid-file = mysqldb.pid character-set-server = utf8mb4 skip_name_resolve = 1 # Timestamp explicit_defaults_for_timestamp = 1 # Connections back_log = 1024 max_connections = 512 max_connect_errors = 5120 innodb_thread_concurrency = 16 # Limit open_files_limit = 65535 innodb_open_files = 65535 # Query Cache query_cache_type = 0 query_cache_size = 0 # binary logs server-id = 3306001 binlog_format = row log-bin = /data/mysql/mysql-binlog expire_logs_days = 7 sync_binlog = 1 max_binlog_size = 1G binlog_cache_size = 4m max_binlog_cache_size = 1G # slow query slow_query_log = 1 long_query_time = 2 slow_query_log_file = /data/mysql/slow.log # Timeout interactive_timeout = 600 wait_timeout = 600 # Engine default-storage-engine = innodb # Buffer key_buffer_size = 32M read_buffer_size = 1M sort_buffer_size = 1M read_rnd_buffer_size = 1M tmp_table_size = 32M join_buffer_size = 16M max_heap_table_size = 32M max_tmp_tables = 48 thread_cache_size = 32 # Time log_timestamps = SYSTEM # Tablespace & File I/O innodb_data_file_path = ibdata1:1G:autoextend innodb_file_per_table = 1 # Redo Log innodb_flush_log_at_trx_commit = 1 innodb_log_file_size = 256M innodb_log_files_in_group = 2 innodb_log_buffer_size = 16M # Innodb innodb_buffer_pool_size = 8G innodb_buffer_pool_instances = 8 innodb_flush_method = O_DIRECT innodb_change_buffer_max_size = 50 innodb_max_dirty_pages_pct = 30 innodb_buffer_pool_load_at_startup = 1 innodb_buffer_pool_dump_at_shutdown = 1 innodb_io_capacity = 500 innodb_io_capacity_max= 1000 innodb_support_xa = 0 innodb_rollback_on_timeout = 1 |
---|
优化监控项的数据采集方式,由被动方式改为主动模式(Passive mode -> Active mode),主动模式的优势:
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。