short answer is, “It depends on the system.” General wisdom says that you should have at least twice as much swap as you have physical memory. This isn’t a bad rule, so long as you understand that it’s very general. More won’t hurt. Less might, if your system runs out of RAM. If you find that you need more swap space, you should probably buy more memory instead. If that’s not an option, you can use a regular file as a swap file. Still, if you have a reasonable amount of disk space, simply assigning an amount of swap equal to twice the amount of RAM you have is sensible. You should also consider possible future upgrades. If a computer has 500MB of RAM today, but you plan to upgrade it to 3GB of RAM in a couple of months, perhaps assigning 6GB of disk space to swap is a good idea. After all, if you can afford three gigs of RAM and you have the hardware to manage it, certainly that much disk is not an issue! Swap Splitting If you have multiple disks, you can vastly improve the efficiency of your swap space by splitting it among multiple drives. Put the first swap partition on the second-outermost ring of the drive with your root partition, and other swap space on the outermost edge of their drives. This splits reads and writes among multiple disk controllers. For swap splitting to work best, however, the drives must be SCSI. If you have IDE drives, the drives need to be on different IDE controllers. Remember, each IDE controller splits its total data throughput among all the connected hard drives. If you have two hard drives on the same IDE controller and you’re accessing both drives simultaneously, each disk will average half as fast as it would if you were running it alone. The major bottleneck in using swap space is data throughput speed, and you won’t gain speed by creating contention on your IDE bus. /tmp The /tmp directory is system-wide temporary space. If you do not create a separate /tmp partition, it will be included on your root partition. This means that your system-wide temporary space will be subject to the same conditions as the rest of your root drive. This probably isn’t what you want, especially if you plan to mount your root partition read-only! Requirements for a /tmp directory are generally a matter of opinion after all, you can always just use a chunk of space in your home directory as temporary space. On a modern hard drive, I like to have at least 500MB in a /tmp directory. Automated software installers frequently want to extract files in /tmp, and having to work around these installers when /tmp fills up is possible but tedious. /var The /var partition contains frequently changing logs, mail spools, temporary run files, the default website, and so on. If your server is a Web server, your website logs will go to this partition, and you may need to make it 1GB or more. On a small “generic Internet mail/Web server,” I’ll frequently give /var 20 percent of my remaining disk space. If the server handles only email or databases, I’ll kick this up to 70 percent or more, or just assign a space to the remaining partitions and throw everything else I have on /var. If you’re really cramped for space, you might assign as little as 30MB to /var. (Again, actual minimum requirements vary depending on your version of OpenBSD.) /usr The /usr partition holds the operating system programs, system source code, compilers and libraries, and other little details like that. Much of this changes only when you upgrade your system. On a modern hard drive, I recommend using about 6GB on your /usr partition. This should be more than sufficient for all the contents of /usr and just about any add-on packages you might desire, and should also leave room for any OpenBSD source you might want to install. Without the X Window System, you could make /usr as small as 200MB. If you need X, you should assign /usr at least 350MB. /home The /home partition is where users keep their files. If you have more disk space than is good for you, assign it here. Your home directory will quickly fill up with all sorts of stuff that you’ll be tripping across Page 47
Hint: This post is supported by Gama web hosting hrvatska services