So As some of you know, a while ago I switched from Apache to lighttpd…I mean, youtube uses it right? No doubt a highly modified version. Not long after I get it set up just perfectly, I started reading ALL the horror stories about memory leaks.
Now granted I didn’t run into any memory leaks, but I’m not going to bet for something that is consistently failing all around me. Then I heard of Nginx. Keep in mind this all happened at least a month ago…I just haven’t had time to blog at all. Anyway, it’s supposedly faster than lighty, it’s actually stable and doesn’t need rebooting every night, and it’s russian.
So being the tinkerer at hear that I am, I decided to install it on the beeets.com server. Well, the syntax in in the config file was a bit of a learning curve. It’s sort of like C but not as friendly. A space in the wrong place will make it fail. Needless to say, I got it all configured though. FastCGI, PHP, URL rewriting, client-side caching, and if I need it later on, a kickass reverse proxy.
So I guess this is me saying a few months later than nginx totally kicks ass. It benchmarks so much better than Apache, and it’s russian.
I think the next think I’ll be tinkering with (fucking up) will be MySQL replication. From what I read, it’s better than clustering for a few reasons. You can do things with replication you can’t do with a cluster. The problem is there will definitely be some gnarly code tweaks because nothing supports it by default, at least not that I know of. Oh yeah, plus there’s like, no documentation on writing a PHP app for a replicated database. I know, read from the slave, write to the master, but if you write to the master and immediately need to read a generated value (last id) then you have to read from the master since you can’t rely on the slaves to be kept instantly up to date. That’s a fun code change.