ich möchte gern mein Mysql Server konfigurieren. Leider nicht so viel Ahnung in der Sache :oops:
Ziel ist, dass die Geschwindigkeit zulegt, und bei einer kleineren (d)dos Attacke der MYSQL Server nicht so schnell abschmiert. (Testweise mit 250 "attackiert" - nach paar sec. kamen auf der Seite Mysql-Zugriff Fehler usw.)
System:
AMD Opteron 2344 HE, 1x Quad-Core
4 GB DDR2-RAM ECC
2x 250 GB SATA II-Festplatten
Hardware RAID1
Ich habe den MySQL Server nun über 48H laufen. Und hier die Ausgaben von mysqltuner.pl und tuning-primer.sh:
./mysqltuner.pl
>> MySQLTuner 1.0.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.51a-24-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 254M (Tables: 352)
[!!] Total fragmented tables: 18
-------- Performance Metrics -------------------------------------------------
[--] Up for: 2d 0h 1m 8s (11M q [68.776 qps], 476K conn, TX: 48B, RX: 1B)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 198.0M global + 1.6M per thread (100 max threads)
[OK] Maximum possible memory usage: 360.1M (9% of installed RAM)
[OK] Slow queries: 0% (68K/11M)
[!!] Highest connection usage: 100% (101/100)
[!!] Key buffer size / total MyISAM indexes: 60.0M/60.6M
[!!] Key buffer hit rate: 93.4% (552M cached / 36M reads)
[OK] Query cache efficiency: 82.0% (8M cached / 10M selects)
[!!] Query cache prunes per day: 80826
[OK] Sorts requiring temporary tables: 0% (4K temp sorts / 560K sorts)
[!!] Temporary tables created on disk: 47% (257K on disk / 542K total)
[OK] Thread cache hit rate: 99% (1K created / 476K connections)
[!!] Table cache hit rate: 0% (1 open / 2M opened)
[OK] Open file limit used: 0% (5/1K)
[OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Reduce or eliminate persistent connections to reduce connection usage
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
max_connections (> 100)
wait_timeout (< 28800)
interactive_timeout (< 28800)
key_buffer_size (> 60.6M)
query_cache_size (> 128M)
tmp_table_size (> 1K)
max_heap_table_size (> 16K)
table_cache (> 1)
Aktuelle Conf Datei:./tuning-primer.sh
mysqld is alive
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.0.51a-24-log x86_64
./tuning-primer.sh: line 389: bc: command not found
./tuning-primer.sh: line 390: bc: command not found
./tuning-primer.sh: line 391: bc: command not found
./tuning-primer.sh: line 392: bc: command not found
./tuning-primer.sh: line 393: bc: command not found
./tuning-primer.sh: line 394: bc: command not found
Uptime = days hrs min sec
Avg. qps = 68
Total Questions = 11890877
Threads Connected = 5
Server has been running for over 48hrs.
It should be safe to follow these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/ ... ables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 2 sec.
You have 68712 out of 11890898 that take longer than 2 sec. to complete
Your long_query_time seems to be fine
BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/ ... overy.html
WORKER THREADS
Current thread_cache_size = 16
Current threads_cached = 13
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 4
Historic max_used_connections = 101
The number of used connections is 101% of the configured maximum.
You should raise max_connections
MEMORY USAGE
./tuning-primer.sh: line 1205: bc: command not found
./tuning-primer.sh: line 1206: bc: command not found
./tuning-primer.sh: line 1230: bc: command not found
./tuning-primer.sh: line 1233: bc: command not found
./tuning-primer.sh: line 1234: bc: command not found
./tuning-primer.sh: line 1236: bc: command not found
./tuning-primer.sh: line 1238: [: -gt: unary operator expected
./tuning-primer.sh: line 351: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 357: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 363: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 370: export: `=max_memoryHR': not a valid identifier
Max Memory Ever Allocated : bytes
./tuning-primer.sh: line 351: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 357: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 363: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 370: export: `=per_thread_buffersHR': not a valid identifier
Configured Max Per-thread Buffers : bytes
./tuning-primer.sh: line 351: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 357: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 363: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 370: export: `=global_buffersHR': not a valid identifier
Configured Max Global Buffers : bytes
./tuning-primer.sh: line 351: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 357: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 363: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 370: export: `=total_memoryHR': not a valid identifier
Configured Max Memory Limit : bytes
./tuning-primer.sh: line 332: bc: command not found
Physical Memory : G
Max memory limit seem to be within acceptable norms
KEY BUFFER
50633 * 1024 / 62914560 * 100
./tuning-primer.sh: line 647: bc: command not found
./tuning-primer.sh: line 648: bc: command not found
./tuning-primer.sh: line 332: bc: command not found
Current MyISAM index space = M
./tuning-primer.sh: line 332: bc: command not found
Current key_buffer_size = M
Key cache miss rate is 1 : 15
Key buffer free ratio = %
./tuning-primer.sh: line 681: [: -le: unary operator expected
./tuning-primer.sh: line 685: [: -le: unary operator expected
./tuning-primer.sh: line 689: [: -le: unary operator expected
Your key_buffer_size seems to be fine
QUERY CACHE
./tuning-primer.sh: line 720: bc: command not found
./tuning-primer.sh: line 721: bc: command not found
Query cache is enabled
./tuning-primer.sh: line 332: bc: command not found
Current query_cache_size = M
./tuning-primer.sh: line 332: bc: command not found
Current query_cache_used = M
./tuning-primer.sh: line 332: bc: command not found
Current query_cache_limit = M
Current Query cache Memory fill ratio = %
./tuning-primer.sh: line 332: bc: command not found
Current query_cache_min_res_unit = K
./tuning-primer.sh: line 734: bc: command not found
./tuning-primer.sh: line 735: bc: command not found
./tuning-primer.sh: line 736: [: -gt: unary operator expected
./tuning-primer.sh: line 743: [: -le: unary operator expected
./tuning-primer.sh: line 747: [: -ge: unary operator expected
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
./tuning-primer.sh: line 332: bc: command not found
Current sort_buffer_size = M
./tuning-primer.sh: line 332: bc: command not found
Current read_rnd_buffer_size = K
Sort buffer seems to be fine
JOINS
./tuning-primer.sh: line 332: bc: command not found
Current join_buffer_size = K
You have had 2 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.
Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.
OPEN FILES LIMIT
Current open_files_limit = 1024 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 = 1 tables
You have a total of 369 tables
You have 1 open tables.
Current table_cache hit rate is 0%, while 100% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
./tuning-primer.sh: line 332: bc: command not found
Current max_heap_table_size = K
./tuning-primer.sh: line 332: bc: command not found
Current tmp_table_size = K
Of 285537 temp tables, 47% were created on disk
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
./tuning-primer.sh: line 332: bc: command not found
Current read_buffer_size = K
Current table scan ratio = 1591 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 521
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'
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.
[mysqld]
skip-external-locking
skip_name_resolve
key_buffer = 32M
max_allowed_packet = 32M
thread_stack = 128K
thread_cache_size = 16
myisam-recover = BACKUP
max_connections = 100
tmp_table_size = 1000
max_heap_table_size = 900
#max_heap_table_size = 1000000000
table_cache =K
#thread_concurrency = 10
key_buffer_size = 60M
sort_buffer_size = 1M
read_rnd_buffer_size = 256K
query_cache_limit = 16M
query_cache_size = 128M
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
skip-bdb
skip-innodb
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
Was sollte ich ambesten ändern? (Ich blick da nicht durch) - Ich wäre sehr dankbar, wenn mir jemand helfen könnte.
Danke im Voraus.