[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] disk labeling

On Mar 14, 2007, at 8:44 AM, Don Munyak wrote:

Helge & Graham ... Thanks

I am going to use a little of both.

/    256M
/root   512M
/swap   1G
/var     4G
/tmp   1G
/usr   10G
/usr/jails   <remainder>

Helge (or anyone else) could you explain further your statement for
SWAP. I'm not challenging you, but I have the understanding that 2xRAM
is rule of thumb.

"Swap > 1 GB is going to freeze the machine if its ever really fully used, so
i'd say you can omit that."

You need at least as much disk swap as you have RAM. The reasons should be obvious, but if you don't know, I recommend heading over to Berkeley iTunes University and downloading one of their CS courses like CS162. Did I mention it's free? http://itunes.berkeley.edu/ The other way to learn is wait until one of your machines is overloaded and starts swapping heavily. The "why" gets real clear, real fast. :-)

The traditional wisdom behind using 2xRAM for swap is that it's quite difficult to grow a swap partition. You have to repartition the disk which can be quite a bother. Server disks are also quite expensive and don't tend to be replaced often. The most common thing to upgrade on a computer, especially a server, is RAM. So, if you were to set the server up with 512MB of RAM and 512MB of swap, at some point down the road you are likely to upgrade the RAM. If you upgrade to 1 GB, you'd have still have a 512MB swap partition, which is insufficient and should your machine ever venture into the land of swap, the result would not likely be graceful.

I pushed a machine into production a few months ago with dual Xeon CPUs and 1GB of RAM. Within a month I had ordered another GB of RAM and installed it because I had installed an app that needed more RAM than I had planned for. The 2xRAM rule paid its dividends. Because I had plenty of swap, I could have done nothing, but I want my disks to live long happy lives so I prefer to avoid swapping entirely. Under "normal" load my server never utilizes the last gig but the next time one of my sites gets dugg or slashdotted I know the system has the resources to gracefully serve it.

par     size  utilized
/      256M   17%
swap    2G      0%
/var     4G      6%
/usr     5G    53%
/tmp    1G      1%
/home  113G  17%

The host OS is lean and mean, with only the barest of essentials. Everything else runs in jails stored on /home, with certain services like MySQL tucked away in their own jails running on a 127.0.0.x address.


Attachment: smime.p7s
Description: S/MIME cryptographic signature