Welcome to Geeklog Saturday, June 25 2022 @ 01:01 pm EDT

Geeklog Forums

Geeklog server hanging with 80+ guest users opening site


Status: offline

Rick78

Forum User
Regular Poster
Registered: 20/10/03
Posts: 98
Hello guys,

My Geeklog server has become real slow and froze sometimes. I host www.flagfootball.dk and occasionaly we have announcements on TV saying to have a look at info on our page. This is usually live during a NFL football game. As soon as it gets announced, the number of guest increases quickly. As soon as my server gets to 80 and above, it gets real slow and then stops.

What can be done to stop this?

The info in the Index.php is not updated that often. The static page linked to from the index, is also quite static and does not get updated.

I was thinking about some caching of the PHP, but I have never worked with this.
Any help is greatly appreciated.

Thank you very much,
Rick
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 12/08/02
Posts: 300
If you run your own server install Turck MMCache. It is easy to install and speeds all dynamic pages up. It is in many instances better than the Zend Accelerator.

TomW
 Quote

Status: offline

ByteEnable

Forum User
Full Member
Registered: 20/10/03
Posts: 138
Dude, your html from your index page is 178K ! Of course its going to be slow.

File Sizes:
HTML: 91447
Images: 67670
Javascript: 0
CSS: 19661 ----> My god a 20K CSS!
Multimedia: 0
Other: 0
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
This FAQ entry may also help.

bye, Dirk
 Quote

curious

Anonymous
Whats even on that site that would attract that many vistors
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 20/10/03
Posts: 98
Hi Guys,

Thanks for the feedback.
I wonder how you figured out how big this page was and what is CSS? How do I get that to be smaller.

I had a friend make a PHP cache function, but the only problem with it is that users cant log in, because they just get the same cached page back after they click login. Of course, they can log in, and I can see the user name in online users, if I click on another page than the index.
I wonder if someone know how to turn the cache off if the user logs in. There must be some parameter to look for.
Is there a way to limit the number of stories listed on the front page?

We announce flag football tournaments. There are a lot of players watching the NFL game when they announce it live and show the link.

Regards,
Rick
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 20/10/03
Posts: 98
Here is the function he made:

function is_cache_valid($fname) {
$cachetime=300;
$finfo = stat($fname);
if ($finfo["mtime"]+$cachetime return false;
else
return true;
}

function start_cache($cached_file=false) {
if (!$cached_file)
$cached_file=md5($_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
global $cachefile;
$cachefile="/var/tmp/phpcache/$cached_file";

if((!file_exists($cachefile))||(!is_cache_valid($cachefile))) {
// is_valid validates the cache, you can check for expiration
// or particular conditions in that function.
// If there's no file or it's invalid we generate the output
ob_start();
ob_implicit_flush(0);
} else {
//Output the file here we are sure the file exists.
// print("Cache display
n");
readfile($cachefile);
exit (0);
}
}
function end_cache() {
global $cachefile;
if (!$cachefile)
return;
$contents = ob_get_contents();
ob_end_clean();

$fil=fopen($cachefile,"w+");
fwrite($fil,$contents,strlen($contents));
fclose($fil);
// print("Cache build
n");
print($contents);
}
?>
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
About the image/css size: take a look over here:here and find out more. For more information: use the Developer Toolbar from the absolutely freat Firefox browser.

BTW: loading time with 56K modem: 36.62 seconds.....Caching won't help you about that, first optimise the images and css!
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 20/10/03
Posts: 98
Thanks for the link beewee. I can use that info.

I do not really understand why that CSS is so large. It is default with the IVY theme. I get real confused when I am looking at that CSS stuff. Is there an easier way than vi editor for making/editting these CSS pages?

On another note, I know that 99.5 % of our users are on broadband cable or ADSL. I do not see why this would be a problem. I was thinking it was more like a database connection thing or something. I mean that these users did not come on at the same exact time, and many of them were on other pages than the index. However, each time they click on something in the site, the blocks and everything had to be PHPd again. Wouldn't these database connections be more of the problem?
More info :
I have a 768kb upstream line with 4Mb down.
Could it be something in my httpd.conf file ?

I would like to try something by tomorrow. I expect to be hit again during the NFL showing.
Thanks again,
Rick
 Quote

All times are EDT. The time is now 01:01 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content