Hello, i run the site called "Canada Kicks Rainbow Brite" www.canadaka.net
it is a fairly large site, usualy around 200 people on at any time, gets 6000 - 11,000 uique visitors a day.
But the site at many times seems rather slow, I think it could be much faster than it is, I had done a fair amount to try and improve speed, but I am looking for some advice on what more I could do. The main nuke site is not bad, the forums are the part that bug me with there slowness.
Here is my server setup, it my own rackserver, thats primary use is for this site, I do have around 30 other sites on it, but they are all pretty low visitor sites and low resource usage compared to Canadaka.net
About the Server
Dual Intel 2.4Ghz Xeon 533FSB
4 X 512MB DDR ECC (total 2GB)
Supermicro motherboard X5DLR-8G2+ and 1U rackcase
2 X 73GB U-320 SCSI 15,000 RPM Top of the line hard drives
Windows 2003 Web Server
IIS6 (gzip enabled)
PHP 5.0.3
MySQL 4.1.18-nt
The server is at a Peer1 Networks datacenter in Vancouver, BC Canada
----------------------------------------------
About the site
phpnuke 7.6
patched (which should have all the mainfile tweaks)
nukesentinel
bbtonuke 2.0.19
Cache_Lite (caching of most the blocks)
eaccelerator php caching (modified from the old nuke 'mmcache tweaks
http://www.karakas-online.de/forum/viewtopic.php?p=17536
most sections I only cache for guests, no caching for logged in users. forums are not cached at all. If i try to cache the forums the login system gets messed up and people get logged in as other users, A REAL NIGHTMARE!
Almost all the images on the site are fairly optimizes, down to the minium about of colours needed before they look like total Rainbow Brite.
Now as far as the forums go, I do have a lot of mods, I know they will add some slowdown, but my members and I really likethe mods. Plus given the specs of my server I feel the speed should be better.
So things I am looking for adive with:
Tweaks to phpnuke or phpbb code to optimize page, database queries
Settings for MySQL (right now they are all default install settings)
IIS Settings/tweaks) I do have a seperate applicaiton pool for this site.
tweaks to the php.ini
Other general speed improving advice.
I made a temp site account if you dont want to register, many of the forum features are disabled to guests, so the page loads faster, especialy for google bots.
Username: reviewer
password: cka
function is_user($user) {
global $db, $user_prefix;
if (isset($userSave)){ return $userSave;}
if (!is_array($user)) {
$user = base64_decode($user);
$user = explode(":", $user);
}
$uid = $user[0];
$pwd = $user[2];
$uid = intval($uid);
if ($uid != "" AND $pwd != "") {
$sql = "SELECT user_password FROM ".$user_prefix."_users WHERE user_id='$uid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$pass = $row['user_password'];
if ($pass == $pwd && $pass != "") {
static $userSave;
return $userSave = 1;
}
}
static $userSave;
return $userSave = 0;
}
IT SETS THE USER AND SO IT DOESN'T PERFORM THE CHECKS ALL THE TIME ON PASS
_________________ - Do not pm me for help -
webjunky Lieutenant
Joined: May 11, 2003
Posts: 167
Posted:
Sun Aug 13, 2006 11:15 am
AND IF IT ISN'T ALLREADY THERE... ADD TO MAINFILE:
$phpver = phpversion();
if ($phpver >= '4.0.4pl1') {
ob_start('ob_gzhandler');
}else if ($phpver > '4.0'){
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')){
if (extension_loaded('zlib')){
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
}
}
}
_________________ - Do not pm me for help -
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Aug 23, 2006 5:27 pm
spottedhog wrote:
There are a couple of other areas to consider.......
Points.... not sure where that is now because I removed it long ago.
Survey block.... If you use the Nuke Survey module and block, those are pure db query hogs.
Seems like some very knowledgeable people have left here in the past 2 months. Not sure what has happened......
I am using the points system, but not seriosuly, because there is a points leak somewhere, arg thats another issue, can't find it. some users get tons of points somehow.
But i dont have points for pageviews, only for posting things so i dont think any db queries lost there?
I don't use the survey block, do you mean even if i dont the core nuke has some queries relating to it?
Quote:
$phpver = phpversion();
if ($phpver >= '4.0.4pl1') {
ob_start('ob_gzhandler');
}else if ($phpver > '4.0'){
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')){
if (extension_loaded('zlib')){
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
}
}
}
do you mean to replace that with what I have currently? which is:
Code:
$phpver = phpversion();
if ($phpver < '4.1.0') {
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
} else if ($phpver > '4.0') {
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
$do_gzip_compress = TRUE;
ob_start(array('ob_gzhandler',5));
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}[quote]
I changed the is_admin and is_user with yours but no change in # of queries.
Something I did do awhile ago that helped, though I would pass on. In my themes I have severl things that only show if_user, so rather than checking with that function multiple times, I check once in theme.php, then set a variable = TRUE, there. that I then use in my theme files. I do the same to check if a user is_paid.
I've been tweaking my block files. many had db queries inside query loops. Have reduced this by using Select joins.
[/quote]
bicho Private
Joined: Jun 14, 2005
Posts: 36
Posted:
Sun Oct 08, 2006 9:06 pm
Any more ways to get less queries??? I cant believe how slow a site can run with nuke. Even on my 3.2Ghz server with 2gigs of ram it runs like crap. Did you figure anything else out canadaka?
spottedhog Captain
Joined: Apr 30, 2004
Posts: 556
Posted:
Mon Oct 09, 2006 4:23 am
Here are some ways to make Nuke faster.....
--Make code XHTML Strict compliant.
--in Statistics, remove code that collects hourly and daily stats.
--drop the updatepoints from mainfile.php and modules that use it.
--use less graphic intensive themes
--do NOT use google adsense
--modify your robots.txt file to allow only specific search bots
--modify your .htaccess file to deny spam and referer harvesters
--drop the Survey block from loading
If you use Sentinel, it will also use a lot of overhead, checking each IP hit, etc.
SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Fri Apr 20, 2007 7:38 pm
Thansk for the comments spottedhob. I had already done msot of what you suggested long ago.
My layout is not XHTML Strict compliant though, I guess I could make it so, but would that really have an affect on speed?
I would love to disable nukeSentinel, i know it usesa lot of overhead. But I am afraid to do so, Sentinel blocks 10-20 ips/attacks? a day on my site.
Hmm doing some testing, removing the include of nukesentinel only saves 9 db queries... i guess thats a fair bit when you add it up. But I you don't notice any decrease in page load times.
http://www.canadaka.net/test.php
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12313
Posted:
Fri Apr 20, 2007 10:55 pm
I don't know what else you could really do. Perhaps switching to an Apache server?
Speed seems just fine for me, most page generation is under 1 sec.
Most of the nuke module pages load fast, and the front-page along with some other key pages are cached (I manualy output the contents to an html file), so they load fast. Its really the /forums where the problem is.
During the day the forum index takes 5-15 seconds to load, and I'm even caching a bunch of the output at the bottom of the forum index (blogs, recent users). Forum Topic pages take 5-10+ seconds to load.
And when the site gets bogged down, it gets ever slower. But if its high traffic i think it becomes more of a server hardware issue. And for those times I am getting a 2nd server to use as a dedicated MySQL box.
*TIP*
For guest users I cache the entire /index.php to a static html file. I added some code to the start of index.php and end of footer.php to catch the output and write it to an html file. Then I load this file if its less than 2min old. It makes a HUGE difference. Id recommend anyone with a heavy front-page to do something simular.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum