Jump to content

Looping AJAX question


Stooney

Recommended Posts

I have a site where users can bid on items online.  The page that displays the list of items and the current bid and bidder uses an AJAX script that queries a database every 3 seconds for the updated bids.  This is so the user never has to refresh, as well as for the page the business uses to display the auction on TV.  Now with about 100 users viewing this page at the same time, is that too much of a load?  That would be about 2,000 requests a minute.  (100 users, each user would cause 10 queries per 3 seconds.  That's a query for each of 10 items that is displayed).  In the future it could get as high as 1000 users viewing. 

 

Should I make the users refresh manually and only allow the admins/moderators to use the AJAX refresh method? 

Link to comment
Share on other sites

If you are requesting a lot of information for the updated bids, I would call another function first that checks to see if a new bid is available.  For instance, when the page loads, it has an id of 156.  If last bid is still 156, don't refresh bid.  If you don't update a lot of information about the bid, then disregard that.  As for the server load, that is more something to ask your host about. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.