+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Overload Script

  1. #1
    taha116's Avatar
    taha116 is offline x10 Lieutenant taha116 is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    497

    Overload Script

    I am looking for a script that is simple and will automatically display a message if my site is experiencing a server overload, say basically if a page wont load for longer than 30 seconds it will say that automatically


    Need help with starting up your website? No problemo PM if you need help, if you want help with scripts like WordPress, SMF and so on dont be afraid to PM for that too.


  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Overload Script

    I think this will work:
    Code:
    <html>
    <head>
    <script type="text/javascript>
    var t = setTimeout("timeout()", 30000); // function timeout() will be called after 30000ms (30s)
    function timeout() {
         var node = document.createTextNode("This is your error message");
         document.getElementById("error").appendNode(node);
    }
    </script>
    </head>
    <body>
         <p id="error"></p>
         <!-- other stuff will be happening here. Hopefully it will time out here and not sooner :) -->
         <script type="text/javascript">
              clearTimeout(t); // cancel the error script
         </script>
    </body>
    </html>
    I would consider using a value significantly less than 30. Maybe 5-10 seconds. Most users won't wait 30 seconds for a page to load, browsers will stop trying after too long, and the server will kill the script if it takes too long.. If the server doesn't output enough of the page, this script will also fail. The only time it will work is if you have a server side script that takes too long, either due to server load or the script taking too long.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    zen-r's Avatar
    zen-r is offline Lord Of The Keys zen-r is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Location,Location. Nothing else matters ....apparently.
    Posts
    1,937

    Re: Overload Script

    Wow!

    As usual, garrettroyce doesn't just answer questions for people, he completely obliterates the question. Even producing all the coding isn't too much trouble for him. Nice.

    I'm tempted to ask him to solve the Meaning of Life for me, when he's got a spare minute. ;)
    For great installation & servicing of Audio Visual systems & equipment
    inc. LCD & Plasma Screens, Loudspeakers, Projectors, Aerials & Satellite Dishes, Lighting effects & controllers, Hifi, Amplifiers, Surround Sound, Home Cinema & Video etc
    -: based around Plymouth, Devon, or anywhere in the southwest of the UK, visit :-

  4. #4
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Overload Script

    42.

    Now, you just need the question (any Hitchhiker's guide to the galaxy fans?)

    I've been thinking some more about your problem. My guess is you want to have something if X10 is having problems, not because your site is running some really really massive program. In that case, I think you would be better using multiple hosts and providing the nameservers of both hosts to your domain registrar.

    I'll walk you through this process if I'm right ;)
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  5. #5
    zen-r's Avatar
    zen-r is offline Lord Of The Keys zen-r is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Location,Location. Nothing else matters ....apparently.
    Posts
    1,937

    Re: Overload Script

    For great installation & servicing of Audio Visual systems & equipment
    inc. LCD & Plasma Screens, Loudspeakers, Projectors, Aerials & Satellite Dishes, Lighting effects & controllers, Hifi, Amplifiers, Surround Sound, Home Cinema & Video etc
    -: based around Plymouth, Devon, or anywhere in the southwest of the UK, visit :-

  6. #6
    taha116's Avatar
    taha116 is offline x10 Lieutenant taha116 is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    497

    Re: Overload Script

    Can you elaborate on your idea? I think im following you but not sure...

    And serisoly, if you dont have the answer no one does, what is the meaning of life


    Need help with starting up your website? No problemo PM if you need help, if you want help with scripts like WordPress, SMF and so on dont be afraid to PM for that too.


  7. #7
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Overload Script

    The idea is, if your page starts to load then stops for a long time, an error message will pop up. This will not work, however, if the server is so overloaded and the connection times out. The only time it will probably work is if your script takes too long to execute.

    What you can do is have another hosting account at another free host and use both at the same time to display your site. So, if one goes down, the other will still work. However, if you do this, then you have to keep them up to date with each other. If you have a forum, this becomes impossible; just go to paid ;)
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  8. #8
    taha116's Avatar
    taha116 is offline x10 Lieutenant taha116 is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    497

    Re: Overload Script

    lol, i see the problems with it and they look like they wont allow me to do that, awesome as the idea is. Could i have it redirect to a link of my chosing if the server were to time out or is that not possible?

    BTW I would really love your help in developing my MMORPG
    Last edited by taha116; 06-11-2009 at 08:33 PM.


    Need help with starting up your website? No problemo PM if you need help, if you want help with scripts like WordPress, SMF and so on dont be afraid to PM for that too.


  9. #9
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Overload Script

    Instead of outputting text to the browser, you could redirect. But, I think you will have the same problems as before. The primary problem for pages is the server does not output anything, not the server only outputting half a page.

    I'd be happy to help you with your mmorpg, just as soon as I'm done with my own project ;)
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  10. #10
    taha116's Avatar
    taha116 is offline x10 Lieutenant taha116 is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    497

    Re: Overload Script

    Ok how long would that project take?

    Im bracing myself for a very far away date
    Last edited by taha116; 06-11-2009 at 10:35 PM.


    Need help with starting up your website? No problemo PM if you need help, if you want help with scripts like WordPress, SMF and so on dont be afraid to PM for that too.


+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. [OFF] selling some hot script 500 credits each
    By neteater in forum The Marketplace
    Replies: 8
    Last Post: 03-24-2009, 09:08 PM
  2. CRON job : script timeout ?
    By webtomata in forum Free Hosting
    Replies: 4
    Last Post: 09-12-2008, 04:23 PM
  3. Access to 300+ PHP scripts (2500 credits)
    By jonathanyaniv in forum The Marketplace
    Replies: 11
    Last Post: 06-03-2008, 10:58 PM
  4. Replies: 8
    Last Post: 12-03-2007, 04:12 PM
  5. Server UP time Script
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-03-2006, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers