Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts from 2006

Measuring DNS latency with nsping

networkingNov 24, 2006 2 min read

While debugging a DNS problem a few weeks back, I needed a way to measure the time it took a name server to respond to a DNS request. After poking around the OpenBSD ports collection, I came across the nsping utility. Nsping queries a DNS server passed on the command line, and reports the time it took the server to resolve a name. The following example shows how to use nsping to measure the time it takes to resolve the name prefetch.net on the name server ns2.dreamhost.com: Each line contains the size of the response, the time it took to complete the request, and a sequence number…

$ read more →

Solaris device in use checking

solarisNov 24, 2006 1 min

One nifty feature that recently made it's appearance in Solaris 10 is device in use checking. This feature is implemented by the libdiskmgt.so.1 shared library, and allows utiltiies to see if a device is being used, and what it is being used for. This is really neat, and I love the fact that format now prints what each partition on an active device is being used for: I digs me some Solaris!

$ read more →

Monitoring interface throughput on OpenBSD systems

openbsdNov 23, 2006 1 min

While persuing the OpenBSD ports collection a few weeks ago, I came across the ifstat utility. This nifty utility allows you to view bandwidth totals for each interface in a server, and at specific intervals. Here is a sample run showing the bandwidth in and out of the sis0 and sis1 Ethernet interfaces, and the total bandwidth in and out of the system: This is a nifty utility, and one I plan to add to my stock OpenBSD builds!

$ read more →

Sometimes it's the little things that bite you

openbsdNov 23, 2006 1 min

After installing a new OpenBSD image on my Soekris net4801, I needed to become root to perform some post installation configuration. When I ran the su command, it exited without switching me to the root user: This baffled me for a minute, since my user and group identifiers looked fine, and I was in the wheel group (OpenBSD allows you to use the group wheel to control which users can become uid 0): To see what was going on, I ran ktrace to view the call path for the su executable: After reviewing the complete dump, I noticed that the su executable couldn't open the secure passwd database: It then dawned on me that I shouldn't be able to ktrace a setuid executable as an unprivileged user, so I decided to check the permissions of the su utility to see why the kdump worked: Well I'll be. When I extracted the files tonight to create my archive, I either extracted then as an unprivileged user (which is why the setuid / setgid bits weren't preserved), or I forgot to use tar's "-p" option to preserve the file modes (I no longer have the history file, so I can't see where I made my mistake). I think the tryptophan from the turkey is setting in…

$ read more →

Locating OpenBSD devices for kernel builds

openbsdNov 20, 2006 1 min

I run OpenBSD on a few soekris net4801s, which don't have a whole lot of memory. To ensure that I am efficiently using the hardware, I build custom kernels that contain just the devices needed to load and run the OpenBSD kernel on the soekris. This minizes the kernel memory footprint, and allows me to eeek out a few extra pages of spare memory. To build a custom kernel with just the devices I need, I usually start by running the dmassage utility to identify the devices on my system: Once I have the devices, I use my OpenBSD kernel build procedure, but trim the devices that aren't displayed by dmassage…

$ read more →