Extreme Datenbanklast, Slowqueries
Verfasst: 30.03.2009 16:09
Hallo!
Ich hab derzeit Probleme, weil mein Forum extreme Lastspitzen erzeugt und deshalb bereits mehrmals vom Provider gesperrt wurde.
Laut Info ist es zum einem die Forensuche, die diese Probleme verursacht. Die Suche habe ich mittlerweile für Gäste gesperrt. Das hat aber keine ausreichende Abhilfe gebracht.
Nun wurde mit mitgeteilt, dass es Slowqueries (sind das langsame Datenbankabfragen???) sind, die die Datenbanklast produzieren. Als Beispiel wurde folgendes gepostet:
Was ist das und wie wird es verursacht? Und vor allem, was kann ich ändern?
Ich habe auch die Bots in Verdacht, die sich irgendwie ständig im Forum tummeln. Dazu stelle ich aber noch eine Frage zu der robots.txt
Viele Grüße,
Anke
Ich hab derzeit Probleme, weil mein Forum extreme Lastspitzen erzeugt und deshalb bereits mehrmals vom Provider gesperrt wurde.
Laut Info ist es zum einem die Forensuche, die diese Probleme verursacht. Die Suche habe ich mittlerweile für Gäste gesperrt. Das hat aber keine ausreichende Abhilfe gebracht.
Nun wurde mit mitgeteilt, dass es Slowqueries (sind das langsame Datenbankabfragen???) sind, die die Datenbanklast produzieren. Als Beispiel wurde folgendes gepostet:
Leider sagt mir das gar nichtsSELECT
f.forum_id, f.forum_name, t.topic_title,
t.topic_id, t.topic_last_post_id, t.topic_poster, t.topic_views,
t.topic_replies, t.topic_type,
p2.post_time, p2.poster_id,
u.username as last_username,
u2.username as author_username
FROM phpbb_forums f, phpbb_posts p, phpbb_topics
t, phpbb_posts p2, phpbb_users u, phpbb_users u2
WHERE
f.forum_id NOT IN
(048,9,17,30,31,32,33,41,42,49,71)
AND t.forum_id = f.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_moved_id = 0
AND p2.poster_id = u.user_id
AND t.topic_poster = u2.user_id
ORDER BY t.topic_last_post_id DESC LIMIT 5;
# User@Host: db129374[db129374] @ localhost []
# Query_time: 5 Lock_time: 1 Rows_sent: 5 Rows_examined: 62998
SELECT
f.forum_id, f.forum_name, t.topic_title,
t.topic_id, t.topic_last_post_id, t.topic_poster, t.topic_views,
t.topic_replies, t.topic_type,
p2.post_time, p2.poster_id,
u.username as last_username,
u2.username as author_username
FROM phpbb_forums f, phpbb_posts p, phpbb_topics
t, phpbb_posts p2, phpbb_users u, phpbb_users u2
WHERE
f.forum_id NOT IN
(048,9,17,30,31,32,33,41,42,49,71)
AND t.forum_id = f.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_moved_id = 0
AND p2.poster_id = u.user_id
AND t.topic_poster = u2.user_id
ORDER BY t.topic_last_post_id DESC LIMIT 5;
# User@Host: db129374[db129374] @ localhost []
# Query_time: 5 Lock_time: 1 Rows_sent: 5 Rows_examined: 62998
SELECT
f.forum_id, f.forum_name, t.topic_title,
t.topic_id, t.topic_last_post_id, t.topic_poster, t.topic_views,
t.topic_replies, t.topic_type,
p2.post_time, p2.poster_id,
u.username as last_username,
u2.username as author_username
FROM phpbb_forums f, phpbb_posts p, phpbb_topics
t, phpbb_posts p2, phpbb_users u, phpbb_users u2
WHERE
f.forum_id NOT IN
(048,9,17,30,31,32,33,41,42,49,71)
AND t.forum_id = f.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_moved_id = 0
AND p2.poster_id = u.user_id
AND t.topic_poster = u2.user_id
ORDER BY t.topic_last_post_id DESC LIMIT 5;

Ich habe auch die Bots in Verdacht, die sich irgendwie ständig im Forum tummeln. Dazu stelle ich aber noch eine Frage zu der robots.txt
Viele Grüße,
Anke