Log slow queries würde ich deaktivieren. Und lass mal Tuning Primer nach 1 Tag laufen.
Wichtig sind
Code:
MAX CONNECTIONS
Historic max_used_connections = 159
und
Code:
MEMORY USAGE
Max Memory Ever Allocated :
Configured Max Memory Limit : 125 M
Configured Max Memory Limit sollte ~ 125 MB sein rofl
Wenn du mehr als 125 max_connections benötigst, solltest du zuerst read_buffer + read_rnd_buffer kleiner machen. Und wenn das nicht reicht auch noch sort_buffer, myisam_sort_buffer kleiner machen. Nach Änderungen MySQL stoppen und neu starten. Höhere table_cache und thread_cache verbessern Performance bei vielen gleichzeitigen Verbindungen.
So, also ein Tag ist vorbei und nun sagt primer folgendes:
Code:
MySQL Version 5.0.32-Debian_7~bpo.1-log i386
Uptime = 1 days 13 hrs 52 min 1 sec
Avg. qps = 505
Total Questions = 68965328
Threads Connected = 55
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.0/en/server-system-variables.html
SLOW QUERIES
Current long_query_time = 2 sec.
You have 773 out of 68969583 that take longer than 2 sec. to complete
The slow query log is enabled.
Your long_query_time seems to be fine
WORKER THREADS
Current thread_cache_size = 256
Current threads_cached = 78
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 150
Current threads_connected = 46
Historic max_used_connections = 124
The number of used connections is 82% of the configured maximum.
Your max_connections variable seems to be fine.
MEMORY USAGE
Max Memory Ever Allocated : 146 M
Configured Max Per-thread Buffers : 130 M
Configured Max Global Buffers : 38 M
Configured Max Memory Limit : 168 M
Total System Memory : 1.97 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 21 M
Current key_buffer_size = 24 M
Key cache miss rate is 1 : 633349
Key buffer fill ratio = 68.00 %
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 = 4 M
Current query_cache_used = 2 M
Current query_cach_limit = 4 M
Current Query cache fill ratio = 50.86 %
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 256 K
Current record/read_rnd_buffer_size = 252 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
OPEN FILES LIMIT
Current open_files_limit = 4256 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 371 tables
You have 779 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 64 M
Of 1119653 temp tables, 0% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 363 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 40
You may benefit from selective use of InnoDB.
Meckert also immer noch über den key_buffer obwohl der ja jetzt doch schon sehr klein ist.
Der Seitenaufbau meiner Seite hat sich auch schon etwas verbessert, lahmt aber immer noch ein wenig, positiv zu vermelden ist, dass ich bis jetzt noch keine "zu hohe Serverlast hatte", dafür schon mal ein fettes THX...
Natürlich meckert er darüber. Er hat anhand der Zahlen ja auch recht, oder?
huschi.
Also soll ich mal auf 18 MB gehen (das wären 75% von den 24, weil ein bisschen Spielraum sollte das Teil ja noch haben oder?) bzw. reißen die 6 MB soviel raus?
Aha, eine Virtuelle Maschine ohne Swap. Sicher, daß Dein Apache nicht schon ne Menge an überflüssigen Speicher weg frisst?
Überprüfe Deine Apache-Auslastung mit mod_status im ExtendedStatus.
Ah ja, und nimm die Ausgabe/Vorschläge vom Tuning-Primer-Script nicht zu ernst. Es ist nur ein Programm mit sehr beschränkter Sicht und ohne irgendeinem Ansatz von Intelligenz.
Server Version: Apache
Server Built: Mar 27 2007 15:06:55
Current Time: Monday, 06-Aug-2007 11:58:16 CEST
Restart Time: Monday, 06-Aug-2007 11:53:13 CEST
Parent Server Generation: 0
Server uptime: 5 minutes 3 seconds
Total accesses: 4871 - Total Traffic: 13.0 MB
CPU Usage: u65.64 s5.34 cu.02 cs0 - 23.4% CPU load
16.1 requests/sec - 43.9 kB/second - 2795 B/request
23 requests currently being processed, 9 idle workers
KWWWW_WWK_W_WW___WW_....W.W._.C.....W...W....W..KW._.W..W.......
................................................................
................................................................
................................................................
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process
Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
0-0 30568 1/2/184 K 0.11 0 240 0.0 0.00 0.24 84.161.123.114 projektx.no-ip.biz GET /suggest.php?q=Fantasticfo&bla=1186394297391 HTTP/1.1
1-0 30569 0/4/78 W 0.18 2 0 0.0 0.00 0.16 217.86.109.161 projektx.no-ip.biz GET /index.php HTTP/1.1
2-0 30570 0/5/114 W 0.32 2 0 0.0 0.00 0.17 88.72.174.91 projektx.no-ip.biz GET /announce.php?passkey=65ec9667c0f30ad9&info_hash=3%c7%82%1f
3-0 30527 0/25/132 W 1.27 3 0 0.0 0.01 0.60 217.255.206.63 projektx.no-ip.biz GET /announce.php?passkey=0f9619e803ecada0?info_hash=%2C%E4%CF%
4-0 30575 0/1/98 W 0.07 5 0 0.0 0.00 0.14 84.61.123.15 projektx.no-ip.biz GET /announce.php?passkey=1bed14ed42f38227&info_hash=~%83f%05%a
5-0 30528 0/18/96 _ 0.86 0 10068 0.0 0.04 0.64 84.59.53.88 projektx.no-ip.biz GET /announce.php?passkey=f43110a0468bf3b9&info_hash=%99%02%F7%
6-0 30576 0/1/64 W 0.03 5 0 0.0 0.00 0.13 84.61.123.15 projektx.no-ip.biz GET /announce.php?passkey=1bed14ed42f38227&info_hash=r%9a%90k%9
7-0 30577 0/1/83 W 0.06 5 0 0.0 0.00 0.06 84.61.123.15 projektx.no-ip.biz GET /announce.php?passkey=1bed14ed42f38227&info_hash=%02Z%06%9a
8-0 30578 1/4/78 K 0.26 0 419 0.0 0.00 0.13 84.161.123.114 projektx.no-ip.biz GET /suggest.php?q=Fantasticfou&bla=1186394297204 HTTP/1.1
9-0 30588 0/3/63 _ 0.19 0 94 0.0 0.00 0.09 84.162.147.176 projektx.no-ip.biz GET /scrape.php?passkey=675b35f830d6793a&info_hash=A%E8%16%11%E
10-0 30594 0/1/53 W 0.07 0 0 0.0 0.00 0.51 84.161.123.114 projektx.no-ip.biz GET /suggest.php?q=Fantastic&bla=1186394297766 HTTP/1.1
11-0 30459 0/73/161 _ 2.80 0 52 0.0 0.13 0.27 85.127.16.76 projektx.no-ip.biz GET /login.php HTTP/1.1
12-0 30460 0/42/83 W 1.88 6 0 0.0 0.56 0.61 84.62.52.210 projektx.no-ip.biz GET / HTTP/1.1
13-0 30595 0/0/116 W 0.79 1 0 0.0 0.00 0.32 84.161.123.114 projektx.no-ip.biz GET /suggest.php?q=Fantasticf&bla=1186394297579 HTTP/1.1
14-0 30596 0/0/98 _ 0.06 0 10401 0.0 0.00 0.07 91.9.255.82 projektx.no-ip.biz GET /announce.php?passkey=74a6e01808f21c45?info_hash=%D8%A6%D3w
15-0 30597 0/0/112 _ 0.84 0 117 0.0 0.00 0.14 89.48.56.74 projektx.no-ip.biz GET /announce.php?passkey=fd0f921e02aafd1c&info_hash=%11%14%1a%
16-0 30598 0/0/118 _ 0.49 0 58 0.0 0.00 0.21 ::1 projektx.no-ip.biz GET / HTTP/1.0
17-0 30533 0/21/133 W 1.14 9 0 0.0 0.03 0.66 84.182.246.159 projektx.no-ip.biz GET /announce.php?passkey=cc4e093207ba04c5&info_hash=%dee%26Ja%
18-0 30393 0/71/82 W 3.53 1 0 0.0 0.05 0.07 172.181.189.222 projektx.no-ip.biz GET /announce.php?passkey=6887b0848f53d4d1&info_hash=%c8%14%acw
19-0 30599 0/0/94 _ 0.51 0 36 0.0 0.00 0.66 ::1 projektx.no-ip.biz GET / HTTP/1.0
20-0 - 0/0/76 . 0.42 32 36 0.0 0.00 0.07 ::1 projektx.no-ip.biz GET / HTTP/1.0
21-0 - 0/0/86 . 2.33 24 36 0.0 0.00 0.06 ::1 projektx.no-ip.biz GET / HTTP/1.0
22-0 - 0/0/115 . 3.29 33 38 0.0 0.00 0.57 ::1 projektx.no-ip.biz GET / HTTP/1.0
23-0 - 0/0/83 . 3.36 36 888 0.0 0.00 0.21 85.2.232.184 projektx.no-ip.biz GET /announce.php?passkey=0a7bd02c01d4fc64&info_hash=%92Q%18H%0
24-0 30510 0/38/61 W 2.23 0 0 0.0 0.09 0.10 82.212.54.53 projektx.no-ip.biz GET /server-status HTTP/1.1
25-0 - 0/0/80 . 0.67 18 36 0.0 0.00 0.21 ::1 projektx.no-ip.biz GET / HTTP/1.0
26-0 30537 0/18/82 W 0.99 8 0 0.0 0.03 0.24 80.128.56.119 projektx.no-ip.biz GET /announce.php?passkey=49340f85e870b61a&info_hash=%0b%1bS9%1
27-0 - 0/0/69 . 0.30 47 54 0.0 0.00 0.07 ::1 projektx.no-ip.biz GET / HTTP/1.0
28-0 30512 0/59/98 _ 1.38 0 251 0.0 0.03 0.06 80.144.41.37 projektx.no-ip.biz GET /announce.php?passkey=fec3c9fa7ae675a6?info_hash=%0F%0A%B2%
29-0 - 0/0/51 . 1.57 29 36 0.0 0.00 0.06 ::1 projektx.no-ip.biz GET / HTTP/1.0
30-0 30420 2/63/130 C 3.64 0 0 30.1 0.13 0.28 195.4.48.228 projektx.no-ip.biz GET /pic/smilies/bananadance.gif HTTP/1.1
31-0 - 0/0/47 . 0.80 35 36 0.0 0.00 0.03 ::1 projektx.no-ip.biz GET / HTTP/1.0
32-0 - 0/0/97 . 0.31 43 4092 0.0 0.00 0.12 217.228.96.92 projektx.no-ip.biz GET /announce.php?passkey=146dbdf4b40cbc19&info_hash=%bdt%f2%22
33-0 - 0/0/43 . 1.28 12 36 0.0 0.00 0.06 ::1 projektx.no-ip.biz GET / HTTP/1.0
34-0 - 0/0/50 . 1.58 28 36 0.0 0.00 0.05 ::1 projektx.no-ip.biz GET / HTTP/1.0
35-0 - 0/0/58 . 0.57 30 36 0.0 0.00 0.13 ::1 projektx.no-ip.biz GET / HTTP/1.0
36-0 30542 0/22/88 W 1.00 4 0 0.0 0.01 0.10 84.61.123.15 projektx.no-ip.biz GET /announce.php?passkey=1bed14ed42f38227&info_hash=%7d%ae%ae%
37-0 - 0/0/44 . 0.79 19 36 0.0 0.00 0.11 ::1 projektx.no-ip.biz GET / HTTP/1.0
38-0 - 0/0/83 . 0.77 39 54 0.0 0.00 0.21 ::1 projektx.no-ip.biz GET / HTTP/1.0
39-0 - 0/0/122 . 0.24 49 54 0.0 0.00 0.56 ::1 projektx.no-ip.biz GET / HTTP/1.0
40-0 30475 0/63/87 W 2.46 2 0 0.0 0.07 0.07 91.97.67.242 projektx.no-ip.biz GET /announce.php?passkey=80d5758588cd7349&info_hash=%23%ee%f0%
41-0 - 0/0/40 . 0.75 21 42 0.0 0.00 0.04 ::1 projektx.no-ip.biz GET / HTTP/1.0
42-0 - 0/0/95 . 0.57 27 42 0.0 0.00 0.16 ::1 projektx.no-ip.biz GET / HTTP/1.0
43-0 - 0/0/64 . 1.72 38 93 0.0 0.00 0.54 ::1 projektx.no-ip.biz GET / HTTP/1.0
44-0 - 0/0/107 . 0.08 20 51 0.0 0.00 0.63 ::1 projektx.no-ip.biz GET / HTTP/1.0
45-0 30548 0/26/44 W 1.22 8 0 0.0 0.01 0.02 84.56.91.211 projektx.no-ip.biz GET /announce.php?passkey=113a5f7d88265b16&info_hash=O%1e%89%e9
46-0 - 0/0/99 . 2.68 54 175 0.0 0.00 0.18 ::1 projektx.no-ip.biz GET / HTTP/1.0
47-0 - 0/0/28 . 0.30 37 60 0.0 0.00 0.01 ::1 projektx.no-ip.biz GET / HTTP/1.0
48-0 30435 2/67/91 K 2.89 0 0 8.0 0.13 0.18 212.183.119.149 projektx.no-ip.biz GET /java_klappe.js HTTP/1.1
49-0 30550 0/21/116 W 1.30 8 0 0.0 0.01 1.00 84.56.91.211 projektx.no-ip.biz GET /announce.php?passkey=113a5f7d88265b16&info_hash=%d9%f1%96%
50-0 - 0/0/49 . 1.39 55 60 0.0 0.00 0.13 ::1 projektx.no-ip.biz GET / HTTP/1.0
51-0 30437 0/103/112 _ 3.24 0 225 0.0 0.10 0.11 80.144.41.37 projektx.no-ip.biz GET /announce.php?passkey=fec3c9fa7ae675a6?info_hash=%EB%7DH%23
52-0 - 0/0/56 . 0.37 31 61 0.0 0.00 0.05 ::1 projektx.no-ip.biz GET / HTTP/1.0
53-0 30552 0/29/76 W 1.62 0 0 0.0 0.11 0.22 85.178.204.8 projektx.no-ip.biz GET /scrape.php?passkey=9a03ab763b9662a4&info_hash=%0e%3c-4vYd%
54-0 - 0/0/32 . 0.06 53 0 0.0 0.00 0.09 84.60.119.57 projektx.no-ip.biz GET /pic/diving/menuon.gif HTTP/1.1
55-0 - 0/0/10 . 0.06 52 3736 0.0 0.00 0.00 217.82.232.53 projektx.no-ip.biz GET /announce.php?passkey=1571c8f2cf6748bf&info_hash=%11%14%1a%
56-0 30555 0/20/22 W 1.19 0 0 0.0 0.07 0.07 217.11.53.230 projektx.no-ip.biz GET /announce.php?passkey=942ff3b5fd05f920&info_hash=%C9%81%B0%
57-0 - 0/0/14 . 0.59 248 37 0.0 0.00 0.05 ::1 projektx.no-ip.biz GET / HTTP/1.0
58-0 - 0/0/9 . 0.44 258 36 0.0 0.00 0.02 ::1 projektx.no-ip.biz GET / HTTP/1.0
59-0 - 0/0/23 . 0.97 228 36 0.0 0.00 0.02 ::1 projektx.no-ip.biz GET / HTTP/1.0
60-0 - 0/0/4 . 0.24 278 36 0.0 0.00 0.00 ::1 projektx.no-ip.biz GET / HTTP/1.0
61-0 - 0/0/53 . 2.64 153 62 0.0 0.00 0.14 91.121.76.188 projektx.no-ip.biz GET /scrape.php?passkey=9fb163de706a538e&info_hash=%e8%b2%aa%b2
62-0 - 0/0/10 . 0.22 261 36 0.0 0.00 0.00 ::1 projektx.no-ip.biz GET / HTTP/1.0
63-0 - 0/0/10 . 0.44 255 59 0.0 0.00 0.00 ::1 projektx.no-ip.biz GET / HTTP/1.0
64-0 - 0/0/3 . 0.16 262 10067 0.0 0.00 0.00 91.97.39.71 projektx.no-ip.biz GET /announce.php?passkey=24808350365790cf&info_hash=%20%99%B4%
65-0 - 0/0/3 . 0.15 281 101 0.0 0.00 0.00 ::1 projektx.no-ip.biz GET / HTTP/1.0
66-0 - 0/0/8 . 0.27 264 38 0.0 0.00 0.07 ::1 projektx.no-ip.biz GET / HTTP/1.0
67-0 - 0/0/3 . 0.08 269 0 0.0 0.00 0.00 77.180.133.229 projektx.no-ip.biz GET /pic/smilies/tongue.gif HTTP/1.1
Ich hab auch schon Sysinfo v2.26 probiert aber das krieg ich leider nicht zum Laufen...
EDIT: Achja wegen primer wegen des key buffers sagt er jetzt folgendes:
Code:
KEY BUFFER
Current MyISAM index space = 23 M
Current key_buffer_size = 18 M
Key cache miss rate is 1 : 578068
Key buffer fill ratio = 100.00 %
You could increase key_buffer_size
It is safe to raise this up to 1/4 of total system memory;
assuming this is a dedicated database server.
Wie man sieht sind die Hälfte der Apache-MaxClients gar nicht genutzt!
Ca. 2/3 aller Apache-Childs dümpel nur als "Waiting for Connection" vor sich hin.
Fazit:
MaxClients runter ziehen, aber vorallem noch den Status über längere Zeit beobachten. Du solltest ca. 1/4 bis 1/3 mind. als "." oder als "_" haben.
Muß aber nicht!
Falls Deine MySQL-Datenbank mehr Speicher braucht um Abfragen abzuarbeiten dann solltest den Speicher vom Apache dahin verlagern. Requests, die nicht sofort mithilfe von Apache-Clients abgearbeitet werden gehen schließlich nicht verloren, sondern stehen in einer Warteschlange an.
THX ich teste gerade mit 75 MaxClients und es sieht recht gut aus von dehr ein riesiges Dankeschön...
Was mich jedoch noch interessieren würde:
Ich habe ja so wie es aussieht kein swap, würde das die Performance noch verbessern, wenn ich das hätte bzw. ist es möglich noch nachträglich ne swap einzurichten?
Warum bei Dir kein Swap angezeigt wird, weiß ich nicht.
Schau halt mal mit fdisk nach, ob er korrekt markiert und eingerichtet ist.
Wenn ja test mal "swapon".
Aber Swap ist hierbei nicht gleich größerer Speicher!!!
Denn sobald die Maschine aktive Programme (wie MySQL oder Apache) in den Swap auslagert hast Du wieder Probleme.
Deine SATA-Platten erscheinen grundsätzlich als /dev/hda und /dev/hdb.
Erst ein RAID würd ein /dev/sda erscheinen lassen.