Saturday, September 4, 2010

netfilter statistics match load balancing

I find that there is a dearth of documentation on the appropriate syntax for the newer netfilter statistics mode match. It seems that it has changed a few times over the years.

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -m state --state NEW -m statistic \
--mode nth --every 3 -j DNAT --to-destination 192.168.1.1:80

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -m state --state NEW -m statistic \
--mode nth --every 2 -j DNAT --to-destination 192.168.1.2:80

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -m state --state NEW -m statistic \
--mode nth --every 1 -j DNAT --to-destination 192.168.1.3:80

To clarify this, each rule is terminating so the match is a probability. Every 3 packets (33%) match the first. Of the remaining 66%, every other (50%) matches the second. And then 1/1 packets (all of em) match the last. This set of rules will DNAT your incoming web traffic evenly across three servers.


Saturday, May 15, 2010

Cloud Tools

In case rightscale is just too pricey for you? :


Ever notice how amazon's command line tools have a million parameters each and frequently behave wildly different depending on version or region? Yeah, this makes things a little easier:



Thursday, February 4, 2010

Commodity NAS is... quirky

This should help anyone who is trying to achieve stable performance from EBS volumes on Amazon. The price we pay for commodity architecture is competition for IO throughput.

The times are a changin'

I'm finally giving up my hosted server platform. I no longer need it.

Amazingly, all my needs can be met with a combination of Google Apps Standard and an occasional virtual server instance.

Saturday, November 7, 2009

A new project

I've written some portlets for Google Apps integration with Liferay Portal.

I thought it might be nice to share.

Google-Liferay-Portlets

Sunday, August 30, 2009

Sunday, July 19, 2009

#$%^# ALSA!!!!!

Surely there are other poor souls wondering why their speakers quit working on the HP Mini running ubuntu jaunty. To alleviate your suffering I offer you, THE SOLUTION:

alsamixer

Press tab to go to the "Capture" view.

Turn on CAPTURE, DAC0, and IMPORT0. Turn up the volume on each.

Viola! This probably works on plenty of other intel-hda laptops as well.

That was far more difficult to solve than it should have been.