Link to home
Start Free TrialLog in
Avatar of breeze351
breeze351

asked on

Out of resouce message

I am getting the following error message:

Resource Limit Is Reached
The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.

The page displays a list of street addresses.  If you hit the + button, you can walk up the street.  This only happens on my machine in IE after you have gone up about 30 blocks, but others are having the same problem after only 10 blocks.  It doesn't happen in FireFox (my default browser).  

When you hit the plus button, it goes to another page, adds to the address # and reloads the same page with new data.  Am I forgetting to close something?
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Please post a link to the URL that demonstrates the problem, thanks.
Avatar of breeze351
breeze351

ASKER

This is going to be tough to duplicate.  I've only had it happen to me once.  The client says that it happens every time when he clicks the "address +" button more than 9 times.

But here is the info.

URL: http://lansco.langsystems.net/
Login: breeze
Password: 351clv

Click "Walk By Map"
Street #: 50
Street Name: mad
(50 Madison Avenue)

Keep clicking "Address +".  It will walk you up Madison Avenue.  

I know there are some problems with some of the displays, but that has to do with the data.  The client sends out people to look at the block and they are supposed to report what stores are there and how much of the block they occupy.

I've attached the code for this.
Walk-Map-Display.php
Avatar of Rob
The error is returned from Walk-Map-Plus.php (and Walk-Map-Minus.php) before the redirection even takes place to Walk-Map-Display.php

What's in those files?
It is possible this could be a hosting issue as well.

You don't mention a 508 error but it has the symptoms of one and is worth checking out.

This article might shed some light - although it centers around WP the principles remain the same

http://www.geteverything.org/resource-limit-is-reached-issue-in-wordpress-how-to-fix-it/
I contacted the host and was told:

"If you have a low traffic website but are constantly at 20 entry processes, it means something is wrong with your scripts and they are hanging around longer than they should."

That leads to the following question.  Does this mean I have some scripts without "exit()" as the last line in the script?
Scripts that do not logically loop or wait should not need a separate exit or die() statement.  That is typically only used to interrupt processing.
That's what I thought.  I'm not doing any looping or waiting in any of the scripts on this site.
The logic behind this is:

1. Keyin an address - Walk_By_Map.php
2. Display all the stores on the block where the address was found (or closest).  - Walk_Map_Display.php
3. When the user clicks the "address +", execute Walk_Map_Plus.php. This finds the next northern block and executes Walk_Map_Display.php.

Like I said previously, this is the only place it happens.  What else could be the problem?

Thanks
Were not going to know until you can tell us what's in the Walk_Map_Plus file as that's where the issue is
Ok in Walk-By-Map-Inc.php, I have to rule out the following so bear with me:

- Move the <?php to the top of the page
- mysql_close($mysql); should be mysql_close($conn);
- move mysql_close($conn) to above the output of the header
- remove exit;

Note: you are using the mysql extension which is now obsolete. You should move to mysqli or PDO
I will do as instructed, however a couple of comments/questions:

From what I understand the mysql_close is redunant since the connection get's closed when the script completes.  And I did see the close with the wrong resource last night.

The exit I added just for the hell of it to try.

I'll let you know tomorrow.

Thanks
I've taken the code from "Walk_By_Map_Inc.php" and put it into "Walk_Map_Plus.php".  This gets rid of any problems with the inclusion.  I'm still getting the error.  This leads me to believe that the problem is in "Walk_By_Display.php".  What does it actually mean when Hosting24 says that "something is wrong with your scripts and they are hanging around longer than they should."?

Attached is the new version of "Walk_Map_Plus.php"

Thanks
Glenn
Walk-Map-Plus.php
I disagree.  When it fails for me it doesn't get as far as sending the header to redirect Walk_By_Display.php

See my dev tools monitoring in the screenshot below.  You'll see that when it fails it doesn't redirect

User generated image
Another thing to try is setup your Walk_Map_Display.php to include either Walk_Map_Plus.php or Walk_Map_Minus.php or nothing depending on a variable you pass it.
You could try this and hopefully you get the error and you'll know what line failed

<?php
$counter=1;
echo "get here: ".$counter++."<br/>";
include 'Session_Start.php';
echo "get here: ".$counter++."<br/>";
include 'Check_Login.php';
echo "get here: ".$counter++."<br/>";
include 'db_connect_inc.php';
echo "get here: ".$counter++."<br/>";

// ****************************************************
// * Get data from original page,                     *
// ****************************************************

$strt = substr($_SESSION['Data'],0,9);
echo "get here: ".$counter++."<br/>";
$work = $strt."%";
echo "get here: ".$counter++."<br/>";
$address = $_SESSION['Address'];
echo "get here: ".$counter++."<br/>";

// ****************************************************
// * Incerment North                                  *
// ****************************************************

$north = $_SESSION['North_North_Button'];
echo "get here: ".$counter++."<br/>";
$south = $_SESSION['North_South_Button'];
echo "get here: ".$counter++."<br/>";
$east = $_SESSION['North_East_Button'];
echo "get here: ".$counter++."<br/>";
$west = $_SESSION['North_West_Button'];
echo "get here: ".$counter++."<br/>";


// ****************************************************
// * Select New Address                               *
// ****************************************************

$SqlString1 = "SELECT * FROM mapfile WHERE 
			`NOR` = \"$north\"
			AND 
			`SOU` = \"$south\"
			AND 
			`EAS` = \"$east\"
			AND 
			`WES` = \"$west\"";
echo "get here: ".$counter++."<br/>";
			
$mapfile = mysql_query($SqlString1,$conn);
echo "get here: ".$counter++."<br/>";
$ROW = Mysql_fetch_assoc($mapfile, MYSQL_BOTH);
echo "get here: ".$counter++."<br/>";
$_SESSION['Data'] = $ROW['SEQ'].$ROW['STOREKEY'];;
echo "get here: ".$counter++."<br/>";
$_SESSION['Address'] = $ROW['BNMB'];
echo "get here: ".$counter++."<br/>";
mysql_close($conn);
echo "get here: ".$counter++."<br/>";
//Header("Location: Walk_Map_Display.php");
echo "<a href=\"Walk_By_Map.php\">Continue</a>";
?>

Open in new window

Rob:
No joy.  I started at 100 Madison Ave (between 29th and 30th).  The first time it got up to between 67th and 68th before it blew up.  I did it again starting at 100 Mad and made it all the way to the end of Madison Ave (somewhere in the upper 90's) with out blowing up!!!!!  The third time it blew up in the 40's.

I'm not sure what you meant by this comment:
"Another thing to try is setup your Walk_Map_Display.php to include either Walk_Map_Plus.php or Walk_Map_Minus.php or nothing depending on a variable you pass it. "

I don't know if it's plus or minus until you click the button so there is nothing to pass.
Rob:
I modified the code to display the counter.  Forgot that in the last message.
Yes i got it to crash as well but at least we've identified that it is Walk_Map_Plus

User generated image
i think you'll find this could be unrelated to your code as is a memory limit imposed by your web host.  Have you contacted them about the issue?
I contacted "Hosting24".  Would this work?
CPU Speed: 2000 Mhz
Memory: 2048 MB
Disk Space: 20000 MB
Bandwidth: 2000 GB
Connection: 40 Mb/s
Dedicated IPs 2 IPs
I wouldn't think this is solely hardware. More a configuration issue in apache or whatever web server they're running
If it's running on anything less then yes that would be min specs required
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Upgraded to a VPS and problem went away