Board logo

标题: [求助] my.cnf该怎么优化? [打印本页]

作者: 我行我素    时间: 2012-1-6 11:03     标题: my.cnf该怎么优化?

1G内存 :   网站平均日访问量在1万左右,同时在线150-200左右,采用的伪静态模式,基本上都是读取数据库的。该怎么优化?
以下是默认的,该怎么优化
  1. # mysql conf /etc/my.cnf
  2. # Created by http://www.wdlinux.cn
  3. # Last Updated 2010.06.01
  4. [client]
  5. port  = 3306
  6. socket  = /tmp/mysql.sock
  7. [mysqld]
  8. port  = 3306
  9. socket  = /tmp/mysql.sock
  10. skip-external-locking
  11. key_buffer_size = 128M
  12. max_allowed_packet = 1M
  13. table_open_cache = 256
  14. sort_buffer_size = 1M
  15. read_buffer_size = 1M
  16. read_rnd_buffer_size = 2M
  17. myisam_sort_buffer_size = 8M
  18. thread_cache_size = 8
  19. query_cache_size= 16M
  20. thread_concurrency = 8
  21. max_connections = 500
  22. wait_timeout = 30
  23. interactive_timeout = 30
  24. max_connect_errors = 9
  25. long_query_time = 1
  26. tmp_table_size = 16M
  27. #log-bin=mysql-bin
  28. #binlog_format=mixed
  29. #server-id = 1
  30. [mysqldump]
  31. quick
  32. max_allowed_packet = 8M
  33. [mysql]
  34. no-auto-rehash
  35. [myisamchk]
  36. key_buffer_size = 12M
  37. sort_buffer_size = 1M
  38. read_buffer = 1M
  39. write_buffer = 1M
  40. [mysqlhotcopy]
  41. interactive-timeout
  42.         
复制代码





欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/) Powered by Discuz! 7.2