?

Log in

No account? Create an account
Paid user "express lane" - Paid Members — LiveJournal [entries|archive|friends|userinfo]
Paid Members

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Paid user "express lane" [Jul. 8th, 2004|03:22 pm]
Paid Members

paidmembers

[bradfitz]
New paid user feature!

If you're logged in as a paid user, you "cut in line" of other web requests that we've received but not yet generated a response for.

So our load balancer retrieves all incoming web requests immediately after your browser sends them, then sorts those requests into two lines: free users and paid users.

Whenever a real server (not the load balancer) is ready to do more work, it always fulfills a request from the paid user line, and only does free user requests once no paid users are waiting.

We've had this done for a couple weeks, but just put it live today. We were going to wait to announce it until we had the cool part done, but thought it best you all know what's up. The cool part is: we're going to make the load balancer tell the real servers how many seconds/milliseconds you saved by cutting in line and how many people you cut in front of, and then the real servers will add that to the response, so you can do "View Source" in your browser and at the top it'll show you those stats, so you can verify it's working.

This is all different from what we did a few years ago, which was to have "free servers" and "paid servers". Instead all the servers do both free and paid, but access to the servers is prioritized by your account type.

Here are some stats of it in action:
queues
web_proxy-normal.age 0
web_proxy-normal.count 3
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.
queues
web_proxy-normal.age 0
web_proxy-normal.count 0
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.
queues
web_proxy-normal.age 0
web_proxy-normal.count 4
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.
queues
web_proxy-normal.age 1
web_proxy-normal.count 4
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.
queues
web_proxy-normal.age 0
web_proxy-normal.count 3
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.
queues
web_proxy-normal.age 0
web_proxy-normal.count 5
web_proxy-highpri.age 0
web_proxy-highpri.count 0
.


At the top it showed there were 3 free users (waiting for less than a second --- age 0) waiting to get responses, and 0 paid users. Then it was all clear, then 4 new free users were waiting, then waiting up to a second, then those cleared, and 3 new free users were waiting under a second. Then 5 later, still under a second.

But throughout, no paid users were ever waiting.

Obviously the above isn't an interesting demo of this feature, but next time we hit a hiccup and the site gets slow, the paid users will be affected the least, since you won't have to wait in line long for a page to be generated. (just have to wait for paid users that came before you)
LinkReply

Comments:
[User Picture]From: smileydan84
2004-08-23 12:28 pm (UTC)

Re: Hrm...

...but if it just reads it from a cookie, non-paid members will probably try editing it so the server treats them like paid members for that...
(Reply) (Parent) (Thread)
[User Picture]From: thorfinn
2004-09-05 09:09 pm (UTC)

Re: Hrm...

The cookie presumably could contain some sort of hash with a server only known secret in it (or better, a cryptographically securely signed hash), which would prevent cookie editing. It may already do that now...
(Reply) (Parent) (Thread)