PDA

View Full Version : Code slows down my site, allot


Kihon Kata
10-11-2005, 06:58 PM
Hi peeps. Need some help here. I'm running 3.5 here (http://www.makeuptalk.com/forums) on it's own P4 3.0 dedicated server. I don't know if this is the correct forum to post this in, if not...then MOVE IT. ;)

The site runs a bunch of different hacks/mods including trader ratings, vBA gallery etc. I have a modification that has my forum setup with ad collumns, both left and right. The left side colum is called from the header vB and the right side is called from the footer in vB.

When I edit my header and REMOVE the code that calls the left side ad column, my forum's pages load EXTREMELY faster. When I add it back, the pages load much slower. I really want to keep my ad columns but the slow down is killing my users.(BTW, I have removed the Adsense code and tried the speed, still the same slow downs without the ads)

Can someone look at this and gimme your best guess on why the below code is hammering my server.

Here is that code I am removing to speed it up:


<!-- BEGIN left AdColumns -->
<if condition="THIS_SCRIPT!=member && THIS_SCRIPT!=profile && VBA_SCRIPT!=gallery && THIS_SCRIPT!=gainaccess">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<if condition="THIS_SCRIPT!=memberlist && THIS_SCRIPT!=search && THIS_SCRIPT!=showthread && THIS_SCRIPT!=editpost && THIS_SCRIPT!=newreply && THIS_SCRIPT!=newthread && THIS_SCRIPT!=usercp && THIS_SCRIPT!=private && THIS_SCRIPT!=forumdisplay">
<td style="width:130px" valign="top">
<if condition="THIS_SCRIPT!=tratings">$adcolumn_left<else />$swapadcolumn_left</if></td>
</if>
<td valign="top">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width:100%">
</if>
<!-- END AdColumns -->



If you look inside that ABOVE code, you will see $swapadcolumn_left. so I thought I would display my code for the LEFT SIDE ad column:


<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="125px" align="center">
<tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr align="center">
<td class="thead"><font face="Verdana" size="1"><b>Hot Topics</b></td>
</tr>
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/forums/showthread.php?t=6040">New">http://www.makeuptalk.com/forums/showthread.php?t=6040">New! Swap Rating Center</a></font>
<br />
</td>
</tr>
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<font face="Verdana" size="1"><a target="_blank" href="<A href="http://www.makeuptalk.com/forums/mc_pollbooth.php?">Vote">http://www.makeuptalk.com/forums/mc_pollbooth.php?">Vote for Member of Month</a>
</td></tr>
<tr>
<td align="center" class="alt1">
<font face="Verdana" size="1">Sept member of the Month:<br />
<a href="<A href="http://www.makeuptalk.com/forums/member.php?u=4290">Devinjhans</a">http://www.makeuptalk.com/forums/member.php?u=4290">Devinjhans</a>
</td></tr>
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a href="http://www.makeuptalk.com/forums/usersregtoday.php">Today's (http://www.makeuptalk.com/forums/usersregtoday.php&quot;>Today's) New Members</strong></a></font>
</td></tr>
</table>
</td></tr>
</table>
<table><tr><td></td></tr></table>
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="125px" align="center">
<tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr align="center">
<td class="thead"><span class="smallfont"><b><a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/">Review">http://www.makeuptalk.com/reviews/">Review Center</a></b>
</span>
</td></tr>
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/newestReviews.php">Newest">http://www.makeuptalk.com/reviews/newestReviews.php">Newest Reviews</a>
</td>
</tr>
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/topPick.php">Top">http://www.makeuptalk.com/reviews/topPick.php">Top Picks</a>
</td></tr>
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/newestProducts.php">Newest">http://www.makeuptalk.com/reviews/newestProducts.php">Newest Products</a>
<if condition="$show['member']">
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/myProfile.php">My">http://www.makeuptalk.com/reviews/myProfile.php">My
Profile</a>
</if>
<if condition="$show['member']">
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/addReview.php">Write">http://www.makeuptalk.com/reviews/addReview.php">Write a Review?</a>
</if>
<if condition="$show['member']">
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/reviews/myEditor.php">Edit">http://www.makeuptalk.com/reviews/myEditor.php">Edit My NotePad </a></font>
</if>
<tr><td align="center" class="alt1"><font face="Verdana" size="1"><b><a href="javascript:openWinBoo()">Chat Now!</a></b></font>
</td></tr>
</table>
</td></tr>
</table>
<table><tr><td></td></tr></table>
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="125px" align="center">
<tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr align="center">
<td class="thead"><font face="Verdana" size="1"><b>Swap Center</b></td>
</tr>
<tr><td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/swap">Swap">http://www.makeuptalk.com/swap">Swap Center</a></font></td></tr>
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/swap/newestSwaps.php">Newest">http://www.makeuptalk.com/swap/newestSwaps.php">Newest Swaps</a></font></td>
</tr>
<if condition="$show['member']">
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank"
href="<A href="http://www.makeuptalk.com/forums/traderratings.php">Top">http://www.makeuptalk.com/forums/traderratings.php">Top Rated Swappers</a></font>
</td></tr>
</if>
<if condition="$show['member']">
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/swap/myEditor.php">Swap">http://www.makeuptalk.com/swap/myEditor.php">Swap Notepad</a></font>
</td></tr>
</if>
<if condition="$show['member']">
<tr>
<td align="center" class="alt1"><font face="Verdana" size="1">
<a target="_blank" href="<A href="http://www.makeuptalk.com/swap/mySwaps.php">My">http://www.makeuptalk.com/swap/mySwaps.php">My Swaps</a></font>
</if>
</table>
</td></tr>
</table>


