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
https://forums.phpfreaks.com/topic/86196-looping-ajax-question/
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
https://forums.phpfreaks.com/topic/86196-looping-ajax-question/#findComment-447001
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.