Linux monitoring (OS, MySQL, Tomcat, Apache), tomcatapache

Source: Internet
Author: User
Tags table definition

Linux monitoring (OS, MySQL, Tomcat, Apache), tomcatapache

My Opinion on gradually moving away from the development position has been approved by the boss. My next major job is "O & M + database management". I would like to thank Jie Minmin and Xiao Ma for accepting my harassment and then harassing them. I will also harass Ye Dong, Mr. Xiaogang, zhishen, and pig. Thank you. At the same time, I would like to thank Mr. Wu, Mr. Ye, Mr. Luo, Mr. Qi, and Mr. Orange.

Because I have not learned how to play zabbix, I should try writing a script first. The written script will be shared back later. You are welcome to criticize and give advice.

========================================================== ========================================================== ========

1. Key Process Monitoring: tomcat, apache, and mysql
2. Bucket monitoring: mount point 75% alarm (if it is always 75%, an alarm is triggered every hour)
3. View load_avg in uptime. If these three values are greater than (cpu core/2), the system resource information (cpu, mem, io, and net) will be collected)
Top 10 processes (cpu, mem), which are collected every 10 seconds. At the same time, an alarm is triggered every 10 minutes (if it is always greater than (cpu core/2 ))
4. Key domain name ping test (??)
5. How to monitor network traffic (TBD)
6. MySQL performance parameter collection
Print the key parameters of MySQL:
Innodb_buffer_pool_size: 0.5 -- 0.8
Innodb_max_dirty_pages_pct: & lt; 50%
Innodb_log_buffer_size: 32 M
Innodb_data_file_path:> 1G
Innodb_log_file_size:
Innodb_flush_log_at_trx_commit: 1
Sync_binlog: 1
Query_cache_size: 0
Query_cache_type: 0
Innodb_data_file_path = ibdata1: 100 M: autoextend #1024 M init
Innodb_file_per_table: 1 # Whether to enable independent tablespace


Innodb_log_buffer_size: 8 M # buffer size used to buffer log data. when the value is full, InnoDB must refresh the data to the disk. since refresh is basically performed every second, it is not necessary to set this value too large (even for long transactions)
Innodb_log_file_size: 100 M # redo log size, which cannot be too large; otherwise, recovery is slow and cannot be too small; otherwise, frequent checkpoint causes performance Jitter
Innodb_log_files_in_group: 3 # specify the number of redo logs in the log Group


Log_bin # enable binlog
Expire_logs_days: 45
Binlog_format: MIXED


Innodb_flush_method: O_DIRECT
This parameter controls the Enable and fl modes of innodb data files and redo logs. this parameter is described in the document as follows:
There are three values: fdatasync (default), O_DSYNC, O_DIRECT
Fdatasync: default value. Call fsync () to fl the buffer of the data file and redo log.
O_DSYNC: innodb will use O_SYNC to open and fl redo log, and use fsync () to fl data files
O_DIRECT: innodb uses O_DIRECT to open data files, and fsync () is used to fl data files and redo logs.


Open_files_limit: 8192
Table_definition_cache: 400
Table_open_cache: 400


Lower_case_table_names:
SQL _mode
Character_set_server


Max_connections
Max_user_connections
Thread_cache_size




Read_buffer_size
Sort_buffer_size
Tmp_table_size
Join_buffer_size
Read_rnd_buffer_size
Max_heap_table_size




Slow_query_log_file
Slow_query_log: 1
Log_queries_not_using_indexes: 1
Long_query_time: 0.02
Min_examined_row_limit: 100


Mysql memory allocation rules are as follows: the maximum number of memory used is the configured value, instead of immediate allocation.
Global cache includes:
Global buffer (total global memory allocation) =
Innodb_buffer_pool_size -- InnoDB high-speed buffer, row data, index buffer, transaction lock, adaptive hash, etc.
+ Innodb_additional_mem_pool_size -- extra InnoDB Data Dictionary Memory, cache all table data dictionaries
+ Innodb_log_buffer_size -- InnoDB REDO log buffer improves REDO log write Efficiency
+ Key_buffer_size -- high-speed cache for MyISAM Table indexes, improving the index read and write efficiency of MyISAM tables
+ Query_cache_size -- queries the cache and caches query results to improve the efficiency of returning repeated queries.
+ Thread_cache_size -- maximum number of connection threads stored in Thread_Cache
+ Table_cahce-tablespace file descriptor cache to improve data table opening Efficiency
+ Table_definition_cache -- table definition file descriptor cache to improve the efficiency of opening a data table
Session cache includes:
Total_thread_buffers = max_connections *(
Read_buffer_size -- sequential read buffer, improving the efficiency of sequential read
+ Read_rnd_buffer_size -- random read buffer, improving random read Efficiency
+ Sort_buffer_size -- Sort buffer to improve sorting efficiency
+ Join_buffer_size -- table connection buffer to improve table connection Efficiency
+ Binlog_cache_size -- binary log buffer to improve binary log writing Efficiency
+ Tmp_table_size -- Memory temporary table to improve the storage efficiency of temporary tables
+ Thread_stack -- thread stack, temporarily storing SQL statements/stored procedures
+ Thread_cache_size -- thread cache, which reduces the overhead of opening threads repeatedly and simulates the connection pool


Mysql status:
Qps, tps, InnoDB Buffer hit rate, slow logs, Table Cache status, lock status, Tmp Table Status (temporary Table status), Binlog Cache Usage, Innodb_log_waits volume, and slave latency wait.




7. Virtual Machine stress test report: (sysbench, tpcc_mysql)
Tpcc_mysql stress testing TPS: OS memory is adjusted to 16 GB, innodb_buffer_pool_size is set to 2, 4, 6, 8, 10, 12G, and the number of warehouses is 5, 10, 15, 20, 50, 60, 80,100 TPS.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.