开发者

serving and load balancing for Rack-based web services?

as part of our architecture, we are using internal-only HTTP-based web services for data access which needs to be shared across applications. currently they are implemented as Sinatra apps.

on each web service machine (hosted in EC2) we are using haproxy to load balance requ开发者_运维问答ests, and thin to serve them.

i'm curious about what is considered the current "best practice" for serving these types of applications, especially when there is no static content.

are there benefits to using nginx and/or unicorn in this setup? i've seen some suggestions about using both nginx and haproxy at the same time, but am not sure about what value that adds.


If you're serving HTTP traffic through HAProxy, the advantage over Nginx is the ability to inspect, modify and react differently to each request based on the headers, url, cookies, and other information in the packets.

Nginx can also do some interesting things, but in most cases if you're not actually serving content with Nginx, its use will not surpass that of HAProxy.

As for your question regarding best-practices, it all depends on what you're trying to do. I've seen setups where HAProxy is configured to load-balance to a dozen Thin servers where only half are available at one time, while the other half become available during peak hours (based on # of connections). This is especially good if you're using EC2 instances which can be fired-up on the fly, to avoid paying for resources you're not using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