Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Czołem,
Mam "mały" problem z mysqlem.
Mianowicie, zżera mi 100 % CPU i 4 GB ram kilka minut po uruchomieniu.
Próbowałem edytować poniższe wartości wg. różnych how to, ale to nie podziałało, może któryś z Was miał podobny problem i go rozwiązał
key_buffer = 16M key_buffer_size = 64M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 max_connections = 200 table_cache = 60 query_cache_limit = 8M query_cache_size = 64M
mysqltunner wygląda następująco:
-------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 528M (Tables: 484) [--] Data in InnoDB tables: 480K (Tables: 6) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [!!] Total fragmented tables: 19 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 29m 29s (107K q [60.911 qps], 3K conn, TX: 4B, RX: 44M) [--] Reads / Writes: 70% / 30% [--] Total buffers: 288.0M global + 2.7M per thread (200 max threads) [OK] Maximum possible memory usage: 825.5M (16% of installed RAM) [!!] Slow queries: 99% (107K/107K) [OK] Highest usage of available connections: 33% (66/200) [OK] Key buffer size / total MyISAM indexes: 64.0M/204.5M [OK] Key buffer hit rate: 99.0% (18M cached / 176K reads) [OK] Query cache efficiency: 66.7% (51K cached / 76K selects) [OK] Query cache prunes per day: 0 [OK] Sorts requiring temporary tables: 0% (5 temp sorts / 7K sorts) [!!] Joins performed without indexes: 8 [OK] Temporary tables created on disk: 1% (64 on disk / 4K total) [OK] Thread cache hit rate: 85% (585 created / 3K connections) [!!] Table cache hit rate: 0% (61 open / 14K opened) [OK] Open file limit used: 7% (77/1K) [!!] Table locks acquired immediately: 90% [OK] InnoDB data size / buffer pool: 480.0K/128.0M -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Adjust your join queries to always utilize indexes Increase table_cache gradually to avoid file descriptor limits Optimize queries and/or use InnoDB to reduce lock wait Variables to adjust: join_buffer_size (> 128.0K, or always use indexes with joins) table_cache (> 60)
Pozdro
Offline
Spróbuj zwiększyć wartości pamięci, na ile możesz.
Jak te najbardziej wyczerpane podwoisz, to dziury w niebie nie będzie.
Offline
Znajomy stwierdził, że jest to problem z I/O dlatego mysql się po prostu zatyka, zrobiłem mały test i wynik nie jest ( chyba ) najgorszy:
for i in 1 2 3; do hdparm -tT /dev/vda; done /dev/vda: Timing cached reads: 2000 MB in 2.00 seconds = 1000.26 MB/sec Timing buffered disk reads: 180 MB in 3.02 seconds = 59.52 MB/sec /dev/vda: Timing cached reads: 1662 MB in 2.00 seconds = 830.02 MB/sec Timing buffered disk reads: 182 MB in 3.02 seconds = 60.26 MB/sec /dev/vda: Timing cached reads: 1690 MB in 2.00 seconds = 845.43 MB/sec Timing buffered disk reads: 186 MB in 3.01 seconds = 61.73 MB/sec
Co sądzicie?
Offline
Time (s) | Query |
---|---|
0.00010 | SET CHARSET latin2 |
0.00004 | SET NAMES latin2 |
0.00121 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.149.239.79' WHERE u.id=1 |
0.00077 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '3.149.239.79', 1733056118) |
0.00041 | SELECT * FROM punbb_online WHERE logged<1733055818 |
0.00058 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=25066 AND t.moved_to IS NULL |
0.00007 | SELECT search_for, replace_with FROM punbb_censoring |
0.00203 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=25066 ORDER BY p.id LIMIT 0,25 |
0.00088 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=25066 |
Total query time: 0.00609 s |