magento mysql悬挂

of1yzvn4  于 2021-06-21  发布在  Mysql
关注(0)|答案(6)|浏览(578)

我在网上搜索了很多地方,找到了一些关于magento安装数据库问题的答案。
这个网站在这样的时刻是不可用的(大多数时间持续大约15分钟,并自行解决),而不是前端和后端。我尝试过mysql的各种调整脚本,将索引设置为手动,将数据库移动到专用服务器,等等。ubuntu操作系统的日志和magento日志都显示了任何不寻常的错误消息。针对ddos安装fail2ban。
mysql进程正在使用或使用100%以上的百分比或使用0.0%的百分比(!!!)但整个服务器似乎都冻结了。有时,即使是我用putty/ssh输入的字符,在服务器恢复自身之前也不会显示出来。
专用数据库服务器有32gbram,mysql使用25g左右。
顶部:840 mysql 20 0 25640g 0011t 6632 s 26,2 34,2 270:08.31 mysqld
设置my.cnf:

  1. [mysqld]
  2. key_buffer = 512M
  3. max_allowed_packet = 64M
  4. thread_stack = 512K
  5. thread_cache_size = 512
  6. sort_buffer_size = 24M
  7. read_buffer_size = 8M
  8. read_rnd_buffer_size = 24M
  9. join_buffer_size = 128M
  10. max_connections = 1024
  11. concurrent_insert = 2
  12. connect_timeout = 5
  13. table_open_cache = 12288
  14. tmp_table_size = 512M
  15. max_heap_table_size = 512M
  16. bulk_insert_buffer_size = 512M
  17. open-files-limit = 8192
  18. open-files = 1024
  19. query_cache_type=1
  20. query_cache_limit = 4M
  21. query_cache_size = 512M
  22. slow_query_log_file = /var/log/mysql/slow.log
  23. slow_query_log = 0
  24. long_query_time = 0.2
  25. expire_logs_days = 10
  26. max_binlog_size = 1024M
  27. binlog_cache_size = 32K
  28. innodb_thread_concurrency = 16
  29. innodb_commit_concurrency = 2
  30. innodb_buffer_pool_size = 16G
  31. innodb_log_file_size = 512M
  32. innodb_additional_mem_pool_size = 8M
  33. # innodb_data_file_path = ibdata1:1024M:autoextend
  34. innodb_file_per_table
  35. innodb_flush_log_at_trx_commit = 2
  36. innodb_log_buffer_size = 2G

