HAProxy to smooth things out
For a long time I've run a rails app behind nginx with 3 mongrels in a round robin configuration. It has worked for me pretty well. Recently I've added a few longish running reports and doubled my user count, and I've seen some sluggishness on my app. The issue is not that the 3 mongrels can't handle the load, the issue is that sometimes the requests get stacked up behind the long running process when there may be a couple of free mongrels just sitting there.
This is where HAProxy comes into the picture. HAProxy is an open source tcp/http load balancer. The magic that it gives us is the ability to only allow one connection at a time to our mongrels. So, if we have one long running process going, that mongrel will be skipped and the other 2 will be used until the first frees up. I've just started using this, but I think that it is making a difference already. You can watch a nice screencast from Mark Imbriaco of 37 signals on this approach.
My setup:
nginx ----> HAProxy ----> mongrels
MyDaddyPuzzles and Extreme Makeover Home Edition update
Just posted a couple of pics from the final setup of the Extreme Makeover Home Edition puzzles. You can see them here towards the bottom of the page.
Scores on BroncoDashboard.com
I've added a new page to broncodashboard.com. I'm grabbing scores for the WAC games and other teams that I find interesting so that I can check them in one place. It is kind of a personal scoreboard, but I thought I'd put it out there for the general consumption.
MyDaddyPuzzles and Extreme Makeover Home Edition
MyDaddyPuzzles are being used in the upcoming Season Premier of Extreme Makeover Home Edition. You can read about it here.
Mini Server -- looks like bad hd
redirecting uploads to merb
I have a rails app for which I am using merb to handle the file uploading duties. I am using nginx as the webserver to proxy to the rails app. So here is the little bit of config from the nginx.conf that grabs the url that matches and sends it off to merb. This bit of code is in the location block.
if ($uri = /upload/acceptor) {
proxy_pass http://applicationserver:4010;
break;
}
New style web content
I really like what these guys are doing with the web. They can put links into small windows that pop open and give you extra information about things on the page, but you stay on the page and you get nice control over the linked content. Very nice way to have supplementary info linked on a page.
Broncodashboard updated for 2008 --mostly
I spent the day today updating Broncodashboard.com for the 2008 season. This entailed adding support for multiple seasons, redoing the widget and the feed that supplies info to the widget and adding logos and some details on the new schools on the schedule.
I still need to add all of the schedules for the opponents, so the full schedule link is still showing the 2007 season. All in all a good day.
bash cdpath magic
While perusing the bash man page today I found something pretty interesting. There is a variable that you can set in your .bash_profile file that is a search path for the cd command. That means that you can create a path with your most used cd locations and you can always get to those locations with a simple cd <foldername>. I added my work directory for web applications:
export CDPATH=.:~:/Users/jkay/Sites
Now a simple cd essence will get me to /Users/jkay/Sites/essence from anywhere.
Xserve smb file sharing blues
I have an Xserve at work that I bought with a terabyte drive so that I could share files to Windows XP Pro sp2 users. I have had a lot of issues when trying to serve home drives to people (I also have some public shares that seem to work ok). This would be a user specific share for their work files. The permissions should be read/write for the specified user and nothing for anyone else. We get a lot of errors about not being able to find the network path and the path already being used. I'd had it, and so I decided to try something pretty extreme.
The setup that I'm now testing is publishing the share over nfs to a linux box and then using samba to share it to the windows clients. I've set the nfs server to map all uids to nobody and the nfs is only mountable on the linux server that shares it out over smb. So far so good.
Here is the samba share configuration, the nfs is mounted to /home/jkay_h
[jkay_h]
path = /home/jkay_h
hide dot files = yes
writable = yes
printable = no
guest ok = no
valid users = jkay
force group = hdrives
directory mode = 770
create mode = 770
view http headers
If you have a need to see http headers, which I did recently, you can use
curl -I http://url.here
mtn west ruby conf day 2
Things to check out:
