Quantcast

Ruby on Rails, Io, Lisp, JavaScript, Dynamic Languages, Prototype-based programming and more...

Technoblog reader special: $10 off web hosting by FatCow!

Monday, July 02, 2007

Advanced Concepts in Ruby on Rails Hosting Part III

In our discussion of distributing web requests to different servers via the analogy of a translation company, we ended up last week with a question. To recap, the analogy compares application serving computers to translation offices and instances of the application as translators. Further, a manager (reverse proxy) sat in front of the offices distributing tasks to each office. Last week we realized that to increase efficiency of our translators, we could put a manager in each office in order to buffer requests. That way, any individual bottleneck could not hold up the queue from being processed. For distributing web requests, I created a reverse proxy called drproxy to do exactly this.

These types of systems can be found over and over again in the real world. Just this weekend I was in line to order a polish dog from Costco. There was a single line with two servers processing the line. I watched as a father couldn't get decisions from each of his three children, yet the other server's booth moved along smoothly and brought me closer and closer to the polish dog. You can find similar lines at Nordstrom Rack, Fry's Electronics, any restaurant, and many other locations.

One system that works like the less efficient "round-robin" method described a few weeks ago are lines found in grocery stores. You get in a line praying that the people in front of you don't like to write checks or count out change because if they take their time, they hold you up. How many times did you choose what looked like the fastest checkout line only to watch people go through other lines faster due to one price-check on isle five? Some grocery stores have started implementing self-checkout systems. I find that whenever given the choice, I tend to go directly to the self-checkout because it is always faster. One of the reasons it is faster is because there is a single line for four checkout machines. You could get one person counting change, one person doing a price-check and still have two machines checking people out smoothly. It is amazing that grocery stores have not realized this and implemented better line processing.

The question I posed at the end of last week was whether there was an even more efficient way to distribute requests. I propose that there is. Here is why: just as any individual translator might get a backed up queue of requests, translation offices could become overwhelmed. Based on pure probability, one office might build up a queue of 100 requests while another might sit there queue-less. There are a few ways to tackle this problem, but whichever way you choose to handle it, you must know the size of the queues in each office at any given time. Given this knowledge, you could choose to only hand requests to the least busy of the offices. I am not a big fan of this approach because it seems like you could imagine situations where large groups of documents go to the same office in a row and I like to distribute requests randomly to prevent buildups and attacks on the system. The way that I implemented drproxy to distribute requests was by randomly picking any off! ice, except for the busiest office. If one office builds up a backup of requests and the others have no requests, no new requests will be sent to the busy office until it frees up. This load balancing system works very effectively.

I hate to do this to you again, but can you think of any other major bottlenecks in our system? I can.

You should follow me on twitter here.

Technoblog reader special: click here to get $10 off web hosting by FatCow!

6 Comments:

Blogger Zhenhong Bao said...

longchamp handbags
coach outlet
true religion canada
oakley sunglasses
mulberry handbags
reebok shoes
burberry outlet
ralph lauren outlet
ralph lauren polo
ralph lauren
hermes belt for sale
versace sunglasses on sale
fitflops clearance
nike air max 90
thomas sabo outlet
pandora outlet
tory burch outlet
coach outlet
kobe shoes
oakley sunglasses
ghd hair straighteners
ray ban sunglasses
coach outlet online
tory burch shoes
coach outlet
ralph lauren outlet
mulberry handbags
michael kors outlet online
discount oakley sunglasses
burberry sunglasses on sale
ralph lauren pas cher
replica watches
oakley sunglasses
chrome hearts outlet online
longchamp pliage
20160531zhenhong

6:21 PM, May 30, 2016

 
Blogger Tachra door said...


کرکره برقي
درب اتوماتيک شيشه اي
درب اتوماتيک
جک پارکينگ
جک پارکينگي
تعميرات
کرکره برقي
درب اتوماتيک شيشه اي
درب اتوماتيک
جک پارکينگ
تعميرات
قطعات خودرو
طراحي دکوراسيون
دکوراسيون داخلي
جک پارکينگ
جک پارکينگي
سئو سايت
طراحي سايت
درب اتوماتيک شيشه اي
درب شيشه اي

