Need Testers

Forum Archive - from http://theuniversal.net
Locked
User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Need Testers

Post by leigon »

http://195.137.86.67/gyruss/stats.php

does that page lag for anyone?
User avatar
Fooli
Staff
Staff
Posts: 1957
Joined: Sun Oct 05, 2003 2:38 pm
Location: Mars

Post by Fooli »

Works for me. Sorting is slow, though. Glad to see I'm top of the dead list.

And what's all this "aira" stuff about? :)

("era", I think :)

f
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

wow, thats nice.
anyway i could get a copy of that script when its done?
User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Post by leigon »

yah shure....

I am making a small exe just to refresh the updater ever 10 or so min.
Ya will need a mySQL Database and somewhere to run the exe.
User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Post by leigon »

Ok I have put all the tools I am making including the beta or the world editor on my site...

http://gyruss.no-ip.com

Please visit there and look in the "tools" section.
User avatar
Magicfinger
Staff
Staff
Posts: 1078
Joined: Tue Sep 30, 2003 10:38 am
Location: here,there and everywhere

Post by Magicfinger »

quick suggestion for you leigon...

have you considered caching your page?

Code: Select all

$cachefile = 'mypage.cache';
$cachetime = 60 * 60; // 60 * number of minutes you want to cache for
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
    include($cachefile);
    //echo "<!-- Cached copy, generated ".date('H:i', filemtime($cachefile))." -->\n";

}
else
{
ob_start(); // Start the output buffer
?>
your page content goes here...

Code: Select all

<?
// Cache the output to a file
$fp = fopen($cachefile, 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush(); // Send the output to the browser
}
?>
so basically... if the mypage.cache file exists and isds younger than the time specified then display mypage.cache as the output ... if not then run the code and save it as a new cache page.

this is what i use on the left index of the home page as it gets loads of stats from different files and can lag sometime :)

anyway just a suggestion :)


oh ... btw dont forget to set the directory to writable or it wont work :)
User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Post by leigon »

I made a small local refresher... its simple but makes the whole thing refresh the stats every 1/2 an hour or so. Means no one will lag when they look at the site (hopefully).
User avatar
Mattizme
Posts: 615
Joined: Sat Oct 04, 2003 6:23 pm
Location: At work/school/home
Contact:

Post by Mattizme »

User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Post by leigon »

User avatar
hedgehog
Staff
Staff
Posts: 1057
Joined: Tue Sep 30, 2003 2:57 am
Location: ann arbor, michigan
Contact:

Post by hedgehog »

looks like the host is down :P
User avatar
VDZ
Posts: 1205
Joined: Wed Apr 07, 2004 11:32 am
Location: Netherlands

Post by VDZ »

LMFAO @ amount of deaths XD

The page works for me. It just loads quite slowly.
User avatar
Magicfinger
Staff
Staff
Posts: 1078
Joined: Tue Sep 30, 2003 10:38 am
Location: here,there and everywhere

Post by Magicfinger »

the advantage of using cached pages is that it doesnt need to interpret the php which is slower than parsing html :)
User avatar
Techboy
Posts: 63
Joined: Wed Jan 05, 2005 4:26 pm

Post by Techboy »

Heh, I have a thing about bumping old topics, but I spoke to Leigon about this last week...

Anyway, I was coding up a site-engine sorta thing, and I made a system where every 30 minutes [a port of] cron ran a batch file...

The batch file zipped all the files in the site-engine directory and piped phpwin.exe on a php file (the php file renamed the zip to the date and time in MySQL TIMESTAMP format, then outputted a page containing a list of the backups which had been made previously, which was loaded from another file) to an HTML file. I, of course, was too lazy to implement [a port of] diff, so I was left with like 300 identical backups, but that's another matter...Point is, the same code could help you have the stats file updated every 30 mins/hour. I'm not at home just now but I'll upload the code when I am.
User avatar
leigon
World Owner
World Owner
Posts: 563
Joined: Thu Apr 15, 2004 11:23 pm
Location: UK - Programming under the influance.

Post by leigon »

atualy this is very usefull :)... but cron jobs are much more usefull :P

Every hour on theuniversalstats.com I have set up a cron job to run the php updater... This updates all the information in the database, and updates the hardcore php pages.
Locked