显示完整进程列表的输出:

  1. | Id | User | Host | db | Command | Time | State | Info |
  2. ++
  3. | 76636 | juwelierwebshop | ...:40316 | juwelierwebshop | Query | 328 | query end | INSERT INTO abctools_merkgevuld (sku) VALUES ('JUPA22655') |
  4. | 76638 | juwelierwebshop | ...:40344 | juwelierwebshop | Sleep | 328 | | NULL |
  5. | 76642 | juwelierwebshop | ...:40484 | juwelierwebshop | Query | 54 | query end | SELECT `main_table`.* FROM `bolconnect_items_be` AS `main_table` WHERE (product_id = '62622') |
  6. | 76695 | juwelierwebshop | ...:54112 | juwelierwebshop | Sleep | 603 | | NULL |
  7. | 76696 | juwelierwebshop | ...:54126 | juwelierwebshop | Query | 54 | update | INSERT INTO `bolconnect_offerlist` (`ean`, `prijs`, `leverancier`, `sellerid`, `sellerrating`, `avdesc`, `koopbox`, `updated_at`) VALUES ('8718834545421', '619', 'abc', '1121928', '8.8', '5 - 7 dagen', '1', '2018-09-07 12:10:10') |
  8. | 77039 | juwelierwebshop | ...:40290 | juwelierwebshop | Query | 54 | Sending data | INSERT INTO `sales_flat_order_grid` (`entity_id`, `status`, `store_id`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `store_name`, `created_at`, `updated_at`, `billing_name`, `shipping_name`) SELECT `main_table`.`entity_id`, `main_table`.`status`, `main_table`.`store_id`, `main_table`.`customer_id`, `main_table`.`base_grand_total`, `main_table`.`base_total_paid`, `main_table`.`grand_total`, `main_table`.`total_paid`, `main_table`.`increment_id`, `main_table`.`base_currency_code`, `main_table`.`order_currency_code`, `main_table`.`store_name`, `main_table`.`created_at`, `main_table`.`updated_at`, CONCAT(IFNULL(table_billing_name.firstname, ''), ' ', IFNULL(table_billing_name.lastname, '')) AS `billing_name`, CONCAT(IFNULL(table_shipping_name.firstname, ''), ' ', IFNULL(table_shipping_name.lastname, '')) AS `shipping_name` FROM `sales_flat_order` AS `main_table`
  9. LEFT JOIN `sales_flat_order_address` AS `table_billing_name` ON `main_table`.`billing_address_id`=`table_billing_name`.`entity_id`
  10. LEFT JOIN `sales_flat_order_address` AS `table_shipping_name` ON `main_table`.`shipping_address_id`=`table_shipping_name`.`entity_id` WHERE (main_table.entity_id IN('27894')) ON DUPLICATE KEY UPDATE `entity_id` = VALUES(`entity_id`), `status` = VALUES(`status`), `store_id` = VALUES(`store_id`), `customer_id` = VALUES(`customer_id`), `base_grand_total` = VALUES(`base_grand_total`), `base_total_paid` = VALUES(`base_total_paid`), `grand_total` = VALUES(`grand_total`), `total_paid` = VALUES(`total_paid`), `increment_id` = VALUES(`increment_id`), `base_currency_code` = VALUES(`base_currency_code`), `order_currency_code` = VALUES(`order_currency_code`), `store_name` = VALUES(`store_name`), `created_at` = VALUES(`created_at`), `updated_at` = VALUES(`updated_at`), `billing_name` = VALUES(`billing_name`), `shipping_name` = VALUES(`shipping_name`) |
  11. | 77041 | juwelierwebshop | ...:40578 | juwelierwebshop | Query | 54 | statistics | SELECT `catalog_product_entity`.* FROM `catalog_product_entity` WHERE (entity_id ='45702') |
  12. | 77042 | juwelierwebshop | ...:40766 | juwelierwebshop | Query | 54 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_2` AS `e`
  13. INNER JOIN `report_viewed_product_index` AS `idx_table` ON (idx_table.product_id=e.entity_id) AND (idx_table.visitor_id = '')
  14. INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=2 AND cat_index.category_id = '2'
  15. LEFT JOIN `core_store` AS `store_index` ON store_index.store_id = idx_table.store_id
  16. LEFT JOIN `core_store_group` AS `store_group_index` ON store_index.group_id = store_group_index.group_id
  17. LEFT JOIN `catalog_category_product_index` AS `store_cat_index` ON store_cat_index.product_id = e.entity_id AND store_cat_index.store_id = idx_table.store_id AND store_cat_index.category_id=store_group_index.root_category_id WHERE (cat_index.visibility IN(3, 2, 4) OR store_cat_index.visibility IN(3, 2, 4)) |
  18. | 77043 | juwelierwebshop | ...:40930 | juwelierwebshop | Query | 54 | statistics | SELECT `catalog_category_entity`.* FROM `catalog_category_entity` WHERE (entity_id ='37') |
  19. | 77047 | juwelierwebshop | ...:42478 | juwelierwebshop | Query | 53 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
  20. INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 0)
  21. INNER JOIN `catalog_product_entity_int` AS `at_visibility` ON (`at_visibility`.`entity_id` = `e`.`entity_id`) AND (`at_visibility`.`attribute_id` = '102') AND (`at_visibility`.`store_id` = 0)
  22. INNER JOIN `catalog_product_entity_varchar` AS `at_name` ON (`at_name`.`entity_id` = `e`.`entity_id`) AND (`at_name`.`attribute_id` = '71') AND (`at_name`.`store_id` = 0) WHERE (at_name.value LIKE '%BUDDHA TO BUDDHA 811 SIGNIFY CORD BRACELET BROWN%') |
  23. | 77050 | juwelierwebshop | ...:43538 | juwelierwebshop | Query | 54 | updating | UPDATE `sales_flat_quote_address` SET `quote_id` = '62660', `created_at` = '2018-09-02 19:38:03', `updated_at` = '2018-09-07 12:10:10', `customer_id` = '22445', `save_in_address_book` = '0', `customer_address_id` = '45277', `address_type` = 'billing', `email` = 'abc@email.nl', `prefix` = NULL, `firstname` = 'Pieter', `middlename` = NULL, `lastname` = 'Slits', `suffix` = NULL, `company` = NULL, `street` = 'Steurgat\n92', `city` = 'Gorinchem', `region` = 'Zuid-Holland', `region_id` = NULL, `postcode` = '4208BL', `country_id` = 'NL', `telephone` = '0621263156', `fax` = NULL, `same_as_billing` = '0', `free_shipping` = '0', `collect_shipping_rates` = '0', `shipping_method` = NULL, `shipping_description` = NULL, `weight` = '0', `subtotal` = '0', `base_subtotal` = '0', `subtotal_with_discount` = '0', `base_subtotal_with_discount` = '0', `tax_amount` = '0', `base_tax_amount` = '0', `shipping_amount` = '0', `base_shipping_amount` = '0', `shipping_tax_amount` = '0', `base_shipping_tax_amount` = '0', `discount_amount` = '0', `base_discount_amount` = '0', `grand_total` = '0', `base_grand_total` = '0', `customer_notes` = NULL, `applied_taxes` = 'a:0:{}', `discount_description` = NULL, `shipping_discount_amount` = NULL, `base_shipping_discount_amount` = NULL, `subtotal_incl_tax` = '0', `base_subtotal_total_incl_tax` = NULL, `hidden_tax_amount` = NULL, `base_hidden_tax_amount` = NULL, `shipping_hidden_tax_amount` = NULL, `base_shipping_hidden_tax_amnt` = NULL, `shipping_incl_tax` = '0', `base_shipping_incl_tax` = '0', `vat_id` = NULL, `vat_is_valid` = NULL, `vat_request_id` = NULL, `vat_request_date` = NULL, `vat_request_success` = NULL, `gift_message_id` = NULL, `kp_id` = NULL, `payment_fee` = '0', `base_payment_fee` = '0', `payment_fee_tax` = '0', `base_payment_fee_tax` = '0' WHERE (address_id='121757') |
  24. | 77052 | juwelierwebshop | ...:43840 | juwelierwebshop | Query | 54 | init | commit |
  25. | 77053 | juwelierwebshop | ...:44590 | juwelierwebshop | Query | 204 | removing tmp table | SELECT `customer_address_entity_varchar`.`entity_id`, `customer_address_entity_varchar`.`attribute_id`, `customer_address_entity_varchar`.`value` FROM `customer_address_entity_varchar` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('26', '24', '27', '32', '20', '22', '21', '30', '19', '28', '23', '31', '36', '39', '38')) UNION ALL SELECT `customer_address_entity_int`.`entity_id`, `customer_address_entity_int`.`attribute_id`, `customer_address_entity_int`.`value` FROM `customer_address_entity_int` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('29', '37', '40')) UNION ALL SELECT `customer_address_entity_text`.`entity_id`, `customer_address_entity_text`.`attribute_id`, `customer_address_entity_text`.`value` FROM `customer_address_entity_text` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('25')) |
  26. | 77055 | juwelierwebshop | ...:44704 | juwelierwebshop | Query | 203 | Opening tables | SELECT `customer_address_entity_varchar`.`entity_id`, `customer_address_entity_varchar`.`attribute_id`, `customer_address_entity_varchar`.`value` FROM `customer_address_entity_varchar` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('26', '24', '27', '32', '20', '22', '21', '30', '19', '28', '23', '31', '36', '39', '38')) UNION ALL SELECT `customer_address_entity_int`.`entity_id`, `customer_address_entity_int`.`attribute_id`, `customer_address_entity_int`.`value` FROM `customer_address_entity_int` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('29', '37', '40')) UNION ALL SELECT `customer_address_entity_text`.`entity_id`, `customer_address_entity_text`.`attribute_id`, `customer_address_entity_text`.`value` FROM `customer_address_entity_text` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('25')) |
  27. | 77056 | juwelierwebshop | ...:44950 | juwelierwebshop | Query | 199 | Opening tables | SELECT `customer_address_entity_varchar`.`entity_id`, `customer_address_entity_varchar`.`attribute_id`, `customer_address_entity_varchar`.`value` FROM `customer_address_entity_varchar` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('26', '24', '27', '32', '20', '22', '21', '30', '19', '28', '23', '31', '36', '39', '38')) UNION ALL SELECT `customer_address_entity_int`.`entity_id`, `customer_address_entity_int`.`attribute_id`, `customer_address_entity_int`.`value` FROM `customer_address_entity_int` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('29', '37', '40')) UNION ALL SELECT `customer_address_entity_text`.`entity_id`, `customer_address_entity_text`.`attribute_id`, `customer_address_entity_text`.`value` FROM `customer_address_entity_text` WHERE (entity_type_id =2) AND (entity_id IN (45277)) AND (attribute_id IN ('25')) |
  28. | 77058 | juwelierwebshop | ...:45508 | juwelierwebshop | Query | 54 | Sending data | SELECT `catalog_product_website`.`website_id` FROM `catalog_product_website` WHERE (product_id = 16722) |
  29. | 77063 | juwelierwebshop | ...:45836 | juwelierwebshop | Query | 54 | update | INSERT INTO `sales_flat_quote_address` (`quote_id`, `created_at`, `updated_at`, `customer_id`, `address_type`, `city`, `region`, `region_id`, `postcode`, `country_id`, `same_as_billing`, `collect_shipping_rates`, `shipping_method`, `shipping_description`, `shipping_amount`, `base_shipping_amount`) VALUES ('65679', '2018-09-07 12:10:10', '2018-09-07 12:10:10', NULL, 'shipping', NULL, NULL, '0', NULL, 'NL', '1', '1', 'flatrate_flatrate', NULL, '0', '0') |
  30. | 77067 | juwelierwebshop | ...:46232 | juwelierwebshop | Query | 229 | update | INSERT INTO `sales_flat_quote` (`store_id`, `created_at`, `updated_at`, `store_to_base_rate`, `store_to_quote_rate`, `base_currency_code`, `store_currency_code`, `quote_currency_code`, `remote_ip`, `global_currency_code`, `base_to_global_rate`, `base_to_quote_rate`, `is_changed`, `allow_alerts`) VALUES ('2', '2018-09-07 12:07:15', '2018-09-07 12:07:15', '1', '1', 'EUR', 'EUR', 'EUR', '81.169.242.132', 'EUR', '1', '1', '1', '1') |
  31. | 77069 | juwelierwebshop | ...:46678 | juwelierwebshop | Query | 222 | query end | SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_category_entity_varchar` AS `t_d`
  32. LEFT JOIN `catalog_category_entity_varchar` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 3) AND (t_d.entity_id IN (260)) AND (t_d.attribute_id IN ('41')) AND (t_d.store_id = 0) |
  33. | 77074 | juwelierwebshop | ...:46984 | juwelierwebshop | Query | 216 | query end | SELECT `e`.*, IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) AS `is_active` FROM `catalog_category_entity` AS `e`
  34. INNER JOIN `catalog_category_entity_int` AS `at_is_active_default` ON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = '42') AND `at_is_active_default`.`store_id` = 0
  35. LEFT JOIN `catalog_category_entity_int` AS `at_is_active` ON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = '42') AND (`at_is_active`.`store_id` = 2) WHERE (`e`.`entity_type_id` = '3') AND (`e`.`entity_id` IN('365')) AND (IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) = '1') |
  36. | 77076 | juwelierwebshop | ...:47082 | juwelierwebshop | Query | 214 | query end | SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_category_entity_varchar` AS `t_d`
  37. LEFT JOIN `catalog_category_entity_varchar` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 3) AND (t_d.entity_id IN (187)) AND (t_d.attribute_id IN ('41')) AND (t_d.store_id = 0)

.. 还有更多
输出ulimit-a:

  1. core file size (blocks, -c) 0
  2. data seg size (kbytes, -d) unlimited
  3. scheduling priority (-e) 0
  4. file size (blocks, -f) unlimited
  5. pending signals (-i) 1030957
  6. max locked memory (kbytes, -l) 64
  7. max memory size (kbytes, -m) unlimited
  8. open files (-n) 1024
  9. pipe size (512 bytes, -p) 8
  10. POSIX message queues (bytes, -q) 819200
  11. real-time priority (-r) 0
  12. stack size (kbytes, -s) 10240
  13. cpu time (seconds, -t) unlimited
  14. max user processes (-u) 1030957
  15. virtual memory (kbytes, -v) unlimited
  16. file locks (-x) unlimited
kmbjn2e3

kmbjn2e31#

只要我的帖子太长,我会在这里发布附加信息。。。
显示全局状态:

  1. Aborted_clients
  2. 146
  3. Aborted_connects
  4. 286
  5. Binlog_cache_disk_use
  6. 0
  7. Binlog_cache_use
  8. 0
  9. Binlog_stmt_cache_disk_use
  10. 0
  11. Binlog_stmt_cache_use
  12. 0
  13. Bytes_received
  14. 262381827589
  15. Bytes_sent
  16. 934591758226
  17. Com_admin_commands
  18. 13
  19. Com_assign_to_keycache
  20. 0
  21. Com_alter_db
  22. 0
  23. Com_alter_db_upgrade
  24. 0
  25. Com_alter_event
  26. 0
  27. Com_alter_function
  28. 0
  29. Com_alter_procedure
  30. 0
  31. Com_alter_server
  32. 0
  33. Com_alter_table
  34. 0
  35. Com_alter_tablespace
  36. 0
  37. Com_alter_user
  38. 0
  39. Com_analyze
  40. 0
  41. Com_begin
  42. 21257645
  43. Com_binlog
  44. 0
  45. Com_call_procedure
  46. 0
  47. Com_change_db
  48. 303
  49. Com_change_master
  50. 0
  51. Com_check
  52. 0
  53. Com_checksum
  54. 0
  55. Com_commit
  56. 21257476
  57. Com_create_db
  58. 0
  59. Com_create_event
  60. 0
  61. Com_create_function
  62. 0
  63. Com_create_index
  64. 0
  65. Com_create_procedure
  66. 0
  67. Com_create_server
  68. 0
  69. Com_create_table
  70. 1981
  71. Com_create_trigger
  72. 0
  73. Com_create_udf
  74. 0
  75. Com_create_user
  76. 0
  77. Com_create_view
  78. 0
  79. Com_dealloc_sql
  80. 0
  81. Com_delete
  82. 8394541
  83. Com_delete_multi
  84. 63886
  85. Com_do
  86. 0
  87. Com_drop_db
  88. 0
  89. Com_drop_event
  90. 0
  91. Com_drop_function
  92. 0
  93. Com_drop_index
  94. 0
  95. Com_drop_procedure
  96. 0
  97. Com_drop_server
  98. 0
  99. Com_drop_table
  100. 1980
  101. Com_drop_trigger
  102. 0
  103. Com_drop_user
  104. 0
  105. Com_drop_view
  106. 0
  107. Com_empty_query
  108. 0
  109. Com_execute_sql
  110. 0
  111. Com_flush
  112. 11
  113. Com_get_diagnostics
  114. 0
  115. Com_grant
  116. 0
  117. Com_ha_close
  118. 0
  119. Com_ha_open
  120. 0
  121. Com_ha_read
  122. 0
  123. Com_help
  124. 0
  125. Com_insert
  126. 11568107
  127. Com_insert_select
  128. 1143891
  129. Com_install_plugin
  130. 0
  131. Com_kill
  132. 0
  133. Com_load
  134. 0
  135. Com_lock_tables
  136. 0
  137. Com_optimize
  138. 0
  139. Com_preload_keys
  140. 0
  141. Com_prepare_sql
  142. 0
  143. Com_purge
  144. 0
  145. Com_purge_before_date
  146. 0
  147. Com_release_savepoint
  148. 0
  149. Com_rename_table
  150. 0
  151. Com_rename_user
  152. 0
  153. Com_repair
  154. 0
  155. Com_replace
  156. 12
  157. Com_replace_select
  158. 0
  159. Com_reset
  160. 0
  161. Com_resignal
  162. 0
  163. Com_revoke
  164. 0
  165. Com_revoke_all
  166. 0
  167. Com_rollback
  168. 151
  169. Com_rollback_to_savepoint
  170. 0
  171. Com_savepoint
  172. 0
  173. Com_select
  174. 450132043
  175. Com_set_option
  176. 2690585
  177. Com_signal
  178. 0
  179. Com_show_binlog_events
  180. 0
  181. Com_show_binlogs
  182. 10
  183. Com_show_charsets
  184. 0
  185. Com_show_collations
  186. 0
  187. Com_show_create_db
  188. 0
  189. Com_show_create_event
  190. 0
  191. Com_show_create_func
  192. 0
  193. Com_show_create_proc
  194. 0
  195. Com_show_create_table
  196. 38
  197. Com_show_create_trigger
  198. 0
  199. Com_show_databases
  200. 0
  201. Variable_name
  202. Value
  203. Com_show_engine_logs
  204. 0
  205. Com_show_engine_mutex
  206. 0
  207. Com_show_engine_status
  208. 0
  209. Com_show_events
  210. 0
  211. Com_show_errors
  212. 0
  213. Com_show_fields
  214. 18447
  215. Com_show_function_code
  216. 0
  217. Com_show_function_status
  218. 0
  219. Com_show_grants
  220. 17
  221. Com_show_keys
  222. 9599
  223. Com_show_master_status
  224. 26
  225. Com_show_open_tables
  226. 0
  227. Com_show_plugins
  228. 3
  229. Com_show_privileges
  230. 0
  231. Com_show_procedure_code
  232. 0
  233. Com_show_procedure_status
  234. 0
  235. Com_show_processlist
  236. 0
  237. Com_show_profile
  238. 0
  239. Com_show_profiles
  240. 0
  241. Com_show_relaylog_events
  242. 0
  243. Com_show_slave_hosts
  244. 0
  245. Com_show_slave_status
  246. 26
  247. Com_show_status
  248. 3
  249. Com_show_storage_engines
  250. 1
  251. Com_show_table_status
  252. 20700
  253. Com_show_tables
  254. 236
  255. Com_show_triggers
  256. 0
  257. Com_show_variables
  258. 193
  259. Com_show_warnings
  260. 56103
  261. Com_slave_start
  262. 0
  263. Com_slave_stop
  264. 0
  265. Com_stmt_close
  266. 0
  267. Com_stmt_execute
  268. 0
  269. Com_stmt_fetch
  270. 0
  271. Com_stmt_prepare
  272. 0
  273. Com_stmt_reprepare
  274. 0
  275. Com_stmt_reset
  276. 0
  277. Com_stmt_send_long_data
  278. 0
  279. Com_truncate
  280. 379
  281. Com_uninstall_plugin
  282. 0
  283. Com_unlock_tables
  284. 0
  285. Com_update
  286. 13681401
  287. Com_update_multi
  288. 38290135
  289. Com_xa_commit
  290. 0
  291. Com_xa_end
  292. 0
  293. Com_xa_prepare
  294. 0
  295. Com_xa_recover
  296. 0
  297. Com_xa_rollback
  298. 0
  299. Com_xa_start
  300. 0
  301. Compression
  302. OFF
  303. Connection_errors_accept
  304. 0
  305. Connection_errors_internal
  306. 0
  307. Connection_errors_max_connections
  308. 0
  309. Connection_errors_peer_address
  310. 0
  311. Connection_errors_select
  312. 0
  313. Connection_errors_tcpwrap
  314. 0
  315. Connections
  316. 1754922
  317. Created_tmp_disk_tables
  318. 32299788
  319. Created_tmp_files
  320. 2827
  321. Created_tmp_tables
  322. 67858347
  323. Delayed_errors
  324. 0
  325. Delayed_insert_threads
  326. 0
  327. Delayed_writes
  328. 0
  329. Flush_commands
  330. 1
  331. Handler_commit
  332. 537556955
  333. Handler_delete
  334. 21203603
  335. Handler_discover
  336. 0
  337. Handler_external_lock
  338. 2080617356
  339. Handler_mrr_init
  340. 0
  341. Handler_prepare
  342. 0
  343. Handler_read_first
  344. 5701366
  345. Handler_read_key
  346. 26262529583
  347. Handler_read_last
  348. 31617
  349. Handler_read_next
  350. 109928062206
  351. Handler_read_prev
  352. 212093135
  353. Handler_read_rnd
  354. 6690959918
  355. Handler_read_rnd_next
  356. 26130974483
  357. Handler_rollback
  358. 99880
  359. Handler_savepoint
  360. 0
  361. Handler_savepoint_rollback
  362. 0
  363. Handler_update
  364. 80365845
  365. Handler_write
  366. 3262327514
  367. Innodb_buffer_pool_dump_status
  368. not started
  369. Innodb_buffer_pool_load_status
  370. not started
  371. Innodb_buffer_pool_pages_data
  372. 384476
  373. Innodb_buffer_pool_bytes_data
  374. 6299254784
  375. Innodb_buffer_pool_pages_dirty
  376. 95
  377. Innodb_buffer_pool_bytes_dirty
  378. 1556480
  379. Innodb_buffer_pool_pages_flushed
  380. 16849536
  381. Innodb_buffer_pool_pages_free
  382. 617389
  383. Innodb_buffer_pool_pages_misc
  384. 46707
  385. Innodb_buffer_pool_pages_total
  386. 1048572
  387. Innodb_buffer_pool_read_ahead_rnd
  388. 0
  389. Innodb_buffer_pool_read_ahead
  390. 26706
  391. Innodb_buffer_pool_read_ahead_evicted
  392. 0
  393. Innodb_buffer_pool_read_requests
  394. 235232077708
  395. Innodb_buffer_pool_reads
  396. 157875
  397. Innodb_buffer_pool_wait_free
  398. 0
  399. Innodb_buffer_pool_write_requests
  400. 523402314
  401. Innodb_data_fsyncs
  402. 8277097
  403. Variable_name
  404. Value
  405. Innodb_data_pending_fsyncs
  406. 0
  407. Innodb_data_pending_reads
  408. 0
  409. Innodb_data_pending_writes
  410. 0
  411. Innodb_data_read
  412. 3187642368
  413. Innodb_data_reads
  414. 195006
  415. Innodb_data_writes
  416. 46743559
  417. Innodb_data_written
  418. 669383931392
  419. Innodb_dblwr_pages_written
  420. 16849536
  421. Innodb_dblwr_writes
  422. 2819209
  423. Innodb_have_atomic_builtins
  424. ON
  425. Innodb_log_waits
  426. 0
  427. Innodb_log_write_requests
  428. 231729452
  429. Innodb_log_writes
  430. 26991919
  431. Innodb_os_log_fsyncs
  432. 1177300
  433. Innodb_os_log_pending_fsyncs
  434. 0
  435. Innodb_os_log_pending_writes
  436. 0
  437. Innodb_os_log_written
  438. 117223886848
  439. Innodb_page_size
  440. 16384
  441. Innodb_pages_created
  442. 244392
  443. Innodb_pages_read
  444. 194427
  445. Innodb_pages_written
  446. 16849536
  447. Innodb_row_lock_current_waits
  448. 0
  449. Innodb_row_lock_time
  450. 19483692
  451. Innodb_row_lock_time_avg
  452. 2345
  453. Innodb_row_lock_time_max
  454. 51715
  455. Innodb_row_lock_waits
  456. 8306
  457. Innodb_rows_deleted
  458. 20957957
  459. Innodb_rows_inserted
  460. 27091885
  461. Innodb_rows_read
  462. 156431546126
  463. Innodb_rows_updated
  464. 25463060
  465. Innodb_num_open_files
  466. 573
  467. Innodb_truncated_status_writes
  468. 0
  469. Innodb_available_undo_logs
  470. 128
  471. Key_blocks_not_flushed
  472. 0
  473. Key_blocks_unused
  474. 247176
  475. Key_blocks_used
  476. 181543
  477. Key_read_requests
  478. 478108001
  479. Key_reads
  480. 171224
  481. Key_write_requests
  482. 42044666
  483. Key_writes
  484. 32000663
  485. Last_query_cost
  486. 0.000000
  487. Last_query_partial_plans
  488. 0
  489. Max_used_connections
  490. 108
  491. Not_flushed_delayed_rows
  492. 0
  493. Open_files
  494. 132
  495. Open_streams
  496. 0
  497. Open_table_definitions
  498. 695
  499. Open_tables
  500. 2157
  501. Opened_files
  502. 129209548
  503. Opened_table_definitions
  504. 5035
  505. Opened_tables
  506. 98173
  507. Performance_schema_accounts_lost
  508. 0
  509. Performance_schema_cond_classes_lost
  510. 0
  511. Performance_schema_cond_instances_lost
  512. 0
  513. Performance_schema_digest_lost
  514. 0
  515. Performance_schema_file_classes_lost
  516. 0
  517. Performance_schema_file_handles_lost
  518. 0
  519. Performance_schema_file_instances_lost
  520. 0
  521. Performance_schema_hosts_lost
  522. 0
  523. Performance_schema_locker_lost
  524. 0
  525. Performance_schema_mutex_classes_lost
  526. 0
  527. Performance_schema_mutex_instances_lost
  528. 0
  529. Performance_schema_rwlock_classes_lost
  530. 0
  531. Performance_schema_rwlock_instances_lost
  532. 0
  533. Performance_schema_session_connect_attrs_lost
  534. 0
  535. Performance_schema_socket_classes_lost
  536. 0
  537. Performance_schema_socket_instances_lost
  538. 0
  539. Performance_schema_stage_classes_lost
  540. 0
  541. Performance_schema_statement_classes_lost
  542. 0
  543. Performance_schema_table_handles_lost
  544. 0
  545. Performance_schema_table_instances_lost
  546. 0
  547. Performance_schema_thread_classes_lost
  548. 0
  549. Performance_schema_thread_instances_lost
  550. 0
  551. Performance_schema_users_lost
  552. 0
  553. Prepared_stmt_count
  554. 0
  555. Qcache_free_blocks
  556. 1
  557. Qcache_free_memory
  558. 536852816
  559. Qcache_hits
  560. 0
  561. Qcache_inserts
  562. 0
  563. Qcache_lowmem_prunes
  564. 0
  565. Qcache_not_cached
  566. 450105606
  567. Qcache_queries_in_cache
  568. 0
  569. Qcache_total_blocks
  570. 1
  571. Queries
  572. 570344429
  573. Questions
  574. 570344415
  575. Select_full_join
  576. 336026
  577. Select_full_range_join
  578. 1914512
  579. Select_range
  580. 21082218
  581. Select_range_check
  582. 0
  583. Select_scan
  584. 37881116
  585. Slave_heartbeat_period
  586. Slave_last_heartbeat
  587. Slave_open_temp_tables
  588. 0
  589. Slave_received_heartbeats
  590. Slave_retried_transactions
  591. Slave_running
  592. OFF
  593. Slow_launch_threads
  594. 0
  595. Slow_queries
  596. 359667
  597. Sort_merge_passes
  598. 1690
  599. Sort_range
  600. 24277510
  601. Variable_name
  602. Value
  603. Sort_rows
  604. 2017426115
  605. Sort_scan
  606. 66464668
  607. Ssl_accept_renegotiates
  608. 0
  609. Ssl_accepts
  610. 0
  611. Ssl_callback_cache_hits
  612. 0
  613. Ssl_cipher
  614. Ssl_cipher_list
  615. Ssl_client_connects
  616. 0
  617. Ssl_connect_renegotiates
  618. 0
  619. Ssl_ctx_verify_depth
  620. 0
  621. Ssl_ctx_verify_mode
  622. 0
  623. Ssl_default_timeout
  624. 0
  625. Ssl_finished_accepts
  626. 0
  627. Ssl_finished_connects
  628. 0
  629. Ssl_server_not_after
  630. Ssl_server_not_before
  631. Ssl_session_cache_hits
  632. 0
  633. Ssl_session_cache_misses
  634. 0
  635. Ssl_session_cache_mode
  636. NONE
  637. Ssl_session_cache_overflows
  638. 0
  639. Ssl_session_cache_size
  640. 0
  641. Ssl_session_cache_timeouts
  642. 0
  643. Ssl_sessions_reused
  644. 0
  645. Ssl_used_session_cache_entries
  646. 0
  647. Ssl_verify_depth
  648. 0
  649. Ssl_verify_mode
  650. 0
  651. Ssl_version
  652. Table_locks_immediate
  653. 1022116993
  654. Table_locks_waited
  655. 155
  656. Table_open_cache_hits
  657. 1022210351
  658. Table_open_cache_misses
  659. 2690
  660. Table_open_cache_overflows
  661. 0
  662. Tc_log_max_pages_used
  663. 0
  664. Tc_log_page_size
  665. 0
  666. Tc_log_page_waits
  667. 0
  668. Threads_cached
  669. 103
  670. Threads_connected
  671. 5
  672. Threads_created
  673. 108
  674. Threads_running
  675. 1
  676. Uptime
  677. 929242
  678. Uptime_since_flush_status
  679. 929242
展开查看全部
4ngedf3f

4ngedf3f2#

rate per second=rps为my.cnf[mysqld]部分考虑的建议

  1. thread_cache_size=100 # from 512 see refman 5.7 for CAP of 100 suggestions to avoid OOM
  2. innodb_log_buffer_size=512M # from 2G - BUFFER should NOT be > file size
  3. innodb_log_file_size=2G # from 512M for a reasonable relationship to BUFFER

以下4个是每个连接的值,您已经超出了上限

  1. sort_buffer_size=4M # from 24M default is 2M
  2. read_buffer_size=256K # from 8M default is 128K to reduce handler_read_next RPS
  3. read_rnd_buffer_size=512K # from 24M default is 256K to reduce handler_read_rnd_next RPS
  4. join_buffer_size=256K # from 128M default is 128K for row pointers

请查看我的个人资料,网络资料的联系信息,包括我的skype id和取得联系。

gtlvzcf8

gtlvzcf83#

不要盲目地提高价值观,希望它们有所帮助。以下是危险的高,可能会导致交换,这比设置较低要糟糕得多:

  1. key_buffer = 512M
  2. thread_cache_size = 512
  3. join_buffer_size = 128M
  4. max_connections = 1024
  5. table_open_cache = 12288
  6. tmp_table_size = 512M
  7. max_heap_table_size = 512M
  8. query_cache_size = 512M
  9. innodb_log_buffer_size = 2G

考虑将其余的表从myisam移到innodb。
您似乎有很多格式不好的查询和/或缺少索引。slowlog已配置,但已关闭,因此您无法随时获取更多信息。把它打开。
这些有索引吗?它们是数字还是字符串?

  1. main_table.product_id
  2. main_table.entity_id
  3. catalog_category_entity.entity_id
  4. sales_flat_quote_address.address_id

这是恶性优化;可以用别的方法重写吗?。。

  1. WHERE (cat_index.visibility IN(3, 2, 4)
  2. OR store_cat_index.visibility IN(3, 2, 4))

例如,这两个表中的“可见性”是否总是相同的?
你能做点什么吗 COUNT 之前 JOINing ? 囊性纤维变性 SELECT COUNT(DISTINCT e.entity_id) ... 哎哟!eav变得更糟了。客户\地址\实体\ varchar/\ int/\文本

  1. WHERE (t_d.entity_type_id = 3)
  2. AND (t_d.entity_id IN (260))
  3. AND (t_d.attribute_id IN ('41'))
  4. AND (t_d.store_id = 0)

乞求

  1. `INDEX(entity_type_id, store_id, -- first, in either order
  2. entity_id, attribute_id)

