Results 1 to 5 of 5

Thread: Universal Countdown - Servers ability to handle significant simultaneous loads?

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Universal Countdown - Servers ability to handle significant simultaneous loads?

    Re Script:
    http://www.dynamicdrive.com/dynamici...lcountdown.htm

    Question:
    Hi

    I have managed to get the universal countdown script to work.
    My main concern is how this script will impact server resources in the event that many (thousands) of simultaneous users access the site, considering that the time is updated fom the server every second as per below code:

    setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second

    Will the server resources be incrementally used up with each additional simultaneous user who access the web page with this countdown timer, and eventually lead to a server crash if too many users access? Or is the amount of users a non-issue?

    Any feedback is much appreciated.

    Thanks
    MG

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Nope.

    The server is only accessed once per page load for the time. After that, it is the user's CPU that does all the math and all the display changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks

    That begs the question: if the user has a slow cpu or if the cpu is being used by other large programs - is it possible that over a period of time the countdown accuracy may be affected?

    Ie. Shouldn't I use this countdown if I want to be guaranteed that all users have exactly the same countdown time?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    They would have to have a pretty crappy CPU and/or it would have to be really overloaded, but things could get out of whack. However, this wouldn't effect subsequent visits to the page. Generally, if things got so bad on the local machine that it couldn't keep up with updating a whole number value once every second, the user would have much worse things to worry about than if they were keeping proper track of the countdown or not. In all likelihood, they would need to close some programs at the very least, perhaps reboot. If closing programs took care of the problem, the countdown would probably catch up, or be off by a few seconds, but only until they either refreshed or revisited the page.

    How crucial is the matter of timing here? Must everyone jump in the air at the same moment to see if that alters the earth's trajectory? If this is some mission critical event, you would need to get everyone an absolutely accurate clock and synchronize them. Even then, you couldn't account for possible lack of dedication on a given individual's end, how that might affect the timing.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Regarding the server potentially being bogged down, like John said, since this is a client side script, all the processing is done in the client's computer for each individual browsing that page. If he/she has a really slow computer, usually what happens is that the script will start to skip in between seconds, so you might see something like "3:08, 3:11, 3:15 etc". The time itself may still be accurate for each update, but the script is no longer updated every second. Each browser behaves slightly different though, so don't time your rocket launch to it like John says.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •