Seite 1 von 2
Geschwindigkeit des Forums verbessern
Verfasst: 22.01.2006 20:59
von SonnyB
Hallo,
ich habe ein Forum mit einer Reihen von MODs. Die Beliebtheit des Forums nimmt zu und damit auch die Serverlast. Ich habe bereits einen sehr schnellen Server, allerdings machen sich bei 50 parallelen Besuchern die Last schon bemerkbar.
Bevor ich mir Gedanken mache, einen noch schnelleren Server zu holen, bin ich auf der Suche nach allgemeinen Tuning Tipps für phpbb.
Kann mir vielleicht jemand einige Tipps geben?
Danke.

Verfasst: 22.01.2006 21:02
von Fennias Maxim
Verfasst: 28.11.2007 00:40
von Manno
ich habe das nicht richtig verstanden.
Code: Alles auswählen
Hier die neue Version der Funktion, durch die die alte (includes/functions.php, Zeile 117 ff.) vollständig zu ersetzen ist:
Zeile 117 ist bei mir */ bei der orginale }
Also was muss ich finden und ersetzen kann mir bitte jemand sagen.
Das hier vileicht
Code: Alles auswählen
function make_jumpbox($action, $match_forum_id = 0)
{
global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID;
// $is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
WHERE f.cat_id = c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
ORDER BY c.cat_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql);
}
$category_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$category_rows[] = $row;
}
if ( $total_categories = count($category_rows) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
ORDER BY cat_id, forum_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
$boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option>';
$forum_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$forum_rows[] = $row;
}
if ( $total_forums = count($forum_rows) )
{
for($i = 0; $i < $total_categories; $i++)
{
$boxstring_forums = '';
for($j = 0; $j < $total_forums; $j++)
{
if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
{
// if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$j]['forum_id']]['auth_view'] )
// {
$selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id ) ? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>';
//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
'title' => $forum_rows[$j]['forum_name']
);
}
}
if ( $boxstring_forums != '' )
{
$boxstring .= '<option value="-1"> </option>';
$boxstring .= '<option value="-1">' . $category_rows[$i]['cat_title'] . '</option>';
$boxstring .= '<option value="-1">----------------</option>';
$boxstring .= $boxstring_forums;
}
}
}
$boxstring .= '</select>';
}
else
{
$boxstring .= '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"></select>';
}
// Let the jumpbox work again in sites having additional session id checks.
// if ( !empty($SID) )
// {
$boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
// }
$template->set_filenames(array(
'jumpbox' => 'jumpbox.tpl')
);
$template->assign_vars(array(
'L_GO' => $lang['Go'],
'L_JUMP_TO' => $lang['Jump_to'],
'L_SELECT_FORUM' => $lang['Select_forum'],
'S_JUMPBOX_SELECT' => $boxstring,
'S_JUMPBOX_ACTION' => append_sid($action))
);
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
return;
}
ich benutze den ja ehe nicht, Wie kann ich das Jumpbox komplet ertfernen?
Und den zweiten muss man das über root server machen? crontab und so?
http://www.phpbb.de/doku/kb/artikel.php?artikel=109
Mfg
Verfasst: 28.11.2007 08:15
von larsneo
ich würde zuerst einmal die belastung ein wenig genauer untersuchen um herauszufinden, wo es am ehesten hakt - um dort anzusetzen. alleine schon die anzeige der sql-queries pro seite kann da durchaus hilfreich sein.
falls du einen eigenen server hast ist auch dort in aller regel durch passende konfiguration einiges zu machen - alleine schon mit pecl:apc als accelerator erreicht man oftmals eine deutlich verbesserung, ungebetene gäste und bots (die durch ihre anfrage bandbreite und performance kosten) kann man durch modsecurity aussperren.
Verfasst: 28.11.2007 12:23
von Manno
@larsneo das klingt ganz gut was du sagst, Ich habe eigene Root, kanstdu mit bitte genau Helfen wie ich das mache.
Ich habe vorher opensuse gehabt, freund sagte mir das debian besser ist habe ich debian drauf.
Der seiten aufbau ist immer unterschiedlich. mall schnell mall langsam.
Code: Alles auswählen
Portal.php
[ Page generation time: 1.430538 seconds ] :: [ 4417 queries excuted ] :: [ GZIP compression enabled ]
[ Page generation time: 0.898161 seconds ] :: [ 4417 queries excuted ] :: [ GZIP compression enabled ]
[ Page generation time: 2.03985 seconds ] :: [ 4420 queries excuted ] :: [ GZIP compression enabled ]
[ Page generation time: 0.8545 seconds ] :: [ 4417 queries excuted ] :: [ GZIP compression enabled ]
index.php
[ Page generation time: 0.988623 seconds ] :: [ 4399 queries excuted ] :: [ GZIP compression enabled ]
[ Page generation time: 1.520728 seconds ] :: [ 4402 queries excuted ] :: [ GZIP compression enabled ]
Wievtopic.php
[ Page generation time: 0.86278 seconds ] :: [ 4445 queries excuted ] :: [ GZIP compression enabled ]
[ Page generation time: 1.424829 seconds ] :: [ 4448 queries excuted ] :: [ GZIP compression enabled ]
MFG
Verfasst: 28.11.2007 14:19
von tas2580
Hier gibt es einen Mod der in einem phpbb2 das Template cached, das kann auch einiges an Geschwindichkeit bringen.
Verfasst: 28.11.2007 14:27
von Markus Wandel
Hi,
ich würde aber den
XS-MOD 2.4.0 nehmen. Der ist aktueller.
Gruß
Verfasst: 28.11.2007 15:11
von Manno
Das xs Mod habe ich schon instaliert. dan habe ich den image_preload Mod auch instaliert.
Mfg
Verfasst: 28.11.2007 15:27
von bantu
Also 4000 Queries hab ich noch nie gesehen. phpBB3 kommt meist mit unter 20 aus. Da lässt sich bestimmt am Code was optimieren.
Verfasst: 28.11.2007 15:48
von Manno
bantu hat geschrieben:Also 4000 Queries hab ich noch nie gesehen. phpBB3 kommt meist mit unter 20 aus. Da lässt sich bestimmt am Code was optimieren.
Ja irgent was ist nicht in ordnung, kastdu mir bitte tips geben.