修好那些;跑一会儿;再刻 eclipse VARIABLES 以及 GLOBAL STATUS 但打开 Package ,然后我会看看其余的。

展开查看全部
5w9g7ksd

5w9g7ksd4#

一般来说,当目录大于50k时
启用平面目录
将索引器模式设置为手动,并为其设置夜间cron。

14ifxucb

14ifxucb5#

显示全局变量:

  1. auto_increment_increment
  2. 1
  3. auto_increment_offset
  4. 1
  5. autocommit
  6. ON
  7. automatic_sp_privileges
  8. ON
  9. back_log
  10. 254
  11. basedir
  12. /usr
  13. big_tables
  14. OFF
  15. bind_address
  16. *
  17. binlog_cache_size
  18. 32768
  19. binlog_checksum
  20. CRC32
  21. binlog_direct_non_transactional_updates
  22. OFF
  23. binlog_format
  24. STATEMENT
  25. binlog_max_flush_queue_time
  26. 0
  27. binlog_order_commits
  28. ON
  29. binlog_row_image
  30. FULL
  31. binlog_rows_query_log_events
  32. OFF
  33. binlog_stmt_cache_size
  34. 32768
  35. bulk_insert_buffer_size
  36. 536870912
  37. character_set_client
  38. latin1
  39. character_set_connection
  40. latin1
  41. character_set_database
  42. latin1
  43. character_set_filesystem
  44. binary
  45. character_set_results
  46. latin1
  47. character_set_server
  48. latin1
  49. character_set_system
  50. utf8
  51. character_sets_dir
  52. /usr/share/mysql/charsets/
  53. collation_connection
  54. latin1_swedish_ci
  55. collation_database
  56. latin1_swedish_ci
  57. collation_server
  58. latin1_swedish_ci
  59. completion_type
  60. NO_CHAIN
  61. concurrent_insert
  62. ALWAYS
  63. connect_timeout
  64. 5
  65. core_file
  66. OFF
  67. datadir
  68. /var/lib/mysql/
  69. date_format
  70. %Y-%m-%d
  71. datetime_format
  72. %Y-%m-%d %H:%i:%s
  73. default_storage_engine
  74. InnoDB
  75. default_tmp_storage_engine
  76. InnoDB
  77. default_week_format
  78. 0
  79. delay_key_write
  80. ON
  81. delayed_insert_limit
  82. 100
  83. delayed_insert_timeout
  84. 300
  85. delayed_queue_size
  86. 1000
  87. disconnect_on_expired_password
  88. ON
  89. div_precision_increment
  90. 4
  91. end_markers_in_json
  92. OFF
  93. enforce_gtid_consistency
  94. OFF
  95. eq_range_index_dive_limit
  96. 10
  97. event_scheduler
  98. OFF
  99. expire_logs_days
  100. 10
  101. explicit_defaults_for_timestamp
  102. OFF
  103. flush
  104. OFF
  105. flush_time
  106. 0
  107. foreign_key_checks
  108. ON
  109. ft_boolean_syntax
  110. + -><()~*:""&|
  111. ft_max_word_len
  112. 84
  113. ft_min_word_len
  114. 4
  115. ft_query_expansion_limit
  116. 20
  117. ft_stopword_file
  118. (built-in)
  119. general_log
  120. OFF
  121. general_log_file
  122. /var/lib/mysql/xxx.log
  123. group_concat_max_len
  124. 1024
  125. gtid_executed
  126. gtid_mode
  127. OFF
  128. gtid_owned
  129. gtid_purged
  130. have_compress
  131. YES
  132. have_crypt
  133. YES
  134. have_dynamic_loading
  135. YES
  136. have_geometry
  137. YES
  138. have_openssl
  139. DISABLED
  140. have_profiling
  141. YES
  142. have_query_cache
  143. YES
  144. have_rtree_keys
  145. YES
  146. have_ssl
  147. DISABLED
  148. have_symlink
  149. YES
  150. host_cache_size
  151. 654
  152. hostname
  153. h2776883.stratoserver.net
  154. ignore_builtin_innodb
  155. OFF
  156. ignore_db_dirs
  157. init_connect
  158. init_file
  159. init_slave
  160. innodb_adaptive_flushing
  161. ON
  162. innodb_adaptive_flushing_lwm
  163. 10
  164. innodb_adaptive_hash_index
  165. ON
  166. innodb_adaptive_max_sleep_delay
  167. 150000
  168. innodb_additional_mem_pool_size
  169. 8388608
  170. innodb_api_bk_commit_interval
  171. 5
  172. innodb_api_disable_rowlock
  173. OFF
  174. innodb_api_enable_binlog
  175. OFF
  176. innodb_api_enable_mdl
  177. OFF
  178. innodb_api_trx_level
  179. 0
  180. innodb_autoextend_increment
  181. 64
  182. innodb_autoinc_lock_mode
  183. 1
  184. innodb_buffer_pool_dump_at_shutdown
  185. OFF
  186. innodb_buffer_pool_dump_now
  187. OFF
  188. innodb_buffer_pool_filename
  189. ib_buffer_pool
  190. innodb_buffer_pool_instances
  191. 8
  192. innodb_buffer_pool_load_abort
  193. OFF
  194. Variable_name
  195. Value
  196. innodb_buffer_pool_load_at_startup
  197. OFF
  198. innodb_buffer_pool_load_now
  199. OFF
  200. innodb_buffer_pool_size
  201. 17179869184
  202. innodb_change_buffer_max_size
  203. 25
  204. innodb_change_buffering
  205. all
  206. innodb_checksum_algorithm
  207. innodb
  208. innodb_checksums
  209. ON
  210. innodb_cmp_per_index_enabled
  211. OFF
  212. innodb_commit_concurrency
  213. 0
  214. innodb_compression_failure_threshold_pct
  215. 5
  216. innodb_compression_level
  217. 6
  218. innodb_compression_pad_pct_max
  219. 50
  220. innodb_concurrency_tickets
  221. 5000
  222. innodb_data_file_path
  223. ibdata1:12M:autoextend
  224. innodb_data_home_dir
  225. innodb_disable_sort_file_cache
  226. OFF
  227. innodb_doublewrite
  228. ON
  229. innodb_fast_shutdown
  230. 1
  231. innodb_file_format
  232. Antelope
  233. innodb_file_format_check
  234. ON
  235. innodb_file_format_max
  236. Antelope
  237. innodb_file_per_table
  238. ON
  239. innodb_flush_log_at_timeout
  240. 1
  241. innodb_flush_log_at_trx_commit
  242. 2
  243. innodb_flush_method
  244. innodb_flush_neighbors
  245. 1
  246. innodb_flushing_avg_loops
  247. 30
  248. innodb_force_load_corrupted
  249. OFF
  250. innodb_force_recovery
  251. 0
  252. innodb_ft_aux_table
  253. innodb_ft_cache_size
  254. 8000000
  255. innodb_ft_enable_diag_print
  256. OFF
  257. innodb_ft_enable_stopword
  258. ON
  259. innodb_ft_max_token_size
  260. 84
  261. innodb_ft_min_token_size
  262. 3
  263. innodb_ft_num_word_optimize
  264. 2000
  265. innodb_ft_result_cache_limit
  266. 2000000000
  267. innodb_ft_server_stopword_table
  268. innodb_ft_sort_pll_degree
  269. 2
  270. innodb_ft_total_cache_size
  271. 640000000
  272. innodb_ft_user_stopword_table
  273. innodb_io_capacity
  274. 200
  275. innodb_io_capacity_max
  276. 2000
  277. innodb_large_prefix
  278. OFF
  279. innodb_lock_wait_timeout
  280. 50
  281. innodb_locks_unsafe_for_binlog
  282. OFF
  283. innodb_log_buffer_size
  284. 2147483648
  285. innodb_log_compressed_pages
  286. ON
  287. innodb_log_file_size
  288. 536870912
  289. innodb_log_files_in_group
  290. 2
  291. innodb_log_group_home_dir
  292. ./
  293. innodb_lru_scan_depth
  294. 1024
  295. innodb_max_dirty_pages_pct
  296. 75
  297. innodb_max_dirty_pages_pct_lwm
  298. 0
  299. innodb_max_purge_lag
  300. 0
  301. innodb_max_purge_lag_delay
  302. 0
  303. innodb_mirrored_log_groups
  304. 1
  305. innodb_monitor_disable
  306. innodb_monitor_enable
  307. innodb_monitor_reset
  308. innodb_monitor_reset_all
  309. innodb_old_blocks_pct
  310. 37
  311. innodb_old_blocks_time
  312. 1000
  313. innodb_online_alter_log_max_size
  314. 134217728
  315. innodb_open_files
  316. 12288
  317. innodb_optimize_fulltext_only
  318. OFF
  319. innodb_page_size
  320. 16384
  321. innodb_print_all_deadlocks
  322. OFF
  323. innodb_purge_batch_size
  324. 300
  325. innodb_purge_threads
  326. 1
  327. innodb_random_read_ahead
  328. OFF
  329. innodb_read_ahead_threshold
  330. 56
  331. innodb_read_io_threads
  332. 4
  333. innodb_read_only
  334. OFF
  335. innodb_replication_delay
  336. 0
  337. innodb_rollback_on_timeout
  338. OFF
  339. innodb_rollback_segments
  340. 128
  341. innodb_sort_buffer_size
  342. 1048576
  343. innodb_spin_wait_delay
  344. 6
  345. innodb_stats_auto_recalc
  346. ON
  347. innodb_stats_method
  348. nulls_equal
  349. innodb_stats_on_metadata
  350. OFF
  351. innodb_stats_persistent
  352. ON
  353. innodb_stats_persistent_sample_pages
  354. 20
  355. innodb_stats_sample_pages
  356. 8
  357. innodb_stats_transient_sample_pages
  358. 8
  359. innodb_status_output
  360. OFF
  361. innodb_status_output_locks
  362. OFF
  363. innodb_strict_mode
  364. OFF
  365. innodb_support_xa
  366. ON
  367. innodb_sync_array_size
  368. 1
  369. innodb_sync_spin_loops
  370. 30
  371. innodb_table_locks
  372. ON
  373. innodb_thread_concurrency
  374. 0
  375. innodb_thread_sleep_delay
  376. 10000
  377. innodb_undo_directory
  378. .
  379. innodb_undo_logs
  380. 128
  381. innodb_undo_tablespaces
  382. 0
  383. innodb_use_native_aio
  384. ON
  385. innodb_use_sys_malloc
  386. ON
  387. Variable_name
  388. Value
  389. innodb_version
  390. 5.6.16
  391. innodb_write_io_threads
  392. 4
  393. interactive_timeout
  394. 28800
  395. join_buffer_size
  396. 131072
  397. keep_files_on_create
  398. OFF
  399. key_buffer_size
  400. 536870912
  401. key_cache_age_threshold
  402. 300
  403. key_cache_block_size
  404. 1024
  405. key_cache_division_limit
  406. 100
  407. large_files_support
  408. ON
  409. large_page_size
  410. 0
  411. large_pages
  412. OFF
  413. lc_messages
  414. en_US
  415. lc_messages_dir
  416. /usr/share/mysql/
  417. lc_time_names
  418. en_US
  419. license
  420. GPL
  421. local_infile
  422. ON
  423. lock_wait_timeout
  424. 31536000
  425. locked_in_memory
  426. OFF
  427. log_bin
  428. OFF
  429. log_bin_basename
  430. log_bin_index
  431. log_bin_trust_function_creators
  432. OFF
  433. log_bin_use_v1_row_events
  434. OFF
  435. log_error
  436. log_output
  437. FILE
  438. log_queries_not_using_indexes
  439. OFF
  440. log_slave_updates
  441. OFF
  442. log_slow_admin_statements
  443. OFF
  444. log_slow_slave_statements
  445. OFF
  446. log_throttle_queries_not_using_indexes
  447. 0
  448. log_warnings
  449. 1
  450. long_query_time
  451. 0.200000
  452. low_priority_updates
  453. OFF
  454. lower_case_file_system
  455. OFF
  456. lower_case_table_names
  457. 0
  458. master_info_repository
  459. FILE
  460. master_verify_checksum
  461. OFF
  462. max_allowed_packet
  463. 67108864
  464. max_binlog_cache_size
  465. 18446744073709547520
  466. max_binlog_size
  467. 1073741824
  468. max_binlog_stmt_cache_size
  469. 18446744073709547520
  470. max_connect_errors
  471. 100
  472. max_connections
  473. 1024
  474. max_delayed_threads
  475. 20
  476. max_error_count
  477. 64
  478. max_heap_table_size
  479. 536870912
  480. max_insert_delayed_threads
  481. 20
  482. max_join_size
  483. 18446744073709551615
  484. max_length_for_sort_data
  485. 1024
  486. max_prepared_stmt_count
  487. 16382
  488. max_relay_log_size
  489. 0
  490. max_seeks_for_key
  491. 18446744073709551615
  492. max_sort_length
  493. 1024
  494. max_sp_recursion_depth
  495. 0
  496. max_tmp_tables
  497. 32
  498. max_user_connections
  499. 128
  500. max_write_lock_count
  501. 18446744073709551615
  502. metadata_locks_cache_size
  503. 1024
  504. metadata_locks_hash_instances
  505. 8
  506. min_examined_row_limit
  507. 0
  508. multi_range_count
  509. 256
  510. myisam_data_pointer_size
  511. 6
  512. myisam_max_sort_file_size
  513. 9223372036853727232
  514. myisam_mmap_size
  515. 18446744073709551615
  516. myisam_recover_options
  517. OFF
  518. myisam_repair_threads
  519. 1
  520. myisam_sort_buffer_size
  521. 8388608
  522. myisam_stats_method
  523. nulls_unequal
  524. myisam_use_mmap
  525. OFF
  526. net_buffer_length
  527. 16384
  528. net_read_timeout
  529. 30
  530. net_retry_count
  531. 10
  532. net_write_timeout
  533. 60
  534. new
  535. OFF
  536. old
  537. OFF
  538. old_alter_table
  539. OFF
  540. old_passwords
  541. 0
  542. open_files_limit
  543. 25610
  544. optimizer_prune_level
  545. 1
  546. optimizer_search_depth
  547. 62
  548. optimizer_switch
  549. index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on
  550. optimizer_trace
  551. enabled=off,one_line=off
  552. optimizer_trace_features
  553. greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on
  554. optimizer_trace_limit
  555. 1
  556. optimizer_trace_max_mem_size
  557. 16384
  558. optimizer_trace_offset
  559. -1
  560. performance_schema
  561. ON
  562. performance_schema_accounts_size
  563. 100
  564. performance_schema_digests_size
  565. 10000
  566. performance_schema_events_stages_history_long_size
  567. 10000
  568. performance_schema_events_stages_history_size
  569. 10
  570. performance_schema_events_statements_history_long_size
  571. 10000
  572. performance_schema_events_statements_history_size
  573. 10
  574. performance_schema_events_waits_history_long_size
  575. 10000
  576. performance_schema_events_waits_history_size
  577. 10
  578. performance_schema_hosts_size
  579. 100
  580. performance_schema_max_cond_classes
  581. 80
  582. performance_schema_max_cond_instances
  583. 8196
  584. performance_schema_max_file_classes
  585. 50
  586. Variable_name
  587. Value
  588. performance_schema_max_file_handles
  589. 32768
  590. performance_schema_max_file_instances
  591. 39400
  592. performance_schema_max_mutex_classes
  593. 200
  594. performance_schema_max_mutex_instances
  595. 27144
  596. performance_schema_max_rwlock_classes
  597. 40
  598. performance_schema_max_rwlock_instances
  599. 14448
  600. performance_schema_max_socket_classes
  601. 10
  602. performance_schema_max_socket_instances
  603. 2068
  604. performance_schema_max_stage_classes
  605. 150
  606. performance_schema_max_statement_classes
  607. 168
  608. performance_schema_max_table_handles
  609. 24576
  610. performance_schema_max_table_instances
  611. 12500
  612. performance_schema_max_thread_classes
  613. 50
  614. performance_schema_max_thread_instances
  615. 2148
  616. performance_schema_session_connect_attrs_size
  617. 512
  618. performance_schema_setup_actors_size
  619. 100
  620. performance_schema_setup_objects_size
  621. 100
  622. performance_schema_users_size
  623. 100
  624. pid_file
  625. /var/lib/mysql/xxx.stratoserver.net.pid
  626. plugin_dir
  627. /usr/lib/mysql/plugin/
  628. port
  629. 3306
  630. preload_buffer_size
  631. 32768
  632. profiling
  633. OFF
  634. profiling_history_size
  635. 15
  636. protocol_version
  637. 10
  638. query_alloc_block_size
  639. 8192
  640. query_cache_limit
  641. 4194304
  642. query_cache_min_res_unit
  643. 4096
  644. query_cache_size
  645. 536870912
  646. query_cache_type
  647. OFF
  648. query_cache_wlock_invalidate
  649. OFF
  650. query_prealloc_size
  651. 8192
  652. range_alloc_block_size
  653. 4096
  654. read_buffer_size
  655. 131072
  656. read_only
  657. OFF
  658. read_rnd_buffer_size
  659. 262144
  660. relay_log
  661. relay_log_basename
  662. relay_log_index
  663. relay_log_info_file
  664. relay-log.info
  665. relay_log_info_repository
  666. FILE
  667. relay_log_purge
  668. ON
  669. relay_log_recovery
  670. OFF
  671. relay_log_space_limit
  672. 0
  673. report_host
  674. report_password
  675. report_port
  676. 3306
  677. report_user
  678. rpl_stop_slave_timeout
  679. 31536000
  680. secure_auth
  681. ON
  682. secure_file_priv
  683. server_id
  684. 0
  685. server_id_bits
  686. 32
  687. server_uuid
  688. f625f81f-3416-11e8-b131-02ab55a84b80
  689. skip_external_locking
  690. ON
  691. skip_name_resolve
  692. OFF
  693. skip_networking
  694. OFF
  695. skip_show_database
  696. OFF
  697. slave_allow_batching
  698. OFF
  699. slave_checkpoint_group
  700. 512
  701. slave_checkpoint_period
  702. 300
  703. slave_compressed_protocol
  704. OFF
  705. slave_exec_mode
  706. STRICT
  707. slave_load_tmpdir
  708. /tmp
  709. slave_max_allowed_packet
  710. 1073741824
  711. slave_net_timeout
  712. 3600
  713. slave_parallel_workers
  714. 0
  715. slave_pending_jobs_size_max
  716. 16777216
  717. slave_rows_search_algorithms
  718. TABLE_SCAN,INDEX_SCAN
  719. slave_skip_errors
  720. OFF
  721. slave_sql_verify_checksum
  722. ON
  723. slave_transaction_retries
  724. 10
  725. slave_type_conversions
  726. slow_launch_time
  727. 2
  728. slow_query_log
  729. OFF
  730. slow_query_log_file
  731. /var/log/mysql/slow.log
  732. socket
  733. /var/run/mysqld/mysqld.sock
  734. sort_buffer_size
  735. 2097152
  736. sql_auto_is_null
  737. OFF
  738. sql_big_selects
  739. ON
  740. sql_buffer_result
  741. OFF
  742. sql_log_bin
  743. ON
  744. sql_log_off
  745. OFF
  746. sql_mode
  747. NO_ENGINE_SUBSTITUTION
  748. sql_notes
  749. ON
  750. sql_quote_show_create
  751. ON
  752. sql_safe_updates
  753. OFF
  754. sql_select_limit
  755. 18446744073709551615
  756. sql_slave_skip_counter
  757. 0
  758. sql_warnings
  759. OFF
  760. ssl_ca
  761. ssl_capath
  762. ssl_cert
  763. ssl_cipher
  764. ssl_crl
  765. ssl_crlpath
  766. ssl_key
  767. storage_engine
  768. InnoDB
  769. stored_program_cache
  770. 256
  771. sync_binlog
  772. 0
  773. Variable_name
  774. Value
  775. sync_frm
  776. ON
  777. sync_master_info
  778. 10000
  779. sync_relay_log
  780. 10000
  781. sync_relay_log_info
  782. 10000
  783. system_time_zone
  784. CEST
  785. table_definition_cache
  786. 2000
  787. table_open_cache
  788. 12288
  789. table_open_cache_instances
  790. 1
  791. thread_cache_size
  792. 128
  793. thread_concurrency
  794. 10
  795. thread_handling
  796. one-thread-per-connection
  797. thread_stack
  798. 262144
  799. time_format
  800. %H:%i:%s
  801. time_zone
  802. SYSTEM
  803. timed_mutexes
  804. OFF
  805. tmp_table_size
  806. 67108864
  807. tmpdir
  808. /tmp
  809. transaction_alloc_block_size
  810. 8192
  811. transaction_prealloc_size
  812. 4096
  813. tx_isolation
  814. REPEATABLE-READ
  815. tx_read_only
  816. OFF
  817. unique_checks
  818. ON
  819. updatable_views_with_limit
  820. YES
  821. version
  822. 5.6.16-1~exp1
  823. version_comment
  824. (Ubuntu)
  825. version_compile_machine
  826. x86_64
  827. version_compile_os
  828. debian-linux-gnu
  829. wait_timeout
  830. 28800
