Solved IntegraMod site speed issues!

Support for IntegraMOD 141

Moderator: Integra Moderator

Solved IntegraMod site speed issues!

PostAuthor: gamesug » Sat Jul 07, 2007 9:09 pm

Hello everyone. I have been using integramod for about 3 years. I have over 7000 registered users 110000 articles. I have had many growing pains and site speed has always been an issue. I have done all the helpfull tips in http://www.integramod.com/forum/viewtop ... t=311#3044 and even upgraded to different VPS plans and I am now on a dedicated server.

Through out the day my server load would spike and make my whole site inaccessible or very slow during those times. After many hours of trying to hunt down the issue and changing my my.cnf settings multiple times I enabled the slow queries log. Looking at over 500 queries in the log the about 90% where queries like

SELECT this.topic_id AS thistopic
, next.topic_id AS nexttopic
, prev.topic_id AS prevtopic
FROM phpbb_topics this
LEFT JOIN phpbb_topics next
ON ( next.forum_id = this.forum_id
AND next.topic_last_post_id > this.topic_last_post_id )
LEFT JOIN phpbb_topics prev
ON ( prev.forum_id = this.forum_id
AND prev.topic_last_post_id < this.topic_last_post_id )
WHERE this.topic_id = n
ORDER BY next.topic_last_post_id ASC
, prev.topic_last_post_id DESC
LIMIT 1


You will need to goto viewtopic.php

I just edited out everything between
// Hide Buttons :: Added :: Start

and

// Hide Buttons :: Added :: End
about 50 lines of code
I then replaced it with

$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next");
$previmg = 'topic_previous';
$nextimg = 'topic_next';

Functionally I can't tell a difference. Speedwise I can tell a HUGE difference. Maybe someone can explain why all that code was in there in the first place. This works for IM4.0 and IM4.1


I love the integramod project and I thought I would contrubute
Last edited by gamesug on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

gamesug
Newbie
Newbie
 
Posts: 4
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 10, 2006 10:37 am
Cash on hand: 0.00

Re: Solved IntegraMod site speed issues!

PostAuthor: binh.tang » Sun Feb 10, 2008 12:48 am

Hi gamesug,

Thanks for sharing this.
I've been running IM for over 2 years now, have over 22985 members and 42703 posts and over the last few months, have been getting some really slow responses from the site.

I've gone through, read a number of forum posts and tweaks but still slow. It has helped putting in indexes and a few other tweaks though the site is still slow.

It wasn't until today that the tech support for my server (I have TWO dedicated servers) enabled slow queries and send me information on the slow queries.

Doing a search on this site found your post and as it turns out, I have pretty much EXACTLY the same slow queries.

So, I took on your suggestion, opened up viewtopic.php and made the changes you suggested.

Around line 890, I took all this]// Hide Buttons :: Added :: Start$sql = "SELECT this.topic_id AS thistopic                          , next.topic_id AS nexttopic                          , prev.topic_id AS prevtopic                     FROM " . TOPICS_TABLE . " this          LEFT JOIN " . TOPICS_TABLE . " next                         ON ( next.forum_id = this.forum_id                          AND next.topic_last_post_id > this.topic_last_post_id )          LEFT JOIN " . TOPICS_TABLE . " prev                         ON ( prev.forum_id = this.forum_id                          AND prev.topic_last_post_id < this.topic_last_post_id )                  WHERE this.topic_id = $topic_id             ORDER BY next.topic_last_post_id ASC                          , prev.topic_last_post_id DESC                  LIMIT 1"; if ( !($result = $db->sql_query($sql)) ){     message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ){     if($row['prevtopic']){         $view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=".$row['prevtopic']);         $previmg = 'topic_previous';     } else{         $view_prev_topic_url = '';         $previmg = 'topic_previous_no';     }     if($row['nexttopic']){         $view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=".$row['nexttopic']);         $nextimg = 'topic_next';     } else{         $view_next_topic_url = '';         $nextimg = 'topic_next_no';     } }    else {     // no next and no prev?     $view_prev_topic_url = '';     $view_next_topic_url = '';     $previmg = 'topic_previous_no';     $nextimg = 'topic_next_no'; }// Hide Buttons :: Added :: End[/code]

And changed it to this:

[code]// Hide Buttons ]

Is that correct?
I saved the changes and uploaded them onto my site.

Got my hosting company to send me a slow queries log and it seems to be the same slow queries however and see heaps of these:

[color=blue]# Query_time]

and this

[color=blue]# Query_time]


I am using IM 1.40 though....?

Hopefully you can suggest something else or someone else can help here?

Thanks
Last edited by binh.tang on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
binh.tang
Members
Members
 
Posts: 43
Likes: 0 post
Liked in: 0 post
Joined: Tue Feb 06, 2007 1:11 pm
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]