Posts Tagged ‘linux’

Tuning linux buffer cache management

Monday, March 17th, 2008

Here’s a great page talking about how to tune the Linux buffer cache

The last Fedora update I’ll ever do.

Tuesday, February 19th, 2008

Yesterday, I finally finished updating this computer from Fedora Core 6 to Fedora Core 8. I’ve completely swarn off Fedora, and if there were an easy way for me to migrate away, I’d do that instead of these insane upgrades.

Here were the major stumbling blocks:
1. The “depsolve hang in upgrade” bug which meant I needed to wait for a respin or follow instructions listed in redhat’s bug database. (I decided to wait for the respin)
2. The “respins” from fedoraunity.org took a while to be created, and use the totally insane ‘jigdo’ downloader. They took about 2.5 days to download 4GB. By contrast, a bittorrent download af the same data takes about 4 hours.
3. The installer ran mostly smoothly, but took several hours to upgrade my system.
4. The installer didn’t upgrade over 1100 packages on my system. I had to boot it up and run “yum update” to finish updating these.
5. Even after ‘yum update’ I had a bunch of issues getting my monitor resolution back to 1280×1024 (it wanted to be 800×600)
6. Fedora doesn’t inculde mp3 playback, mencoder, or mplayer, so you need to enable ‘extra’ yum repositories to get these files. There are several choices, and they usually just fuck up your system beyond repair. (atrpms, freshrpms, dag, livna, etc.)

All in all, it took about 3 months to progress from step 1 to step 6.

At least my system still works. Mail works, the web works, gallery works, music works. Phew.

Next time, I’m going to build a new computer, and I think I’ll just install gentoo. I’m not sure yet, though.

Using mrtg & snmpd to monitor your OpenWRT router’s throughput

Thursday, January 17th, 2008

I’ve looked around on the web for a while for easy instructions about how to setup an mrtg installation to monitor my OpenWRT router’s throughput. Here are my easy instructions for getting this setup up and running:

Note: At first, I didn’t realize that mrtg would run on a remote machine. I didn’t try getting mrtg to run locally on the OpenWRT system, although this is theoretically possible. I use a secondary machine to pull data from the router.

1. Install smtpd on the OpenWRT router. This is as easy as:

# ipkg install snmpd

Once the install has completed, you need to start up snmpd. I just did this by hand, since my router has a pretty good uptime, and I was messing around. To start it by hand, say:

# /etc/init.d/snmpd start

If you want it to start automatically, then you should rename /etc/init.d/snmpd to something like /etc/init.d/S98snmpd.

2. Install mrtg on your linux box. My main webserver is a Fedora box, so this was as straightforward as:

# yum install mrtg

3. Configure mrtg using “cfgmaker”. mrtg comes with a default config, but since router setups vary so much, this default config is pretty much useless. So, I ran:

# cfgmaker –ifref=name public@192.168.1.1 > /etc/mrtg/mrtg.cfg

This created a reasonable config file with a bunch of sections (one section for each interface on the router). It needed a small tweak, and that was to define the WorkDir directory to the right place for Fedora, which is /var/www/mrtg. I then uncommented the bulk of the config sections in the rest of the file.

4. Manually run the mrtg collection scripts to bootstrap the system. You can skip this step if you want to just wait 5 minutes. I looked in /etc/cron.d/mrtg and just ran the command there, which was:

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg –lock-file /var/lock/mrtg/mrtg_l –confcache-file /var/lib/mrtg/mrtg.ok

I can this a couple of times until no error messages came out (the first 2 times may produce errors).

5. Alias /mrtg to /var/www/mrtg in your apache configuration file. This was necessary for me because I have a bunch of virtual hosts. People without virtual hosts can skip this step.

6. Create a simple /var/www/mrtg/index.html that links to the pages generated my mrtg. There’s one page per router interface, so I just made a bunch of hardcoded links. You can look in /var/www/mrtg to see what the filenames are.

6. Done! Now you can view my router graphs on slacy.com/mrtg. The interesting ones are:

eth1: Shows all traffic on my wireless network.
vlan1: Shows all traffic on my external WAN port (in/out to the ‘real world’)
Also note that I’ve configured them all to have logscale on the Y axis, since my ADSL line has such a discrepancy between input and output rates.

I haven’t exactly figured out what the rest of the interfaces are, but I can tell that vlan0 and vlan1 are inverse of each other.