4:02 AM, July 28, 2016

 
Blogger Duc Le said...

AZ Lâm viên complex | Tiện ích sống ở Center Home trương định | hộ gia đình Chung cu Five Star cau giay | cư dân giá bán Chung cư 289 Khuất duy tiến | quỹ căn hộ Giá bán chung cư 304 hồ tùng mậu | đi tìm Giá bán chung cư 379 đội cấn | ra đi Giá bán chung cư 41 lê văn lương | thấy Giá bán chung cư 63 nguyễn huy tưởng | Tiến độ Giá bán Chung cư ANh quân strong | Giải ngân Giá bán Chung cư Ct3 nghĩa đô | thu tiền Giá bán Chung cư Green Pearl | mua nhà Hateco Plaza | Chia sẻ dự án N01 T1 ngoại giao đoàn | tìm hiểu về N01 T2 ngoại giao đoàn | cơ hội đầu tư N01 T3 ngoại giao đoàn | an cư lâu dài N01 T4 Ngoại giao Đoàn | hợp tác kinh doanh N01 T6 Ngoại Giao Đoàn | để ở nên chọn N01 T7 Ngoại Giao Đoàn hướng dẫn thủ tục mua bán N01 T8 Ngoại Giao Đoàn | làm việc tại N02 T1 Ngoại Giao Đoàn | mua bán N02 T2 Ngoại Giao Đoàn | Đơn vị tư vấn N02 T3 Ngoại Giao ĐOàn | nhân viên tư vấn N03 T1 Ngoại Giao ĐOàn | Tòa nhà N03 T5 Ngoại Giao Đoàn | Khai trương N03 T3 Ngoại Giao ĐOàn | ngày mở bán N03 T6 Ngoại Giao Đoàn | Nội thất bàn giao N03 T7 Ngoại Giao Đoàn | Căn góc hướng hồ N04b Ngoại Giao đoàn | Đặt cọc Chung cu nha xuat ban chinh tri quoc gia | NT COmplex đầy tiềm năng | Rice city | Giá bán chung cư số 1 giáp nhị sinh lời khủng | Giá bnas Chung cư Số 4 huỳnh thúc kháng | đặt cọc Giá bán Chung cư số 6 lê văn thiêm |

9:25 PM, August 12, 2016

 
Blogger Fangyaya said...

abercrombie and fitch
tod's shoes
ugg boots uk
jordan 13
michael kors handbags
ugg outlet
uggs uk
toms shoes
uggs
michael kors outlet
canada goose jackets
coach outlet store online clearances
michael kors outlet clearance
louis vuitton outlet
canada goose outlet
michael kors handbags
oakley vault
louis vuitton handbags
ugg boots
michael kors outlet
the north face jackets
gucci outlet
louis vuitton outlet
louis vuitton outlet stores
michael kors handbags
celine handbags
christian louboutin outlet
true religion outlet
adidas nmd
chenyingying20160908

6:56 PM, September 07, 2016

 
Blogger Fangyaya said...

beats outlet
abercrombie & fitch
toms shoes
michael kors handbags
ugg outlet
coach outlet store online
toms shoes
nike outlet
cheap uggs
louis vuitton outlet
kate spade handbags
coach factory outlet
michael kors handbags
nike tn pas cher
ugg boots
adidas uk
insanity workout
canada goose coats
gucci belts
coach factory outlet
cincinnati bengals jerseys
louis vuitton
louis vuitton
chicago bulls jerseys
giuseppe zanotti sandals
gucci uk
uggs outlet
uggs outlet
adidas ultra boost
chenyingying20160908

7:18 PM, September 07, 2016

 
Blogger Quá Đã said...

chơi game trên laptop vltk mobile hay nhất hiện nay tai game online để có thể nhận được nhiều điều khác và có thể tai game lmht cho iphone

7:54 PM, September 18, 2016

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home

 

If you like this blog, you might also like top photography schools.