Witam
Chciałbym zoptymalizować swój serwer.

Posiadam VPS'a w statnet.pl (1GB RAM, 2x2 GHz).

Mój my.cnf
Kod
[mysqld]
skip-external-locking

local-infile=0
skip-locking
skip-innodb
log-slow-queries = /var/log/slow-query.log
long_query_time = 2
query_cache_limit=1M
query_cache_size=128M
query_cache_type=1
max_connections=100
max_connect_errors=10
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_stack= 128K
thread_cache_size=8
key_buffer=16M
key_buffer_size=128M
join_buffer=1M
max_allowed_packet=16M
table_cache=128
record_buffer=1M
sort_buffer_size=64M
read_buffer_size=2M
read_rnd_buffer_size = 4M
net_buffer_length=2K
max_connect_errors=10
max_heap_table_size = 64M
tmp_table_size = 64M
long_query_time = 2
log-queries-not-using-indexes


[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192
nice= 0


[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout


MySQL Tuner
  1. -------- General Statistics --------------------------------------------------
  2. [--] Skipped version check for MySQLTuner script
  3. [OK] Currently running supported MySQL version 5.1.34-log
  4. [OK] Operating on 32-bit architecture with less than 2GB RAM
  5.  
  6. -------- Storage Engine Statistics -------------------------------------------
  7. [--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
  8. [--] Data in MyISAM tables: 199M (Tables: 592)
  9. [--] Data in MEMORY tables: 0B (Tables: 2)
  10. [!!] Total fragmented tables: 24
  11.  
  12. -------- Performance Metrics -------------------------------------------------
  13. [--] Up for: 12s (171 q [14.250 qps], 25 conn, TX: 3M, RX: 34K)
  14. [--] Reads / Writes: 70% / 30%
  15. [--] Total buffers: 320.0M global + 71.1M per thread (100 max threads)
  16. [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
  17. [!!] Maximum possible memory usage: 7.3G (725% of installed RAM)
  18. [!!] Slow queries: 9% (16/171)
  19. [OK] Highest usage of available connections: 3% (3/100)
  20. [OK] Key buffer size / total MyISAM indexes: 128.0M/113.4M
  21. [OK] Key buffer hit rate: 96.2% (24K cached / 925 reads)
  22. [OK] Query cache efficiency: 47.6% (50 cached / 105 selects)
  23. [OK] Query cache prunes per day: 0
  24. [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 16 sorts)
  25. [OK] Temporary tables created on disk: 15% (2 on disk / 13 total)
  26. [OK] Thread cache hit rate: 88% (3 created / 25 connections)
  27. [OK] Table cache hit rate: 83% (35 open / 42 opened)
  28. [OK] Open file limit used: 6% (66/1K)
  29. [OK] Table locks acquired immediately: 100% (147 immediate / 147 locks)
  30.  
  31. -------- Recommendations -----------------------------------------------------
  32. General recommendations:
  33. Run OPTIMIZE TABLE to defragment tables for better performance
  34. MySQL started within last 24 hours - recommendations may be inaccurate


(z powodu zbyt dł. postu tutaj kontynuacja)

Tuning-Primer
  1. -- MYSQL PERFORMANCE TUNING PRIMER --
  2. - By: Matthew Montgomery -
  3.  
  4. MySQL Version 5.1.34-log i686
  5.  
  6. ./tuning-primer.sh: line 497: bc: command not found
  7. ./tuning-primer.sh: line 498: bc: command not found
  8. ./tuning-primer.sh: line 499: bc: command not found
  9. ./tuning-primer.sh: line 500: bc: command not found
  10. ./tuning-primer.sh: line 501: bc: command not found
  11. ./tuning-primer.sh: line 502: bc: command not found
  12. Uptime = days hrs min sec
  13. Avg. qps = 13
  14. Total Questions = 4652
  15. Threads Connected = 1
  16.  
  17. Warning: Server has not been running for at least 48hrs.
  18. It may not be safe to use these recommendations
  19.  
  20. To find out more information on how each of these
  21. runtime variables effects performance visit:
  22. <a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html" target="_blank">http://dev.mysql.com/doc/refman/5.1/en/ser...-variables.html</a>
  23. Visit <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_blank">http://www.mysql.com/products/enterprise/advisors.html</a>
  24. for info about MySQL's Enterprise Monitoring and Advisory Service
  25.  
  26. SLOW QUERIES
  27. The slow query log is enabled.
  28. Current long_query_time = 2.000000 sec.
  29. You have 354 out of 4673 that take longer than 2.000000 sec. to complete
  30. ./tuning-primer.sh: line 403: bc: command not found
  31. ./tuning-primer.sh: line 606: [: -gt: unary operator expected
  32. Your long_query_time seems to be fine
  33.  
  34. BINARY UPDATE LOG
  35. The binary update log is NOT enabled.
  36. You will not be able to do point in time recovery
  37. See <a href="http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html" target="_blank">http://dev.mysql.com/doc/refman/5.1/en/poi...e-recovery.html</a>
  38.  
  39. WORKER THREADS
  40. Current thread_cache_size = 8
  41. Current threads_cached = 5
  42. Current threads_per_sec = 0
  43. Historic threads_per_sec = 0
  44. Your thread_cache_size is fine
  45.  
  46. MAX CONNECTIONS
  47. Current max_connections = 100
  48. Current threads_connected = 1
  49. Historic max_used_connections = 6
  50. The number of used connections is 6% of the configured maximum.
  51. You are using less than 10% of your configured max_connections.
  52. Lowering max_connections could help to avoid an over-allocation of memory
  53. See "MEMORY USAGE" section to make sure you are not over-allocating
  54.  
  55. No InnoDB Support Enabled!
  56.  
  57. MEMORY USAGE
  58. ./tuning-primer.sh: line 1321: bc: command not found
  59. ./tuning-primer.sh: line 1322: bc: command not found
  60. ./tuning-primer.sh: line 1346: bc: command not found
  61. ./tuning-primer.sh: line 1349: bc: command not found
  62. ./tuning-primer.sh: line 1350: bc: command not found
  63. ./tuning-primer.sh: line 1352: bc: command not found
  64. ./tuning-primer.sh: line 1354: [: -gt: unary operator expected
  65. ./tuning-primer.sh: line 459: [: max_memoryHR: integer expression expected
  66. ./tuning-primer.sh: line 465: [: max_memoryHR: integer expression expected
  67. ./tuning-primer.sh: line 471: [: max_memoryHR: integer expression expected
  68. ./tuning-primer.sh: line 478: export: `=max_memoryHR': not a valid identifier
  69. Max Memory Ever Allocated : bytes
  70. ./tuning-primer.sh: line 459: [: per_thread_buffersHR: integer expression expected
  71. ./tuning-primer.sh: line 465: [: per_thread_buffersHR: integer expression expected
  72. ./tuning-primer.sh: line 471: [: per_thread_buffersHR: integer expression expected
  73. ./tuning-primer.sh: line 478: export: `=per_thread_buffersHR': not a valid identifier
  74. Configured Max Per-thread Buffers : bytes
  75. ./tuning-primer.sh: line 459: [: global_buffersHR: integer expression expected
  76. ./tuning-primer.sh: line 465: [: global_buffersHR: integer expression expected
  77. ./tuning-primer.sh: line 471: [: global_buffersHR: integer expression expected
  78. ./tuning-primer.sh: line 478: export: `=global_buffersHR': not a valid identifier
  79. Configured Max Global Buffers : bytes
  80. ./tuning-primer.sh: line 459: [: total_memoryHR: integer expression expected
  81. ./tuning-primer.sh: line 465: [: total_memoryHR: integer expression expected
  82. ./tuning-primer.sh: line 471: [: total_memoryHR: integer expression expected
  83. ./tuning-primer.sh: line 478: export: `=total_memoryHR': not a valid identifier
  84. Configured Max Memory Limit : bytes
  85. ./tuning-primer.sh: line 440: bc: command not found
  86. Physical Memory : G
  87. Max memory limit seem to be within acceptable norms
  88.  
  89. KEY BUFFER
  90. ./tuning-primer.sh: line 754: bc: command not found
  91. ./tuning-primer.sh: line 755: bc: command not found
  92. ./tuning-primer.sh: line 440: bc: command not found
  93. Current MyISAM index space = M
  94. ./tuning-primer.sh: line 440: bc: command not found
  95. Current key_buffer_size = M
  96. Key cache miss rate is 1 : 65
  97. Key buffer free ratio = %
  98. ./tuning-primer.sh: line 788: [: -le: unary operator expected
  99. ./tuning-primer.sh: line 792: [: -le: unary operator expected
  100. ./tuning-primer.sh: line 796: [: -le: unary operator expected
  101. Your key_buffer_size seems to be fine
  102.  
  103. QUERY CACHE
  104. ./tuning-primer.sh: line 827: bc: command not found
  105. ./tuning-primer.sh: line 828: bc: command not found
  106. Query cache is enabled
  107. ./tuning-primer.sh: line 440: bc: command not found
  108. Current query_cache_size = M
  109. ./tuning-primer.sh: line 440: bc: command not found
  110. Current query_cache_used = K
  111. ./tuning-primer.sh: line 440: bc: command not found
  112. Current query_cache_limit = M
  113. Current Query cache Memory fill ratio = %
  114. ./tuning-primer.sh: line 440: bc: command not found
  115. Current query_cache_min_res_unit = K
  116. ./tuning-primer.sh: line 845: bc: command not found
  117. ./tuning-primer.sh: line 846: bc: command not found
  118. ./tuning-primer.sh: line 847: [: -gt: unary operator expected
  119. ./tuning-primer.sh: line 854: [: -le: unary operator expected
  120. MySQL won't cache query results that are larger than query_cache_limit in size
  121.  
  122. SORT OPERATIONS
  123. ./tuning-primer.sh: line 440: bc: command not found
  124. Current sort_buffer_size = M
  125. ./tuning-primer.sh: line 440: bc: command not found
  126. Current read_rnd_buffer_size = M
  127. Sort buffer seems to be fine
  128.  
  129. JOINS
  130. ./tuning-primer.sh: line 440: bc: command not found
  131. Current join_buffer_size = M
  132. You have had 0 queries where a join could not use an index properly
  133. Your joins seem to be using indexes properly
  134.  
  135. OPEN FILES LIMIT
  136. Current open_files_limit = 1024 files
  137. The open_files_limit should typically be set to at least 2x-3x
  138. that of table_cache if you have heavy MyISAM usage.
  139. Your open_files_limit value seems to be fine
  140.  
  141. TABLE CACHE
  142. Current table_open_cache = 128 tables
  143. Current table_definition_cache = 256 tables
  144. You have a total of 617 tables
  145. You have 128 open tables.
  146. Current table_cache hit rate is 3%
  147. , while 100% of your table cache is in use
  148. You should probably increase your table_cache
  149. You should probably increase your table_definition_cache value.
  150.  
  151. TEMP TABLES
  152. ./tuning-primer.sh: line 440: bc: command not found
  153. Current max_heap_table_size = M
  154. ./tuning-primer.sh: line 440: bc: command not found
  155. Current tmp_table_size = M
  156. Of 553 temp tables, 14% were created on disk
  157. Created disk tmp tables ratio seems fine
  158.  
  159. TABLE SCANS
  160. ./tuning-primer.sh: line 440: bc: command not found
  161. Current read_buffer_size = M
  162. Current table scan ratio = 592 : 1
  163. read_buffer_size seems to be fine
  164.  
  165. TABLE LOCKING
  166. Current Lock Wait ratio = 1 : 1938
  167. You may benefit from selective use of InnoDB.
  168. If you have long running SELECT's against MyISAM tables and perform
  169. frequent updates consider setting 'low_priority_updates=1'
  170. If you have a high concurrency of inserts on Dynamic row-length tables
  171. consider setting 'concurrent_insert=2'.


Jakie zalecacie ustawienia MySQL?