226 System Administration Fortunately, very experienced sysadmins (those with a healthy disrespect for Unix) can win the battle. Date: Tuesday, January 12, 1993 2:17AM From: Robert E. Seastrom rs@ai.mit.edu To: UNIX-HATERS Subject: what a stupid algorithm I know I’m kind of walking the thin line by actually offering useful information in this message, but what the heck, you only live once, right? Anyway, I have this Sparcstation ELC which I bought for my per- sonal use in a moment of stupidity. It has a 760MB hard disk and 16MB of memory. I figured that 16MB ought to be enough, and indeed, pstat reports that on a typical day, running Ecch Windows, a few Emacses, xterms, and the occasional xload or xclock, I run 12 to 13MB of memory usage, tops. But I didn’t come here today to talk about why 2 emacses and a win- dow system should take five times the total memory of the late AI KS-10. No, today I came to talk about the virtual memory system. Why is it that when I walk away from my trusty jerkstation for a while and come back, I touch the mouse and all of a sudden, whirr, rattle, rattle, whirr, all my processes get swapped back into memory? I mean, why did they get paged out in the first place? It’s not like the system needed that memory—for chrissake, it still has 3 or 4 MB free! Well, here’s the deal. I hear from the spies out on abUsenet (after looking at the paging code and not being able to find anything) that there’s this magic parameter in the swapping part of the kernel called maxslp (that’s “max sleep” for the non-vowel-impaired) that tells the system how long a process can sleep before it is considered a “long sleeper” and summarily paged out whether it needs it or not. The default value for this parameter is 20. So if I walk away from my Sparcstation for 20 seconds or take a phone call or something, it very helpfully swaps out all of my processes that are waiting for keyboard input. So it has a lot of free memory to fire up new processes in or use as buffer space (for I/O from processes that have already been
Disk Partitions and Backups 227 swapped out, no doubt). Spiffy. So I used that king of high perfor- mance featureful debugging tools (adb) to goose maxslp up to some- thing more appropriate (like 2,000,000,000). Damnit, if the system is not out of memory, then it shouldn’t page or swap! Period! Why doesn’t someone tell Sun that their workstations aren’t Vaxen with 2MB of RAM, it’s not 1983, and there is absolutely nothing to be gained by summarily paging out stuff that you don’t have to just so you have a lot of empty memory lying around? What’s that, you say? Oh, right, I forgot—Sun wants their brand new spiffy fast work- stations to feel like a VAX 11/750 with 2MB of RAM and a load fac- tor of 6. Nothing like nostalgia, is there? feh. Disk Partitions and Backups Disk space management is a chore on all types of computer systems on Unix, it’s a Herculean task. Before loading Unix onto your disk, you must decide upon a space allocation for each of Unix’s partitions. Unix pretends your disk drive is a collection of smaller disks (each containing a complete file system), as opposed to other systems like TOPS-20, which let you cre- ate a larger logical disk out of a collection of smaller physical disks. Every alleged feature of disk partitions is really there to mask some bug or misdesign. For example, disk partitions allow you to dump or not dump certain sections of the disk without needing to dump the whole disk. But this “feature” is only needed because the dump program can only dump a complete file system. Disk partitions are touted as hard disk quotas that limit the amount of space a runaway process or user can use up before his program halts. This “feature” masks a deficient file system that provides no facilities for placing disk quota limits on directories or portions of a file system. These “features” engender further bugs and problems, which, not surpris- ingly, require a sysadmin (and additional, recurring costs) to fix. Unix commonly fails when a program or user fills up the /tmp directory, thus causing most other processes that require temporary disk space to fail. Most Unix programs don’t check whether writes to disk complete success- fully instead, they just proceed merrily along, writing your email to a full disk. In comes the sysadmin, who “solves” the problem by rebooting the
Previous Page Next Page