Optimierung der my.cnf - Bitte Einschätzung
Posted: 2011-06-24 16:02
Hallo,
Ich bin durch zuviel lesen verunsichert worden und hätte von euch nun gerne eine Einschätzung zu den weiter unten genannten Punkten / Fragen.
Server:
Intel Xeon X3430 Processor
(2.40GHz, 4C, 8M Cache, 95W TDP, Turbo)
8GB Arbeitsspeicher 1333MHz
2x500GB SATA 7,2k 3,5Zoll Festplatte Hot Plug
1 PERC H200A RAID Controller - Raid 1
Domains / Anwendungen:
50 Domains
- Blogs & Infoseiten - mittlere Last
- 2 größere Foren - Die Foren machen wohl den großteil der Querys aus
- 2 Online Shops - einige Besucher aber wenig Last
Datenbanken Insgesamt: 70
Tabellen Insgesamt: 1960
Größte DB ist ca. 100 MB / Tendenz steigend
Online gleichzeitig ca. 180
Zu Lastzeiten auch mal 300
DB Abfragen kann ich nicht weiter optimieren, da ich mich nicht auskenne.
-----------------------
Nachdem ich die beiden gängingen Tuning Programme ausgeführt hatte, habe ich die folgenden Werte etwas erhöht. Hier die my.cnf
my.cnf
---
set-variable = key_buffer_size=256M
set-variable = max_allowed_packet=100M
set-variable = thread_stack=128K
set-variable = table_cache=2048
set-variable = sort_buffer_size=4M
set-variable = net_buffer_length=8K
set-variable = myisam_sort_buffer_size=128M
set-variable = max_connections=600
set-variable = wait_timeout=28800
set-variable = interactive_timeout=28800
set-variable = query_cache_size=512M
set-variable = query_cache_limit=32M
set-variable = read_buffer_size=4M
set-variable = tmp_table_size=1024M
set-variable = max_heap_table_size=1024M
set-variable = read_buffer_size=4M
set-variable = read_rnd_buffer_size=8M
set-variable = join_buffer_size=8M
set-variable = thread_cache_size=20
set-variable = thread_concurrency=8
----
1, tmp_table_size & max_heap_table_size
Frage: sollen diese werte jetzt gleich sein oder nicht? Ich habe keine Arbeitsspeicher / memory Tabellen sondern nur den typ myisam.
Ist der eingetragene Wert zu groß?
2, query_cache_size & query_cache_limit
Frage: Durch viel lesen und vergleichen ist mir aufgefallen, dass meine Werte für den "size" evtl. zu groß sind. Der Tunig primer + mysqltuner haben mir allerdings eine Erhöhung empfohlen. Nach unten schrauben oder so lassen?
3, Welche Werte müssen / sollten verändert werden? Vor allem im Bereich Thread, join und Buffer?
Danke für die Beantwortung der Fragen...vielleicht fällt ja auf den ersten Blick etwas auf?! Meine große Sorge liegt darin, dass ich evtl. einen Wert total falsch eingestellt habe und ich dadurch Probleme bekomme.
---
Hier die primer auswertung:
WORKER THREADS
Current thread_cache_size = 20
Current threads_cached = 18
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 600
Current threads_connected = 2
Historic max_used_connections = 27
The number of used connections is 4% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
No InnoDB Support Enabled!
MEMORY USAGE
Max Memory Ever Allocated : 1.39 G
Configured Max Per-thread Buffers : 14.12 G
Configured Max Global Buffers : 778 M
Configured Max Memory Limit : 14.88 G
Physical Memory : 7.80 G
nMax memory limit exceeds 90% of physical memory
KEY BUFFER
Current MyISAM index space = 141 M
Current key_buffer_size = 256 M
Key cache miss rate is 1 : 3124
Key buffer free ratio = 77 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 512 M
Current query_cache_used = 234 M
Current query_cache_limit = 16 M
Current Query cache Memory fill ratio = 45.77 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 4 M
Current read_rnd_buffer_size = 7 M
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 8.00 M
You have had 11952 queries where a join could not use an index properly
join_buffer_size >= 4 M - This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
OPEN FILES LIMIT
Current open_files_limit = 4706 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
TABLE CACHE
Current table_cache value = 2048 tables
You have a total of 1945 tables
You have 1750 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 1023 M
Current tmp_table_size = 1.00 G
Of 67237 temp tables, 35% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.
TABLE SCANS
Current read_buffer_size = 3 M
Current table scan ratio = 475 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 654
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
---
so wie ich diese Auswertung jetzt verstehe, muss ich mit OPEN FILES LIMIT viel höher, muss mit join_buffer_size unter 4 und muss mit tmp_table_size und heap weiter hoch?
danke
Ich bin durch zuviel lesen verunsichert worden und hätte von euch nun gerne eine Einschätzung zu den weiter unten genannten Punkten / Fragen.
Server:
Intel Xeon X3430 Processor
(2.40GHz, 4C, 8M Cache, 95W TDP, Turbo)
8GB Arbeitsspeicher 1333MHz
2x500GB SATA 7,2k 3,5Zoll Festplatte Hot Plug
1 PERC H200A RAID Controller - Raid 1
Domains / Anwendungen:
50 Domains
- Blogs & Infoseiten - mittlere Last
- 2 größere Foren - Die Foren machen wohl den großteil der Querys aus
- 2 Online Shops - einige Besucher aber wenig Last
Datenbanken Insgesamt: 70
Tabellen Insgesamt: 1960
Größte DB ist ca. 100 MB / Tendenz steigend
Online gleichzeitig ca. 180
Zu Lastzeiten auch mal 300
DB Abfragen kann ich nicht weiter optimieren, da ich mich nicht auskenne.
-----------------------
Nachdem ich die beiden gängingen Tuning Programme ausgeführt hatte, habe ich die folgenden Werte etwas erhöht. Hier die my.cnf
my.cnf
---
set-variable = key_buffer_size=256M
set-variable = max_allowed_packet=100M
set-variable = thread_stack=128K
set-variable = table_cache=2048
set-variable = sort_buffer_size=4M
set-variable = net_buffer_length=8K
set-variable = myisam_sort_buffer_size=128M
set-variable = max_connections=600
set-variable = wait_timeout=28800
set-variable = interactive_timeout=28800
set-variable = query_cache_size=512M
set-variable = query_cache_limit=32M
set-variable = read_buffer_size=4M
set-variable = tmp_table_size=1024M
set-variable = max_heap_table_size=1024M
set-variable = read_buffer_size=4M
set-variable = read_rnd_buffer_size=8M
set-variable = join_buffer_size=8M
set-variable = thread_cache_size=20
set-variable = thread_concurrency=8
----
1, tmp_table_size & max_heap_table_size
Frage: sollen diese werte jetzt gleich sein oder nicht? Ich habe keine Arbeitsspeicher / memory Tabellen sondern nur den typ myisam.
Ist der eingetragene Wert zu groß?
2, query_cache_size & query_cache_limit
Frage: Durch viel lesen und vergleichen ist mir aufgefallen, dass meine Werte für den "size" evtl. zu groß sind. Der Tunig primer + mysqltuner haben mir allerdings eine Erhöhung empfohlen. Nach unten schrauben oder so lassen?
3, Welche Werte müssen / sollten verändert werden? Vor allem im Bereich Thread, join und Buffer?
Danke für die Beantwortung der Fragen...vielleicht fällt ja auf den ersten Blick etwas auf?! Meine große Sorge liegt darin, dass ich evtl. einen Wert total falsch eingestellt habe und ich dadurch Probleme bekomme.
---
Hier die primer auswertung:
WORKER THREADS
Current thread_cache_size = 20
Current threads_cached = 18
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 600
Current threads_connected = 2
Historic max_used_connections = 27
The number of used connections is 4% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
No InnoDB Support Enabled!
MEMORY USAGE
Max Memory Ever Allocated : 1.39 G
Configured Max Per-thread Buffers : 14.12 G
Configured Max Global Buffers : 778 M
Configured Max Memory Limit : 14.88 G
Physical Memory : 7.80 G
nMax memory limit exceeds 90% of physical memory
KEY BUFFER
Current MyISAM index space = 141 M
Current key_buffer_size = 256 M
Key cache miss rate is 1 : 3124
Key buffer free ratio = 77 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 512 M
Current query_cache_used = 234 M
Current query_cache_limit = 16 M
Current Query cache Memory fill ratio = 45.77 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 4 M
Current read_rnd_buffer_size = 7 M
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 8.00 M
You have had 11952 queries where a join could not use an index properly
join_buffer_size >= 4 M - This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
OPEN FILES LIMIT
Current open_files_limit = 4706 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
TABLE CACHE
Current table_cache value = 2048 tables
You have a total of 1945 tables
You have 1750 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 1023 M
Current tmp_table_size = 1.00 G
Of 67237 temp tables, 35% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.
TABLE SCANS
Current read_buffer_size = 3 M
Current table scan ratio = 475 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 654
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
---
so wie ich diese Auswertung jetzt verstehe, muss ich mit OPEN FILES LIMIT viel höher, muss mit join_buffer_size unter 4 und muss mit tmp_table_size und heap weiter hoch?
danke