PDA

View Full Version : Photopost site taking 35% of CPU?


Johnny Doomo
July 3rd, 2007, 07:27 PM
My management company tells me that my photopost site www.gamersgallery.com is taking 35% of my quadcore 1.6Ghz server. Is this regular? (I believe I have a slightly older version of PP, but not SUPER old).

If a regular old version of PP couldn't cause this much server processing, could it be because of poorly coded iframes that call the latest images on my gamers gallery site on my other sites, or on the custom frontpage of my gamers gallery site?

I would like to know if I really do need to toss in a 2nd quadcore chip or if I simply need to have a programmer look at those other pages that call the latest pics.

Please help!

Michael P
July 3rd, 2007, 07:35 PM
Hard to say; many factors could contribute - are you using the caching feature? What scripts are being executed so often - the latest images script? Maybe you should consider caching the latest photos for a period of time - there are alot of caching things you could use (even the built-in photopost cached featured photos block).

You could also use some kind of memcache to store the latest photos info.

Johnny Doomo
July 25th, 2007, 11:42 PM
I'm using the out of the box cache and the only added scripts I'm using at the moment (though I stopped a few from when my management company did say 35%)

are these:

on the frontpage of http://www.gamersgallery.com the "User Submitted Wallpapers" and the "Funny & Cool Images" sections. Everything else I manually add.

The script that calls those images look like this:


<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>

<?php
$host = 'localhost';
$dbUser = '****';
$dbPass = '****';
$db = '****';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());

$result = mysql_query("SELECT id,cat,bigimage FROM photos WHERE cat IN (564,8926) order by date DESC LIMIT 4" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print "

<td>
<div align=\"center\"><table width=\"0\" border=\"0\" bgcolor=\"#384051\" align=\"center\" height=\"0\" cellspacing=\"2\" cellpadding=\"4\">
<tr>
<td align=center valign=\"top\" bgcolor=\"#222939\" background=\"images/box_back.gif\">

<a href=\"/gallery/showphoto.php/photo/" . $row['id'] . " \"><img border=0 src=\"/gallery/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . " \"></a></td></tr></table></div></td>";

}
?>

</tr>
</table>


I don't know php so I have no idea if something in there is poorly coded and causing such a high load on the server.

Does anything look wrong or why it would be taking up 35%?

Chuck S
July 26th, 2007, 10:23 AM
I would suggest you use the latest code and try not using any of your code and see where you load is. You can then turn off some of the options like photo blocks etc and see where the bottleneck is if it is not your scripting

Johnny Doomo
August 9th, 2007, 11:22 PM
I'm thinking of finally getting around to upgrading. I've turned off some stuff and I still have a problem, though I don't think as much. My question is, is it possible that the massive cpu usage is due to all my categories? I ask because on the frontpage of the script ( http://www.gamersgallery.com/gallery/ ) I have game genres like action, adventure, etc., then inside of each of those I have A,B,C,D,etc., for whatever letter the game starts with. Then inside of each of those letter categories, I have the categories that are called by the game name Doom III, etc. Then inside of the game category I have one last level of categories before you get inside the last category and see images. Normally they're aren't too many inside that 2nd to last category Normally 4 or 5. So a regular tree structure would look like this:

Screen Galleries > Action > D > Doom 3 >

Then inside that, there's these cats

PC
Wallpaper
Renders & Concepts
Xbox

I guess my point is, I really don't want to upgrade if the newer version isn't going to help with the amount of cpu is being taken up.

Does it sound like this amount of categories could at all be my problem, or should it really handle this just fine?

BTW I'm currently running 5.03

Thanks for any tips you can supply.

Chuck S
August 10th, 2007, 08:21 AM
If your on 5.03 there have been significant speed and code increases since then

I am speaking on Photopost of course not any scripts you wrote

Johnny Doomo
September 22nd, 2007, 07:24 PM
I'm not as much concerned about speed as I am with load. Do you mean load, or simply that pages load faster? I just need to do anything possible to lower the server CPU load. I know that faster loading pages decreases server cpu load in a roundabout way, but that's not exactly what I'm looking for.

Any ideas? Can Photopost create a mod that uses cache? It seems like it's really needed, as those other code blocks that I have on gamersgallery.com change everytime the page is loaded, hence it's calling the database every single time the page is loaded. I think first and foremost I need something that fixes that.

Do you know of a better way of doing that Chuck or would you or somebody at PP be willing to code something (even for a price?). Right now I have 4 photopost sites, 1 forum, 1 hivemail, 1 pp review, and 1 classified site on this server. The server is a DUAL quad core 1.6 server with 2GB of memory. All these sites are pretty small. GamersGallery is the largest with less than 2,000 hits an hour. clipupload.com rarely has more than 20 or 30 people on at a time, and my vb forum only has 200 or less people on at a time. Surely a dual quadcore box could handle all this?

I don't think I'm expecting too much out of my hardware, yet the server continues to crash mysql and my management company claims its from traffic. This doesn't seem like "that much" traffic to me.

Any ideas on where to start? I'm asking here, because I'm wondering if my photopost installations / mods are the root of the problem.

Please help!

Chuck S
September 23rd, 2007, 08:52 AM
I am not taking on any new work at this time. I am getting ready to enter a Photopost Classifieds and Reviewpost Beta Cycles.

Well as Michael states there are so many factors none of which we can even attempt to take a guess at. Your host has all the information and they are telling you what they say the issue is users viewing things. Well you say 20-30 user online at a time how many guests? Your gamersgallery there is a pretty big site so if you have several active sites using the same server sure I can see if crash it. Now however am I a server manager qualified to tell you whats wrong no. So since we host is telling you whats wrong why not ask them what they say will fix this.

Michael P
September 26th, 2007, 07:21 AM
The latest version of PhotoPost (6.0) contains new caching code which should help on larger systems; we've significantly reduced the amount of information being stored in the cache which should significantly reduce it's footprint on larger sites.