Server Move 1
After our server had a near-death experience last week (its hard disk disappeared after a reboot), a couple of friends and I have been busy setting up a new server during the last few days. Not only a good opportunity to switch from SuSE 8 to RHEL 4, but also for installing the latest and greatest software, and for setting things up in the right way.
To monitor network traffic, I have used ipac-ng so far (screenshot). It is good for monitoring traffic on a single host, but what I really wanted was the Multi Router Traffic Grapher. Last time, I just couldn't figure out how to use it for anything but monitoring external devices with an SNMP interface.
This time, I searched for "mrtg snmp howto" on Google, and came up with a PDF that described how to set it up without SNMP. You just need a script that returns one or two values, and configure MRTG to call it. Couldn't be easier. Here's part of the configuration and the script, and a screenshot.
Putting your photo collection into a Web server has the disadvantage that from time time a braindead mirroring tool comes along and hammers the server with a never-ending stream of requests. With Apache 1.3, I have used mod_throttle to block ill-mannered visitors. It keeps track of how many requests have been received from an IP address, and blocks or slows down any further requests once a limit has been reached. One problem with this module is that to reset his count to 0, a visitor must not make any request for a certain time.
Because mod_throttle has not been ported to Apache 2 yet, I had to look for a replacement. What I found is mod_bwshare, which uses statistical shaping to detect unusual request patterns. Instead of a timeout after which the counter is reset, it keeps track of the average number of requests per second, and allows clients to exceed the limit for some time (screenshot). Once they accumulate too much debt, further requests are blocked.
I first followed the installation instructions in the README. It
worked and I even was able to make a shared module for the
RPM-installed Apache, but as stated in the documentation, the shared
module could not be configured from httpd.conf. Then I discovered apach2-mod_bwshare.rpm,
which works quite well on RHEL 4.
Update: After switching the DNS records to the new server yesterday and getting some real traffic, Apache crashed two times. Probably mod_bwshare cannot handle graceful restarts - after I started doing full restarts, it seems to work fine.
23:15, 21 Oct 2004 by Carsten Clasohm Permalink | Comments (0)
| October 2004 | |||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
Request notifications