eine normale community seite. als ich den server übernommen habe habe ich zu hohe auslastung auf der cpu gehabt. wie kommst du auf zig millionen besucher? knie zwingen? alles läuft eigentlich gut, ich würde einfach gerne den server optimieren und verstehen was man wie, wann und wo macht im mysql. meine community ist gratis und hat keine werbung. darum muss ich mich durchkämpfen und kann nicht 150euro pro stunde bezahlen. kannst du mir helfen?
Beiträge von Alfred Kanzler
-
-
meine probleme:
auf meinem web läuft alles über die datenbank.
der sql server hatte anfangs probleme diese flut an abfragen zu
handeln. jetzt konnte ich das system jedoch stabilisieren und alles
geht ganz flott. xeon 2.5ghz / 4gb / dedicatedbei den my.cnf einstellungen stosse ich an meine grenzen.
das heisst ich weiss nicht bescheid und will nicht rumtesten mit diesen
einstellungen. ich denke da ist noch viel potenzial diese abläufe zu
optimieren und den cache optimal zu nutzen.
------------------------------------------------------------------------
meine jetzige konfiguration my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections = 60
max_user_connections = 60
key_buffer = 36M
myisam_sort_buffer_size = 64M
join_buffer_size = 4194304
read_buffer_size = 8M
sort_buffer_size = 8M
table_cache = 1M
table_definition_cache = 104576
thread_cache_size = 104576
interactive_timeout = 100
wait_timeout = 15
connect_timeout = 10
max_allowed_packet = 1M
query_cache_limit = 208896
query_cache_size = 208896
query_cache_type = 1
innodb_buffer_pool_size = 1024M
max_heap_table_size = 32M
tmp_table_size = 32Mlow_priority_updates = 1
concurrent_insert = 2
max_connect_errors = 999999
open_files_limit = 10000
log_slow_queries=/var/log/mysqld.slow.log
long_query_time = 2
------------------------------------------------------------------------
und jetzt die auswertung von tuning primer:
MySQL Version 5.1.58-log i686
Uptime = 0 days 13 hrs 18 min 0 sec
Avg. qps = 95
Total Questions = 4565737
Threads Connected = 18
Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.1…-variables.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.000000 sec.
You have 29 out of 4565758 that take longer than 2.000000 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.1…e-recovery.html
WORKER THREADS
Current thread_cache_size = 16384
Current threads_cached = 8
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 60
Current threads_connected = 20
Historic max_used_connections = 28
The number of used connections is 46% of the configured maximum.
Your max_connections variable seems to be fine.
INNODB STATUS
Current InnoDB index space = 3 M
Current InnoDB data space = 3 M
Current InnoDB buffer pool free = 99 %
Current innodb_buffer_pool_size = 1.00 G
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory
MEMORY USAGE
Max Memory Ever Allocated : 1.59 G
Configured Max Per-thread Buffers : 1.19 G
Configured Max Global Buffers : 1.03 G
Configured Max Memory Limit : 2.23 G
Physical Memory : 3.94 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 66 M
Current key_buffer_size = 36 M
Key cache miss rate is 1 : 10449
Key buffer free ratio = 70 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere
QUERY CACHE
Query cache is enabled
Current query_cache_size = 204 K
Current query_cache_used = 109 K
Current query_cache_limit = 204 K
Current Query cache Memory fill ratio = 53.54 %
Current query_cache_min_res_unit = 4 K
Query Cache is 24 % fragmented
Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation.
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 8 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 4.00 M
You have had 54502 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 = 10000 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_open_cache = 524288 tables
Current table_definition_cache = 104576 tables
You have a total of 1218 tables
You have 1614 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 32 M
Current tmp_table_size = 32 M
Of 352247 temp tables, 12% were created on disk
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 8 M
Current table scan ratio = 1885 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 332
You may benefit from selective use of InnoDB.welche einstellungen kann ich hier noch optimieren?