Description:
The default Tomcat and MySQL settings are not sufficient for monitoring more than a few servers.
How to repeat:
1) Install the Service Manager.
2) Review the catalina.sh and my.cnf files.
Suggested fix:
1) Use the following for my.cnf:
[client]
port = @@BITROCK_MYSQL_PORT@@
socket = @@BITROCK_MYSQL_ROOTDIR@@/tmp/mysql.sock
[mysql]
port = @@BITROCK_MYSQL_PORT@@
no-auto-rehash
prompt = \u@\h [\d]>\_
[mysqld]
port = @@BITROCK_MYSQL_PORT@@
basedir = @@BITROCK_MYSQL_ROOTDIR@@/
datadir = @@BITROCK_MYSQL_ROOTDIR@@/data/
socket = @@BITROCK_MYSQL_ROOTDIR@@/tmp/mysql.sock
pid-file = @@BITROCK_MYSQL_ROOTDIR@@/data/mysqld.pid
server-id = 1
secure_auth = 1
skip-locking
lower_case_table_names = 1
innodb_data_file_path = ibdata1:500M:autoextend
innodb_autoextend_increment = 50M
innodb_buffer_pool_size = 512M
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 2
innodb_support_xa = 0
innodb_file_per_table
innodb_max_dirty_pages_pct = 20
table_cache = 256
thread_cache_size = 16
max_heap_table_size = 32M
tmp_table_size = 32M
sort_buffer_size = 512K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
max_allowed_packet = 1M
2) Make the following change in catalina.sh:
Change:
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$CATALINA_BASE/tmp -server"
To:
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$CATALINA_BASE/tmp -Xmx768M -Xms768M -Xss128k -XX:+UseParallelOldGC -XX:+UseBiasedLocking -server"
Note that on Windows the extra parameters are set in mysqlmonitorctl.bat, not in catalina.bat or catalina.sh.
3) In config.properties, we'd like the following (along with the
comment):
# max connections in the pool for the repository
default.maxActive=70