In a nut shell, the slowdown of these codes are killing us. Any help would be appreciated.

Boofo
10-11-2005, 07:01 PM
Where are the ads being pulled from? Could it be the site the ads are coming from having to do with the slowdown?

Kihon Kata
10-11-2005, 07:03 PM
Where are the ads being pulled from? Could it be the site the ads are coming from having to do with the slowdown?

Th only ads are from Google adsense. I have removed them and tried it, but it still has signficant slowdown when they are gone. IE, they aren't the problem

Andreas
10-11-2005, 07:05 PM
I don't think that this causes slowdowns, but it might be a good idea to fix your template conditionals

<!-- BEGIN left AdColumns -->
<if condition="THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'profile' AND VBA_SCRIPT != 'gallery' AND THIS_SCRIPT != 'gainaccess'">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<if condition="THIS_SCRIPT != 'memberlist' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'showthread' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'newreply' AND THIS_SCRIPT != 'newthread' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'forumdisplay'">
<td style="width:130px" valign="top">
<if condition="THIS_SCRIPT != 'tratings'">$adcolumn_left<else />$swapadcolumn_left</if></td>
</if>
<td valign="top">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width:100%">
</if>
<!-- END AdColumns -->

Kihon Kata
10-12-2005, 03:15 AM
Kirby thanks for replying but is that the fix that you posted in the CODE? or were you just letting me know so I can fix them? If so, I am not sure how


I don't think that this causes slowdowns, but it might be a good idea to fix your template conditionals

<!-- BEGIN left AdColumns -->
<if condition="THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'profile' AND VBA_SCRIPT != 'gallery' AND THIS_SCRIPT != 'gainaccess'">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<if condition="THIS_SCRIPT != 'memberlist' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'showthread' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'newreply' AND THIS_SCRIPT != 'newthread' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'forumdisplay'">
<td style="width:130px" valign="top">
<if condition="THIS_SCRIPT != 'tratings'">$adcolumn_left<else />$swapadcolumn_left</if></td>
</if>
<td valign="top">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width:100%">
</if>
<!-- END AdColumns -->


I don't think that this causes slowdowns, but it might be a good idea to fix your template conditionals

<!-- BEGIN left AdColumns -->
<if condition="THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'profile' AND VBA_SCRIPT != 'gallery' AND THIS_SCRIPT != 'gainaccess'">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<if condition="THIS_SCRIPT != 'memberlist' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'showthread' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'newreply' AND THIS_SCRIPT != 'newthread' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'forumdisplay'">
<td style="width:130px" valign="top">
<if condition="THIS_SCRIPT != 'tratings'">$adcolumn_left<else />$swapadcolumn_left</if></td>
</if>
<td valign="top">
<table width="$stylevar[tablewidth]" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width:100%">
</if>
<!-- END AdColumns -->


Yeah your right, it didn't help even with the changes.

WTF could this be? I have posted my code that is causing the slow down. Any other ideas?

Andreas
10-12-2005, 09:55 AM
As said, normally the Code you posted can't cause slowdowns.
Do you have the microstats plugin installed?
If so, is there a change in page creation time with and without this code?
If it is not, then there are no slowdowns and it is just rendering on your browser.

nexialys
10-12-2005, 10:45 AM
what i see from your website, you have a lot of features enabled all around, so that may cause a lot of dB calls as you also have a lot of visitors... a single P4 3.0 may not be able to answer all these requests because it's not configured for that server usage.

another detail for server usage, you may be interested to store the CSS as files instead of from the database, so your clients would download it only once and use it from their browsers, instead of calling it from the server and download it each page...

also, can i ask politely if you paid for the Branding Free, because your board display a wrong copyright...

Kihon Kata
10-12-2005, 12:29 PM
First off, we absolutely paid for the Branding Free use of vB

Where can I adjust that CSS to store it as a file?

Server:
We watch server loads extremely close. The server's ram usage rarely goes past 50% so I don't think it's a server issue. Once again, when I disable the left side, it is extremely fast.

THanks for the help

what i see from your website, you have a lot of features enabled all around, so that may cause a lot of dB calls as you also have a lot of visitors... a single P4 3.0 may not be able to answer all these requests because it's not configured for that server usage.

another detail for server usage, you may be interested to store the CSS as files instead of from the database, so your clients would download it only once and use it from their browsers, instead of calling it from the server and download it each page...

also, can i ask politely if you paid for the Branding Free, because your board display a wrong copyright...

I do beleive you are right. It's issue could be the browser rendering. I have tried it with Firefox and it's much faster. As FF renders tables as they are delivered and IE waits for the entire page to be delivered then it will display. Do I have this right?

No, I don't have microstats installed due to the 3.5 port up sucks. Am I right?


As said, normally the Code you posted can't cause slowdowns.
Do you have the microstats plugin installed?
If so, is there a change in page creation time with and without this code?
If it is not, then there are no slowdowns and it is just rendering on your browser.

Andreas
10-12-2005, 12:44 PM
As I don't know your full HTML, yes it could be caused by tables.

Hmm, what's wrong with the Microstats plugin?
Seems to work just fine :)

Kihon Kata
10-12-2005, 12:50 PM
for 3.5? I thought we had tried it and it wasn't like the 3.0.X version that we ran before.

Does it work well? Where is that located?


Hmm, what's wrong with the Microstats plugin?
Seems to work just fine :)