展开查看全部
fxnxkyjh

fxnxkyjh6#

在任何更改之前输出mysqltuner:

  1. >> MySQLTuner 1.7.12 - Major Hayden <major@mhtx.net>
  2. >> Bug reports, feature requests, and downloads at
  3. >> Run with '--help' for additional options and output filtering
  4. [--] Skipped version check for MySQLTuner script
  5. [OK] Logged in using credentials from Debian maintenance account.
  6. [OK] Currently running supported MySQL version 5.6.16-1~exp1
  7. [OK] Operating on 64-bit architecture
  8. -------- Log file Recommendations ------------------------------------------------------------------
  9. [--] Log file: /var/lib/mysql/xxx.stratoserver.net.err(0B)
  10. [!!] Log file /var/lib/mysql/xxx.stratoserver.net.err doesn't exist
  11. [!!] Log file /var/lib/mysql/xxx.stratoserver.net.err isn't readable.
  12. -------- Storage Engine Statistics -----------------------------------------------------------------
  13. [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
  14. [--] Data in MyISAM tables: 984.2M (Tables: 30)
  15. [--] Data in InnoDB tables: 4.1G (Tables: 568)
  16. [--] Data in MEMORY tables: 1.3M (Tables: 17)
  17. [!!] Total fragmented tables: 1
  18. -------- Analysis Performance Metrics --------------------------------------------------------------
  19. [--] innodb_stats_on_metadata: OFF
  20. [OK] No stat updates during querying INFORMATION_SCHEMA.
  21. -------- Security Recommendations ------------------------------------------------------------------
  22. [OK] There are no anonymous accounts for any database users
  23. [OK] All database users have passwords assigned
  24. [!!] There is no basic password file list!
  25. -------- CVE Security Recommendations --------------------------------------------------------------
  26. [--] Skipped due to --cvefile option undefined
  27. -------- Performance Metrics -----------------------------------------------------------------------
  28. [--] Up for: 10d 23h 42m 17s (581M q [612.461 qps], 1M conn, TX: 889G, RX: 249G)
  29. [--] Reads / Writes: 93% / 7%
  30. [--] Binary logging is disabled
  31. [--] Physical Memory : 32.0G
  32. [--] Max MySQL memory : 22.6G
  33. [--] Other process memory: 33.5M
  34. [--] Total buffers: 19.1G global + 2.8M per thread (1024 max threads)
  35. [--] P_S Max memory usage: 754M
  36. [--] Galera GCache Max memory usage: 0B
  37. [OK] Maximum reached memory usage: 20.1G (62.80% of installed RAM)
  38. [OK] Maximum possible memory usage: 22.6G (70.49% of installed RAM)
  39. [OK] Overall possible memory usage with other process is compatible with memory available
  40. [OK] Slow queries: 0% (365K/581M)
  41. [OK] Highest usage of available connections: 10% (108/1024)
  42. [OK] Aborted connections: 0.02% (338/1784303)
  43. [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
  44. [!!] Query cache may be disabled by default due to mutex contention.
  45. [!!] Query cache efficiency: 0.0% (0 cached / 459M selects)
  46. [OK] Query cache prunes per day: 0
  47. [OK] Sorts requiring temporary tables: 0% (1K temp sorts / 92M sorts)
  48. [!!] Joins performed without indexes: 341633
  49. [!!] Temporary tables created on disk: 47% (32M on disk / 69M total)
  50. [OK] Thread cache hit rate: 99% (108 created / 1M connections)
  51. [!!] Table cache hit rate: 2% (2K open / 98K opened)
  52. [OK] Open file limit used: 0% (132/25K)
  53. [OK] Table locks acquired immediately: 99% (1B immediate / 1B locks)
  54. -------- Performance schema ------------------------------------------------------------------------
  55. [--] Memory used by P_S: 754.8M
  56. [--] Sys schema isn't installed.
  57. -------- ThreadPool Metrics ------------------------------------------------------------------------
  58. [--] ThreadPool stat is disabled.
  59. -------- MyISAM Metrics ----------------------------------------------------------------------------
  60. [!!] Key buffer used: 52.9% (284M used / 536M cache)
  61. [OK] Key buffer size / total MyISAM indexes: 512.0M/378.4M
  62. [OK] Read Key buffer hit rate: 100.0% (484M cached / 171K reads)
  63. [!!] Write Key buffer hit rate: 76.0% (42M cached / 32M writes)
  64. -------- InnoDB Metrics ----------------------------------------------------------------------------
  65. [--] InnoDB is enabled.
  66. [--] InnoDB Thread Concurrency: 0
  67. [OK] InnoDB File per table is activated
  68. [OK] InnoDB buffer pool / data size: 16.0G/4.1G
  69. [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (6.25 %): 512.0M * 2/16.0G should be equal 25%
  70. [!!] InnoDB buffer pool instances: 8
  71. [--] InnoDB Buffer Pool Chunk Size not used or defined in your version
  72. [OK] InnoDB Read buffer efficiency: 100.00% (238662528177 hits/ 238662686106 total)
  73. [!!] InnoDB Write Log efficiency: 88.34% (208711294 hits/ 236256359 total)
  74. [OK] InnoDB log waits: 0.00% (0 waits / 27545065 writes)
  75. -------- AriaDB Metrics ----------------------------------------------------------------------------
  76. [--] AriaDB is disabled.
  77. -------- TokuDB Metrics ----------------------------------------------------------------------------
  78. [--] TokuDB is disabled.
  79. -------- XtraDB Metrics ----------------------------------------------------------------------------
  80. [--] XtraDB is disabled.
  81. -------- Galera Metrics ----------------------------------------------------------------------------
  82. [--] Galera is disabled.
  83. -------- Replication Metrics -----------------------------------------------------------------------
  84. [--] Galera Synchronous replication: NO
  85. [--] No replication slave(s) for this server.
  86. [--] Binlog format: STATEMENT
  87. [--] XA support enabled: ON
  88. [--] Semi synchronous replication Master: Not Activated
  89. [--] Semi synchronous replication Slave: Not Activated
  90. [--] This is a standalone server
  91. -------- Recommendations ---------------------------------------------------------------------------
  92. General recommendations:
  93. Run OPTIMIZE TABLE to defragment tables for better performance
  94. OPTIMIZE TABLE `juwelierwebshop`.`cron_schedule`; -- can free 1064 MB
  95. Total freed space after theses OPTIMIZE TABLE : 1064 Mb
  96. Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
  97. Adjust your join queries to always utilize indexes
  98. When making adjustments, make tmp_table_size/max_heap_table_size equal
  99. Reduce your SELECT DISTINCT queries which have no LIMIT clause
  100. Increase table_open_cache gradually to avoid file descriptor limits
  101. Read this before increasing table_open_cache over 64:
  102. This is MyISAM only table_cache scalability problem, InnoDB not affected.
  103. See more details here:
  104. This bug already fixed in MySQL 5.7.9 and newer MySQL versions.
  105. Beware that open_files_limit (25610) variable
  106. should be greater than table_open_cache (12288)
  107. Consider installing Sys schema from
  108. Before changing innodb_log_file_size and/or innodb_log_files_in_group read this:
  109. Variables to adjust:
  110. query_cache_size (=0)
  111. query_cache_type (=0)
  112. query_cache_limit (> 4M, or use smaller result sets)
  113. join_buffer_size (> 128.0K, or always use indexes with JOINs)
  114. tmp_table_size (> 64M)
  115. max_heap_table_size (> 512M)
  116. table_open_cache (> 12288)
  117. innodb_log_file_size should be (=2G) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
  118. innodb_buffer_pool_instances(=16)
展开查看全部

相关问题