4 ms·
I do run them on the same machine for userscripts.org - although I have used them on seperate machines on other projects - nothing public though :) I use Nginx
by anotherjesse 18y ago
I do run them on the same machine for userscripts.org - although I have used them on seperate machines on other projects - nothing public though :)
I use Nginx for things like serving from memcached (someone else commented on that), rewrite rules, redirects, logging, ...
Also Nginx is good because I have 5 different virtual hosts on the box, so I can proxy to different app servers based on hostname/location.
Here is my commented nginx config for userscripts.org:
http://pastie.textmate.org/private/rmp4b9xpwevxnckumxmq0a
Here is my haproxy config for userscripts.org:
http://pastie.textmate.org/private/rbxzpeu7e0gjkkc6r04ta
Nginx does have weighting options, but I was unable to get the affect of having only 1 request hitting an app server at any time (it could be possible, but switching to HAProxy was easy, and in a month I've not had a second of down-time, and I restart all the app servers every hour via log rotate) Not having request queue at the app server level helped, combined with HAProxy pinging for health between requests has lead to faster requests, as queueing at the app server level leads to delays if you get behind a slow request.