GreatSQL社区

搜索

[已解决] 查询僵死,无法kill掉

2954 5 2022-8-30 10:47
操作系统:麒麟V10
数据库版本:greatesql 8.0.25-16
配置:16c32g
无法kill掉运行过久的id,如图,并上传pstack的log,如附件。

1.jpg
2.jpg

pstack.zip

13.34 KB, 下载次数: 1, 下载积分: 金币 -1

全部回复(5)
yejr 2022-8-30 11:00:30
select * from performance_schema.threads;
也提供下
beckhann 2022-8-30 11:10:19
yejr 发表于 2022-8-30 11:00
select * from performance_schema.threads;
也提供下

threads如附件。

threads.zip

3.04 KB, 下载次数: 3, 下载积分: 金币 -1

yejr 2022-8-30 11:19:18

麻烦再提供2个信息(用文本方式,别压缩了)
1. my.cnf配置内容
2. 无法killed的两个select count... SQL的执行计划
beckhann 2022-8-30 11:38:51
yejr 发表于 2022-8-30 11:19
麻烦再提供2个信息(用文本方式,别压缩了)
1. my.cnf配置内容
2. 无法killed的两个select count... SQL ...
  1. mysql> explain SELECT COUNT(1) FROM t_irs_busi_notice WHERE status = '1' AND send_type = 'wxwork' AND user_code = '8001449' AND notice_status = 'finish' AND send_time >= date_sub(NOW(), INTERVAL 1 * 30 DAY);
  2. +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+----------+-------------+
  3. | id | select_type | table             | partitions | type | possible_keys | key  | key_len | ref  | rows  | filtered | Extra       |
  4. +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+----------+-------------+
  5. |  1 | SIMPLE      | t_irs_busi_notice | NULL       | ALL  | NULL          | NULL | NULL    | NULL | 29144 |     0.00 | Using where |
  6. +----+-------------+-------------------+------------+------+---------------+------+---------+------+-------+----------+-------------+
  7. 1 row in set, 1 warning (0.00 sec)
