vps交流

win相比linux的MYSQL,为什么CPU一直100%


WP 程序,同一个网站,放在WIN和linxu里,同样配置的,WIN 2008 mysql占用CPU 100%, LINUX debian mysql占用大约40%-70%
具体配置KS-LE E5-1650v2/32G/2x4TB
mysql 5.6.5

linux的mysql配置文件内容

  1. [client]
  2. #password        = your_password
  3. port                = 3306
  4. socket                = /tmp/mysql.sock
  5. [mysqld]
  6. binlog_cache_size = 2560K
  7. thread_stack = 5120K
  8. join_buffer_size = 8192K
  9. query_cache_type = 1
  10. max_heap_table_size = 1024M
  11. port                = 3306
  12. socket                = /tmp/mysql.sock
  13. datadir = /www/server/data
  14. default_storage_engine = InnoDB
  15. performance_schema_max_table_instances = 400
  16. table_definition_cache = 400
  17. skip-external-locking
  18. key_buffer_size = 1024M
  19. max_allowed_packet = 100G
  20. table_open_cache = 1024
  21. sort_buffer_size = 1024K
  22. net_buffer_length = 4K
  23. read_buffer_size = 1024K
  24. read_rnd_buffer_size = 8048K
  25. myisam_sort_buffer_size = 128M
  26. thread_cache_size = 2560
  27. query_cache_size = 1024M
  28. tmp_table_size = 1024M
  29. sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  30. explicit_defaults_for_timestamp = true
  31. #skip-name-resolve
  32. max_connections = 500
  33. max_connect_errors = 100
  34. open_files_limit = 65535
  35. log-bin=mysql-bin
  36. binlog_format=mixed
  37. server-id = 1
  38. expire_logs_days = 10
  39. slow_query_log=1
  40. slow-query-log-file=/www/server/data/mysql-slow.log
  41. long_query_time=3
  42. #log_queries_not_using_indexes=on
  43. innodb_data_home_dir = /www/server/data
  44. innodb_data_file_path = ibdata1:10M:autoextend
  45. innodb_log_group_home_dir = /www/server/data
  46. innodb_buffer_pool_size = 1024M
  47. innodb_log_file_size = 1024M
  48. innodb_log_buffer_size = 1024M
  49. innodb_flush_log_at_trx_commit = 1
  50. innodb_lock_wait_timeout = 50
  51. innodb_max_dirty_pages_pct = 90
  52. innodb_read_io_threads = 8
  53. innodb_write_io_threads = 8
  54. [mysqldump]
  55. quick
  56. max_allowed_packet = 500M
  57. [mysql]
  58. no-auto-rehash
  59. [myisamchk]
  60. key_buffer_size = 512M
  61. sort_buffer_size = 8M
  62. read_buffer = 2M
  63. write_buffer = 2M
  64. [mysqlhotcopy]
  65. interactive-timeout

复制代码

WIN的mysql配置文件

  1. [client]
  2. default-character-set=utf8
  3. [mysqld]
  4. character_set_server=utf8
  5. port=3306
  6. basedir  ="C:websoftmysql-5.6.15"
  7. datadir  ="C:websoftmysql-5.6.15data"
  8. tmpdir   ="C:websoftmysql-5.6.15data"
  9. socket   ="C:websoftmysql-5.6.15datamysql.sock"
  10. log-error="C:websoftmysql-5.6.15datamysql_error.log"
  11. log-bin=mysql-bin
  12. binlog_format=mixed
  13. server_id = 1
  14. slow_query_log = ON
  15. slow-query-log-file = "C:websoftmysql-5.6.15datamysql-slow.log"
  16. long_query_time = 3
  17. #skip-locking
  18. max_connections = 5000
  19. table_open_cache = 1024
  20. query_cache_size = 1024M
  21. tmp_table_size = 1024M
  22. thread_cache_size = 2560
  23. binlog_cache_size = 2560K
  24. thread_stack = 5120K
  25. read_buffer_size = 1024K
  26. query_cache_type = 1
  27. max_heap_table_size = 1024M
  28. key_buffer_size = 1024M
  29. expire_logs_days = 10
  30. innodb_data_home_dir="C:websoftmysql-5.6.15data"
  31. innodb_flush_log_at_trx_commit =1
  32. innodb_log_buffer_size = 1024M
  33. innodb_buffer_pool_size = 1024M
  34. innodb_log_file_size=1024M
  35. innodb_thread_concurrency=16
  36. innodb-autoextend-increment=1000
  37. join_buffer_size = 8192K
  38. sort_buffer_size = 1024K
  39. read_rnd_buffer_size = 8048K
  40. max_allowed_packet = 320M
  41. explicit_defaults_for_timestamp=true
  42. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  43. #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

复制代码