Yes I know I still haven't done part two of that mail server post. I'll get it done soon, I promise.
While chatting on IRC, someone mentioned that they were having a problem with a process going mental and creating a bunch of file descriptors in linux, eventually hitting the "max FD limit" linux has. They couldn't figure out which process it was and they couldn't find a program that would list a count of how many FDs a process has open. A few minutes later I'd thrown together this bash one-liner for him. I'm posting it here just in case someone else might find it useful.
echo "$(for pid in $(ls -a /proc|egrep '^([0-9])*$'|sort -n 2>/dev/null); do if [ -e /proc/$pid/fd ]; then FHC=$(ls -l /proc/$pid/fd|wc -l); if [ $FHC -gt 0 ]; then PNAME="$(cat /proc/$pid/comm)"; echo "$FHC files opened by $pid ($PNAME)"; fi; fi; done)"|sort -r -n|head -n4
To explain: It loops through every file/folder in /proc that is a process ID, then checks that there's a file descriptor folder. Then it gets a count of all the FDs that process currently holds, gets the process name and outputs how many file descriptors that process has open, as well as the process name. This is then reverse-sorted and cut down to only the four processes with the most FDs open.
So a few months ago, I moved my primary mail hosting to my own VPS. Over the months since then, I've been tweaking and adding to my mail system, and I figure it'd help both myself and others if I documented what I've done, so I'll start with a list of all the software I use.
In the near future, I'll write a second post detailing how I linked all this together, including config excerpts, but in this post I'm just discussing the software I used, as well as why I use each package. I'll also leave you with a list of extremely good tips.
One final thing to note, the guide and so on will discuss my current mail setup. This means it assumes you'll be using sockets for things like Postgrey. Please read everything carefully before making configuration changes to your own mail setup, as what works for me may not work for you.
That's all for now, but I'll be adding to this list, and writing a second post documenting how I actually set my mail system up, very soon. EDIT: Disregard that. Second part of this post will arrive eventually but I am tremendously lazy.
Since I figure it's bad form to have a blog and /only/ use it for ranting, here's a somewhat useful post. I've been with [a] [number] [of] [different] [hosts] over the past year or two, and I figure it'd be useful for others to know why I like or don't like them.
SimplexWebs has been in the hosting business for quite a while now, and do enterprise webhosting, online radio hosting and domains, as well as VPS (Xen, powered by OnApp) hosting. I was lucky enough to grab one of their limited birthday sale servers, which gave you 256MB RAM, decent CPU speed, 20GB disk and 100GB monthly bandwidth, for Â£25 a year.
This server's basically been my primary server/main workhorse - despite initially purchasing it to run a VPN server, and has held up ridiculously well. Uptime has been fantastic - my server's only been down a few times over the last half a year or so, including migrations between their old SolusVM platform to their new OnApp platform, and including the recent downtime when they moved datacentres.
Server and network speed are really good. I think this is one of the fastest servers I've ever used, and that includes the brief time I was with Linode. Support is fantastic, their team is always quick to respond and very helpful, and you definitely get the feeling that they actually care about their customers. Overall, they're one of the best hosts I've ever been with, and I don't feel I'll ever need to move to another host.
Here's some benchmarks:
~ wget cachefly.cachefly.net/100mb.test -O /dev/null --2012-04-28 02:34:32-- http://cachefly.cachefly.net/100mb.test Resolving cachefly.cachefly.net... 22.214.171.124 Connecting to cachefly.cachefly.net|126.96.36.199|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 104857600 (100M) [application/octet-stream] Saving to: `/dev/null' 100%[======>] 104,857,600 11.8M/s in 8.7s 2012-04-28 02:34:41 (11.5 MB/s) - `/dev/null' saved [104857600/104857600]
~ dd if=/dev/zero of=/tmp/disktest bs=64k count=16k 16384+0 records in 16384+0 records out 1073741824 bytes (1.1 GB) copied, 4.52632 s, 237 MB/s
Bhost are a UK-centric VPS provider, primarily dealing with OpenVZ servers although they've recently launched Xen PV plans. I should mention their servers are some of the cheapest you can get, the cheapest OpenVZ server being Â£4.70 (before VAT) and including 512MB RAM and 512MB burst RAM.
Their support is pretty great, considering they're a budget host, and the servers themselves are quite speedy. I do have some issues with the OS templates they have available - their Arch images are broken due to the host kernel being too old, although I'd say that's an Arch issue, and their Gentoo image is too old to actually use. Debian works fine though, so that's what I'm using. Overall, network and server speed is really good. Uptime is fantastic, in the entire time I've been with them (a number of months now), my server's almost never been down. Definitely one of the most reliable hosts I've been with.
Here's some benchmarks, since I still have a server with them: Network speed:
# wget cachefly.cachefly.net/100mb.test -O /dev/null --2012-04-28 02:30:40-- http://cachefly.cachefly.net/100mb.test Resolving cachefly.cachefly.net... 188.8.131.52 Connecting to cachefly.cachefly.net|184.108.40.206|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 104857600 (100M) [application/octet-stream] Saving to: `/dev/null' 100%[======>] 104,857,600 10.2M/s in 9.8s 2012-04-28 02:30:49 (10.2 MB/s) - `/dev/null' saved [104857600/104857600]