复制代码
  1. [root@ mysql3306]# cat my3306.cnf
  2. # my.cnf example for GreatSQL
  3. # last update, 2021/8/20
  4. #
  5. # 下面参数选项设置仅作为参考,且假设服务器可用内存为256G
  6. #
  7. [client]
  8. socket    = /data/greatsql/mysql3306/data/mysql3306.sock
  9. [mysql]
  10. loose-skip-binary-as-hex
  11. prompt="(\\D)[\\u@GreatSQL][\\d]>"
  12. no-auto-rehash
  13. [mysqld]
  14. user    = mysql
  15. port    = 3306
  16. server_id = 273306
  17. basedir = /u01/mysql/GreatSQL-8.0.25-16-Linux-glibc2.28-x86_64
  18. datadir    = /data/greatsql/mysql3306/data
  19. socket    = /data/greatsql/mysql3306/data/mysql3306.sock
  20. pid-file = mysql.pid
  21. character-set-server = UTF8MB4
  22. lower_case_table_names = 1
  23. skip_name_resolve = 1
  24. #若你的MySQL数据库主要运行在境外,请务必根据实际情况调整本参数
  25. default_time_zone = "+8:00"
  26. default-authentication-plugin=mysql_native_password

  27. #performance setttings
  28. lock_wait_timeout = 3600
  29. open_files_limit    = 65535
  30. back_log = 1024
  31. max_connections = 2048
  32. max_connect_errors = 1000000
  33. table_open_cache = 2048
  34. table_definition_cache = 2048
  35. thread_stack = 512K
  36. sort_buffer_size = 4M
  37. join_buffer_size = 4M
  38. read_buffer_size = 8M
  39. read_rnd_buffer_size = 4M
  40. bulk_insert_buffer_size = 64M
  41. thread_cache_size = 768
  42. interactive_timeout = 600
  43. wait_timeout = 600
  44. tmp_table_size = 96M
  45. max_heap_table_size = 96M

  46. #log settings
  47. log_timestamps = SYSTEM
  48. log_error = /data/greatsql/mysql3306/logs/error.log
  49. log_error_verbosity = 3
  50. slow_query_log = 1
  51. log_slow_extra = 1
  52. slow_query_log_file = /data/greatsql/mysql3306/logs/slow.log
  53. long_query_time = 10
  54. log_queries_not_using_indexes = 1
  55. log_throttle_queries_not_using_indexes = 60
  56. min_examined_row_limit = 0
  57. log_slow_admin_statements = 1
  58. log_slow_slave_statements = 1
  59. log_slow_verbosity = FULL
  60. log_bin = /data/greatsql/mysql3306/logs/binlog
  61. binlog_format = ROW
  62. sync_binlog = 1
  63. binlog_cache_size = 4M
  64. max_binlog_cache_size = 4G
  65. max_binlog_size = 2G
  66. binlog_rows_query_log_events = 1
  67. binlog_expire_logs_seconds = 604800
  68. binlog_checksum = CRC32
  69. gtid_mode = ON
  70. enforce_gtid_consistency = TRUE

  71. #myisam settings
  72. key_buffer_size = 32M
  73. myisam_sort_buffer_size = 128M

  74. #replication settings
  75. relay_log_recovery = 1
  76. slave_parallel_type = LOGICAL_CLOCK
  77. #并行复制线程数可以设置为逻辑CPU数量的2倍
  78. slave_parallel_workers = 32
  79. binlog_transaction_dependency_tracking = WRITESET
  80. slave_preserve_commit_order = 1
  81. slave_checkpoint_period = 2

  82. #启用InnoDB并行查询优化功能
  83. loose-force_parallel_execute = ON
  84. #设置每个SQL语句的并行查询最大并发度
  85. loose-parallel_default_dop = 8
  86. #设置系统中总的并行查询线程数,可以和最大逻辑CPU数量一样
  87. loose-parallel_max_threads = 16
  88. #并行执行时leader线程和worker线程使用的总内存大小上限,可以设置物理内存的5-10%左右
  89. loose-parallel_memory_limit = 2G

  90. #mgr settings
  91. loose-plugin_load_add = 'mysql_clone.so'
  92. loose-plugin_load_add = 'group_replication.so'
  93. loose-group_replication_group_name = "f760789f-d037-11ec-8ecf-005056a31010"
  94. #MGR本地节点IP:PORT,请自行替换
  95. loose-group_replication_local_address = "192.168.100.35:33061"
  96. #MGR集群所有节点IP:PORT,请自行替换
  97. loose-group_replication_group_seeds = '192.168.100.35:33061,192.168.100.29:33061,192.168.100.33:33061'
  98. loose-group_replication_start_on_boot = OFF
  99. loose-group_replication_bootstrap_group = OFF
  100. loose-group_replication_exit_state_action = READ_ONLY
  101. loose-group_replication_flow_control_mode = "DISABLED"
  102. loose-group_replication_single_primary_mode = ON
  103. loose-group_replication_majority_after_mode = ON
  104. loose-group_replication_communication_max_message_size = 10M
  105. loose-group_replication_arbitrator = 0
  106. loose-group_replication_single_primary_fast_mode = 1
  107. loose-group_replication_request_time_threshold = 100
  108. loose-group_replication_primary_election_mode = GTID_FIRST
  109. loose-group_replication_unreachable_majority_timeout = 30
  110. loose-group_replication_member_expel_timeout = 5
  111. loose-group_replication_autorejoin_tries = 288
  112. report_host = "192.168.100.35"

  113. #innodb settings
  114. innodb_buffer_pool_size = 20G
  115. innodb_buffer_pool_instances = 8
  116. innodb_data_file_path = ibdata1:12M:autoextend
  117. innodb_flush_log_at_trx_commit = 1
  118. innodb_log_buffer_size = 32M
  119. innodb_log_file_size = 2G
  120. innodb_log_files_in_group = 4
  121. innodb_doublewrite_files = 2
  122. innodb_max_undo_log_size = 4G
  123. # 根据您的服务器IOPS能力适当调整
  124. # 一般配普通SSD盘的话,可以调整到 10000 - 20000
  125. # 配置高端PCIe SSD卡的话,则可以调整的更高,比如 50000 - 80000
  126. innodb_io_capacity = 4000
  127. innodb_io_capacity_max = 8000
  128. innodb_open_files = 65534
  129. innodb_flush_method = O_DIRECT
  130. innodb_lru_scan_depth = 4000
  131. innodb_lock_wait_timeout = 10
  132. innodb_rollback_on_timeout = 1
  133. innodb_print_all_deadlocks = 1
  134. innodb_online_alter_log_max_size = 4G
  135. innodb_print_ddl_logs = 1
  136. innodb_status_file = 1
  137. innodb_status_output = 0
  138. innodb_status_output_locks = 1
  139. innodb_sort_buffer_size = 64M

  140. #innodb monitor settings
  141. innodb_monitor_enable = "module_innodb"
  142. innodb_monitor_enable = "module_server"
  143. innodb_monitor_enable = "module_dml"
  144. innodb_monitor_enable = "module_ddl"
  145. innodb_monitor_enable = "module_trx"
  146. innodb_monitor_enable = "module_os"
  147. innodb_monitor_enable = "module_purge"
  148. innodb_monitor_enable = "module_log"
  149. innodb_monitor_enable = "module_lock"
  150. innodb_monitor_enable = "module_buffer"
  151. innodb_monitor_enable = "module_index"
  152. innodb_monitor_enable = "module_ibuf_system"
  153. innodb_monitor_enable = "module_buffer_page"
  154. innodb_monitor_enable = "module_adaptive_hash"

  155. #pfs settings
  156. performance_schema = 1
  157. #performance_schema_instrument = '%memory%=on'
  158. performance_schema_instrument = '%lock%=on'
复制代码

yejr 2022-8-30 11:53:47

收到,我先分析下,有结果再回复
beckhann

2

主题

0

博客

10

贡献

新手上路

Rank: 1

积分
15

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-21 21:13 , Processed in 0.021688 second(s), 16 queries , Redis On.
快速回复 返回顶部 返回列表