Configuration is default my.cnf- #
- # my.cnf example for GreatSQL
- #
- # The following parameter settings are for reference only, and it is assumed that the server has 256G available memory
- #
- [client]
- socket = /data/GreatSQL/mysql.sock
- [mysql]
- loose-skip-binary-as-hex
- prompt = "(\\D)[\\u@GreatSQL][\\d]>"
- no-auto-rehash
- [mysqld]
- user = mysql
- port = 3306
- server_id = 3306
- basedir = /usr/
- datadir = /data/GreatSQL
- socket = /data/GreatSQL/mysql.sock
- pid-file = mysql.pid
- character-set-server = UTF8MB4
- skip_name_resolve = 1
- lower_case_table_names = 1
- # If your database primarily runs overseas, please adjust this parameter according to your actual situation
- default_time_zone = "+8:00"
- bind_address = "0.0.0.0"
- plugin_dir = /usr/local/GreatSQL-8.0.32-25-Linux-glibc2.28-aarch64/lib/plugin
- #performance setttings
- lock_wait_timeout = 3600
- open_files_limit = 65535
- back_log = 1024
- max_connections = 1024
- max_connect_errors = 1000000
- table_open_cache = 4096
- table_definition_cache = 2048
- sort_buffer_size = 4M
- join_buffer_size = 4M
- read_buffer_size = 8M
- read_rnd_buffer_size = 4M
- bulk_insert_buffer_size = 64M
- thread_cache_size = 768
- interactive_timeout = 600
- wait_timeout = 600
- tmp_table_size = 96M
- max_heap_table_size = 96M
- max_allowed_packet = 64M
- net_buffer_shrink_interval = 180
- #GIPK
- loose-sql_generate_invisible_primary_key = ON
- #log settings
- log_timestamps = SYSTEM
- log_error = /data/GreatSQL/error.log
- log_error_verbosity = 3
- slow_query_log = 1
- log_slow_extra = 1
- slow_query_log_file = /data/GreatSQL/slow.log
- # Set slow log file size to 1G and total file count to 10
- max_slowlog_size = 1073741824
- max_slowlog_files = 10
- long_query_time = 0.01
- log_queries_not_using_indexes = 1
- log_throttle_queries_not_using_indexes = 60
- min_examined_row_limit = 100
- log_slow_admin_statements = 1
- log_slow_replica_statements = 1
- log_slow_verbosity = FULL
- log_bin = /data/GreatSQL/binlog
- binlog_format = ROW
- sync_binlog = 1
- binlog_cache_size = 4M
- max_binlog_cache_size = 6G
- max_binlog_size = 1G
- # Control the total size of binlog to prevent disk space from being exhausted
- binlog_space_limit = 500G
- binlog_rows_query_log_events = 1
- binlog_expire_logs_seconds = 604800
- binlog_checksum = CRC32
- binlog_order_commits = OFF
- gtid_mode = ON
- enforce_gtid_consistency = TRUE
- #myisam settings
- key_buffer_size = 32M
- myisam_sort_buffer_size = 128M
- #replication settings
- relay_log_recovery = 1
- replica_parallel_type = LOGICAL_CLOCK
- # The number of parallel replication threads can be set to twice the number of logical CPUs
- replica_parallel_workers = 64
- binlog_transaction_dependency_tracking = WRITESET
- replica_preserve_commit_order = 1
- replica_checkpoint_period = 2
- # Enable InnoDB parallel query optimization feature
- loose-force_parallel_execute = OFF
- # Set the maximum concurrent degree of parallel query for each SQL statement
- loose-parallel_default_dop = 8
- # Set the total number of parallel query threads in the system, can be the same as the maximum logical CPU count
- loose-parallel_max_threads = 64
- # The maximum total memory size used by leader threads and worker threads when executing in parallel, can be set to about 5-10% of physical memory
- loose-parallel_memory_limit = 2G
- # Parallel load data
- loose-gdb_parallel_load_chunk_size = 4M
- #rapid engine
- loose-rapid_memory_limit = 12G
- loose-rapid_worker_threads = 32
- loose-secondary_engine_parallel_load_workers = 16
- #mgr settings
- loose-plugin_load_add = 'mysql_clone.so'
- loose-plugin_load_add = 'group_replication.so'
- loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"
- # MGR local node IP:PORT, please replace it yourself
- loose-group_replication_local_address = "172.16.16.10:33061"
- # MGR cluster all node IP:PORT, please replace it yourself
- loose-group_replication_group_seeds = '172.16.16.10:33061,172.16.16.12:33061,172.16.16.12:33061'
- loose-group_replication_start_on_boot = ON
- loose-group_replication_bootstrap_group = OFF
- loose-group_replication_exit_state_action = READ_ONLY
- loose-group_replication_flow_control_mode = "DISABLED"
- loose-group_replication_single_primary_mode = ON
- loose-group_replication_enforce_update_everywhere_checks=0
- loose-group_replication_majority_after_mode = ON
- loose-group_replication_communication_max_message_size = 10M
- loose-group_replication_arbitrator = 0
- loose-group_replication_single_primary_fast_mode = 1
- loose-group_replication_request_time_threshold = 100
- loose-group_replication_primary_election_mode = GTID_FIRST
- loose-group_replication_unreachable_majority_timeout = 0
- loose-group_replication_member_expel_timeout = 5
- loose-group_replication_autorejoin_tries = 288
- loose-group_replication_recovery_get_public_key = ON
- #mgr vip
- loose-plugin_load_add = 'greatdb_ha.so'
- loose-greatdb_ha_enable_mgr_vip = 0
- loose-greatdb_ha_mgr_vip_nic = 'eth0'
- loose-greatdb_ha_mgr_vip_ip = '172.16.16.252'
- loose-greatdb_ha_mgr_vip_mask = '255.255.255.0'
- loose-greatdb_ha_port = 33062
- loose-greatdb_ha_mgr_read_vip_ips = "172.16.16.251"
- #loose-greatdb_ha_mgr_read_vip_ips = "172.16.16.251,172.16.16.252"
- loose-greatdb_ha_mgr_read_vip_floating_type = "TO_ANOTHER_SECONDARY"
- loose-greatdb_ha_send_arp_packge_times = 5
- report_host = 172.16.16.10
- report_port = 3306
- # Does MGR switch to primary cause all application connections on the old primary node to be disconnected
- loose-greatdb_ha_mgr_exit_primary_kill_connection_mode = 0
- # InnoDB settings
- innodb_buffer_pool_size = 16G
- innodb_buffer_pool_instances = 8
- innodb_data_file_path = ibdata1:12M:autoextend
- innodb_flush_log_at_trx_commit = 1
- innodb_log_buffer_size = 64M
- innodb_log_file_size = 2G
- innodb_log_files_in_group = 3
- innodb_redo_log_capacity = 6G
- innodb_doublewrite_files = 2
- innodb_doublewrite_pages = 128
- innodb_max_undo_log_size = 4G
- # Adjust appropriately based on your server's IOPS capacity
- # For general SSDs, it can be adjusted to 10000 - 20000
- # For high-end PCIe SSD cards, it can be adjusted even higher, such as 50000 - 80000
- innodb_io_capacity = 10000
- innodb_io_capacity_max = 20000
- innodb_open_files = 65534
- # Reminder: When using the CLONE encryption feature, do not select the O_DIRECT mode, otherwise it will be slower
- innodb_flush_method = O_DIRECT
- innodb_use_fdatasync = ON
- innodb_lru_scan_depth = 4000
- innodb_lock_wait_timeout = 10
- innodb_rollback_on_timeout = 1
- innodb_print_all_deadlocks = 1
- innodb_online_alter_log_max_size = 4G
- innodb_print_ddl_logs = 1
- innodb_status_file = 1
- innodb_status_output = 0
- innodb_status_output_locks = 1
- innodb_sort_buffer_size = 64M
- innodb_adaptive_hash_index = 0
- innodb_numa_interleave = OFF
- innodb_spin_wait_delay = 20
- innodb_print_lock_wait_timeout_info = 1
- # Kill idle transactions after 5 minutes of inactivity to prevent row locks from being held for too long
- kill_idle_transaction = 300
- # Asynchronous cleanup of large tables
- innodb_data_file_async_purge = ON
- # innodb monitor settings
- # innodb_monitor_enable = "module_innodb,module_server,module_dml,module_ddl,module_trx,module_os,module_purge,module_log,module_lock,module_buffer,module_index,module_ibuf_system,module_buffer_page,module_adaptive_hash"
- #pfs settings
- performance_schema = 1
- #performance_schema_instrument = '%memory%=on'
- performance_schema_instrument = '%lock%=on'
复制代码 - (Wed Jul 23 10:47:43 2025)[root@GreatSQL][emanager]>SHOW PROCESSLIST;
- +--------+-----------------+-----------------+----------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
- | Id | User | Host | db | Command | Time | State | Info | Time_ms | Rows_sent | Rows_examined |
- +--------+-----------------+-----------------+----------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
- | 8 | event_scheduler | localhost | NULL | Daemon | 342697 | Waiting on empty queue | NULL | 342697368 | 0 | 0 |
- | 191 | root | 127.0.0.1:53984 | emanager | Sleep | 0 | | NULL | 239 | 0 | 0 |
- | 192 | root | 127.0.0.1:53986 | emanager | Sleep | 1 | | NULL | 1101 | 0 | 0 |
- | 193 | root | 127.0.0.1:53988 | emanager | Sleep | 1 | | NULL | 1101 | 0 | 0 |
- | 194 | root | 127.0.0.1:53990 | emanager | Sleep | 1 | | NULL | 1101 | 0 | 0 |
- | 195 | root | 127.0.0.1:53992 | emanager | Sleep | 1 | | NULL | 1101 | 0 | 0 |
- | 196 | root | 127.0.0.1:53994 | emanager | Sleep | 4 | | NULL | 4103 | 0 | 0 |
- | 197 | root | 127.0.0.1:53996 | emanager | Sleep | 4 | | NULL | 4103 | 0 | 0 |
- | 198 | root | 127.0.0.1:53998 | emanager | Sleep | 4 | | NULL | 4102 | 0 | 0 |
- | 199 | root | 127.0.0.1:54000 | emanager | Sleep | 21 | | NULL | 21558 | 0 | 0 |
- | 200 | root | 127.0.0.1:54002 | emanager | Sleep | 27 | | NULL | 27560 | 0 | 0 |
- | 201 | root | 127.0.0.1:54004 | emanager | Sleep | 27 | | NULL | 27560 | 0 | 0 |
- | 202 | root | 127.0.0.1:54006 | emanager | Sleep | 26 | | NULL | 26560 | 0 | 0 |
- | 203 | root | 127.0.0.1:54008 | emanager | Sleep | 26 | | NULL | 26559 | 0 | 0 |
- | 204 | root | 127.0.0.1:54010 | emanager | Sleep | 21 | | NULL | 21558 | 0 | 0 |
- | 205 | root | 127.0.0.1:54012 | emanager | Sleep | 21 | | NULL | 21558 | 0 | 0 |
- | 206 | root | 127.0.0.1:54014 | emanager | Sleep | 1 | | NULL | 1554 | 0 | 0 |
- | 582603 | root | localhost | emanager | Query | 0 | init | SHOW PROCESSLIST | 0 | 0 | 0 |
- +--------+-----------------+-----------------+----------+---------+--------+------------------------+------------------+-----------+-----------+---------------+
复制代码 - =====================================
- 2025-07-23 10:48:29 281437469798272 INNODB MONITOR OUTPUT
- =====================================
- Per second averages calculated from the last 11 seconds
- -----------------
- BACKGROUND THREAD
- -----------------
- srv_master_thread loops: 34 srv_active, 0 srv_shutdown, 342587 srv_idle
- srv_master_thread log flush and writes: 0
- ----------
- SEMAPHORES
- ----------
- OS WAIT ARRAY INFO: reservation count 54199
- OS WAIT ARRAY INFO: signal count 51620
- RW-shared spins 0, rounds 0, OS waits 0
- RW-excl spins 0, rounds 0, OS waits 0
- RW-sx spins 0, rounds 0, OS waits 0
- Spin rounds per wait: 0.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx
- ------------
- TRANSACTIONS
- ------------
- Trx id counter 2493962
- Purge done for trx's n:o < 2189577 undo n:o < 0 state: running but idle
- History list length 0
- LIST OF TRANSACTIONS FOR EACH SESSION:
- ---TRANSACTION 562932573418808, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573417960, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573417112, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573416264, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573415416, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573414568, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573413720, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573412872, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573412024, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573411176, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573410328, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573409480, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573408632, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573407784, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- ---TRANSACTION 562932573406936, not started
- 0 lock struct(s), heap size 1128, 0 row lock(s)
- --------
- FILE I/O
- --------
- I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
- I/O thread 1 state: waiting for completed aio requests (log thread)
- I/O thread 2 state: waiting for completed aio requests (read thread)
- I/O thread 3 state: waiting for completed aio requests (read thread)
- I/O thread 4 state: waiting for completed aio requests (read thread)
- I/O thread 5 state: waiting for completed aio requests (read thread)
- I/O thread 6 state: waiting for completed aio requests (write thread)
- I/O thread 7 state: waiting for completed aio requests (write thread)
- I/O thread 8 state: waiting for completed aio requests (write thread)
- I/O thread 9 state: waiting for completed aio requests (write thread)
- Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,
- ibuf aio reads:, log i/o's:
- Pending flushes (fsync) log: 0; buffer pool: 1
- 1152 OS file reads, 217860 OS file writes, 190132 OS fsyncs
- 0.00 reads/s, 0 avg bytes/read, 0.59 writes/s, 0.42 fsyncs/s
- -------------------------------------
- INSERT BUFFER AND ADAPTIVE HASH INDEX
- -------------------------------------
- Ibuf: size 1, free list len 0, seg size 2, 0 merges
- merged operations:
- insert 0, delete mark 0, delete 0
- discarded operations:
- insert 0, delete mark 0, delete 0
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- Hash table size 4425293, node heap has 0 buffer(s)
- 0.00 hash searches/s, 30.36 non-hash searches/s
- ---
- LOG
- ---
- Log sequence number 54810849
- Log buffer assigned up to 54810849
- Log buffer completed up to 54810849
- Log written up to 54810849
- Log flushed up to 54810849
- Added dirty pages up to 54810849
- Pages flushed up to 54810849
- Last checkpoint at 54810849
- Log minimum file id is 0
- Log maximum file id is 0
- Modified age no less than 54810849
- Checkpoint age 0
- Max checkpoint age 5422668288
- 97335 log i/o's done, 0.33 log i/o's/second
- ----------------------
- BUFFER POOL AND MEMORY
- ----------------------
- Total large memory allocated 0
- Dictionary memory allocated 2352624
- Buffer pool size 1048448
- Buffer pool size, bytes 17177772032
- Free buffers 1046265
- Database pages 2183
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 1126, created 1057, written 41336
- 0.00 reads/s, 0.00 creates/s, 0.08 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 2183, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ----------------------
- INDIVIDUAL BUFFER POOL INFO
- ----------------------
- ---BUFFER POOL 0
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130689
- Database pages 367
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 160, created 207, written 296
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 367, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 1
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130924
- Database pages 132
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 63, created 69, written 138
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- No buffer pool page gets since the last printout
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 132, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 2
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130928
- Database pages 128
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 64, created 64, written 150
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 128, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 3
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130728
- Database pages 328
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 201, created 127, written 39573
- 0.00 reads/s, 0.00 creates/s, 0.08 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 328, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 4
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130853
- Database pages 203
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 107, created 96, written 217
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 203, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 5
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130880
- Database pages 176
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 55, created 121, written 142
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 176, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 6
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130681
- Database pages 375
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 137, created 238, written 369
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 375, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- ---BUFFER POOL 7
- Buffer pool size 131056
- Buffer pool size, bytes 2147221504
- Free buffers 130582
- Database pages 474
- Old database pages 0
- Modified db pages 0
- Pending reads 0
- Pending writes: LRU 0, flush list 0, single page 0
- Pages made young 0, not young 0
- 0.00 youngs/s, 0.00 non-youngs/s
- Pages read 339, created 135, written 451
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- No buffer pool page gets since the last printout
- Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
- LRU len: 474, unzip_LRU len: 0
- I/O sum[0]:cur[0], unzip sum[0]:cur[0]
- --------------
- ROW OPERATIONS
- --------------
- 0 queries inside InnoDB, 0 queries in queue
- 0 read views open inside InnoDB
- 0 RW transactions active inside InnoDB
- Process ID=67772, Main thread ID=281438322487168 , state=sleeping
- Number of rows inserted 1467, updated 176, deleted 1, read 2745341
- 0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 7.27 reads/s
- Number of system rows inserted 7819, updated 4459, deleted 3316, read 50910
- 0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
- ----------------------------
- END OF INNODB MONITOR OUTPUT
- ============================
复制代码 |