Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing an Online Waiting Room

My organization is building a new version of our ticketing site and is looking for the best way to build an online waiting room when the number of users in our purchase path exceeds a certain limit. The best version of this queue would let new users in after existing users have either completed their purchase or have exceeded a timeout limit after entering the path.

I'm trying to get an idea of how this has been implemented by other organizations. Has anyone out there done something similar or have any experience with this? We have some ideas, but I'd like to get a sense of what solutions have been tried and what problems those solutions have run up against.

Just to be complete, this site is being built in Ruby on Rails, though I'd love to hear about how people have solved this regardless of platform.

Edit: To clarify: The need for the queue is not primarily to reduce load, but to limit the speed at which the web is purchasing tickets relative to people buying in other ways, like over the phone.

like image 663
saalon Avatar asked Apr 19 '10 18:04

saalon


People also ask

What is virtual waiting time?

Virtual waiting time Vt means the time which a customer would have to wait for service if the customer happened to arrive at time t (in a FIFO queue). Vt is the time it takes to discharge the unfin- ished work in the queue, Xt, i.e., Vt = Xt/C.

How does a website queue work?

Visitors are given a place in queue before they're throttled back to the site or app at the rate you choose. The virtual waiting room lets you control online traffic to prevent website crashes while delivering a fair and seamless experience for users.


2 Answers

Before I outline one method for this, I want to point out that what you want to do doesn't make a lot of sense. Services on the web aren't like a physical store, where I can walk up and see that it's crowded and decide to stay or not. Queueing people on your site strikes me as shifting the blame from you (unable or unwilling to adequately provision resources) to me (punishing me for trying to use your site).

If you're selling something like show tickets, where quantity is limited and each item is tied to a seat, I think it's better to reserve items and time out those reservations if they aren't paid for in a timely manner. Ticketmaster does this, and I think it's a much better solution than blocking people at the door.

If you still want to go down this path, then I'd design the system like this:

As customers come to your site, record their arrival time. As they interact with the site, record a "last seen" time. "Last seen" will be used to determine activeness. You'll need a background job running very frequently to expire sessions quickly.

Once your limit is hit, you have an ordered queue of people who are blocked. As customers complete their transaction or time out, you'll mark the next person in the queue for entry into the purchase path.

For queued users, their browsers will make a request on a regular basis, checking to see if you've let them in yet. If yes, they proceed to the purchase path. If no, they continue to wait.

The purchase path needs a mechanism to check if someone is trying to circumvent your waiting area, and sends them back.

like image 108
Steve Madsen Avatar answered Sep 19 '22 18:09

Steve Madsen


You might find the Online queuing for ticketing guide helpful. Check their repository at GitHub.

They've integration with Ruby On Rails, PHP, .NET, iOS, Android and similar platforms.

Queue-it enables you to gain control of website overload during extreme traffic peaks by offloading end users into an online queue.

When a peak traffic event occurs on a website, the online queue system sends users to the virtual waiting room environment where the users wait and are redirected back to the website at a rate it can handle.

like image 40
Camilla Ley Valentin Avatar answered Sep 20 '22 18:09

Camilla Ley Valentin