Site Suspended - ways to put less strain on the server..?

Forum
Last Post
Threads / Messages

Arianna

Dev Staff
Staff member
Dev Staff
Joined
Sep 25, 2009
Messages
334
Points
0
Age
27
Mysidian Dollar
13,840
My whole website (keep in mind this isn't just an adoptable website, it's a forum too) was just suspended due to 'the large amount of connections to images such as /twig/adoptables/siggy.php?id=1495'. Yeah, that's right - because of the adoptables script and people viewing images.
I was hosted with WebzPro, but now my account is suspended and I'm devastated. I have two questions for you guys - how do you cope with many people viewing the images, and is there a way to make it so this doesn't happen again? I'm thinking of changing hosts because I really can't get what was wrong - I wasn't even near my alloted bandwidth!
Arianna
 
It's not bandwidth that is the issue, it's the processing power required to load the images from the siggy.php file that is the issue.

Try using the following code in siggy.php instead of the current code:

PHP:
<?php

// Lightweight siggy.php file for laggy server...

// Include our Includes...

include("inc/functions.php");
include("inc/config.php");

// Get the ID of the adoptable image we want to load...

$id = $_GET["id"];
$id = preg_replace("/[^a-zA-Z0-9s]/", "", $id);
$id = secure($id);

if(is_numeric($id)){

// Run a query to make sure that the adoptable does in fact exist...

$num = 0;

$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$id'";
$result = mysql_query($query);
$num = mysql_numrows($result);

	if($num > 0){

	// We've got a valid adoptable here, now get the image to use...

	$image = getcurrentimage($id);

	// Redirect to the image...

	$location = "Location: ".$image;

	header($location);

	}
	else{

	die("The adoptable does not exist or is not valid.");
	
	}



}

?>

It's a special lightweight siggy.php that I use on MyAdopts, which has thousands of requests for signature images. It also doesn't use GD image text, which can eat up processing power very quickly.

Please try this out and let me know if it works better for you. :)
 
Thank you very much, I will replace this now. :)
 
try powerhoster.com if you need a new hosting service, they are very good, and have fantastic plans! ^^
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top