Web Hosting Talk







View Full Version : Server Installation & Sizes???


cahostnet
04-25-2001, 10:32 AM
I'm in the process of setting up a new server for hosting and need some advice on couple of things.

I will be using a 20GB HD for the server. What partition sizes should I use for all partitions: /var /usr /home /
I will be using Redhat Linux 6.2 for now due to some software requirement and upgrading later to 7.x. I will be using Ensim's CP for now and Webmin. I am just wondering how I should partition the drives.

Second, about DNS, do most people install DNS locally on their hosting boxes or do their ISP do it for them. What is the general setup of the hosting machine. I will be installing mail on the server as well using Sendmail but I was wondering how DNS was handled.

Any information on this will be greatful. Also customers hosting files will be stored on the /home partition. If there's anything that I'm missing that you can mention I will appreciate that also.

Thanks...

lenix
04-25-2001, 06:10 PM
/swap 2 * ram
/ 50mb
/home fill-to-disk
/var 1000mb
/usr 4000mb
I personally don't run redhat due to its flawless vulnerabilities. FreeBSD owns :)

However I recommend installing qmail ( qmail.org ) as your mail daemon, its alot more secure than sendmail. To setup your dns services visit isc.org/bind or use the redhat rpm. rpm -Uvh *named*

cahostnet
04-26-2001, 07:50 AM
Thanks allot for your input. I know what you mean about Redhat. I also run couple of FreeBSD and I love it but unfortunately, most software run on Redhat and most of the CP that I've seen all run on Redhat. This is mostly what is causing me to switch from FreeBSD to Redhat. Again Thanks for your input. Do you run your own DNS on your hosting servers?

Thanks

Tim Greer
04-26-2001, 06:48 PM
Originally posted by lenix
/swap 2 * ram
/ 50mb
/home fill-to-disk
/var 1000mb
/usr 4000mb
I personally don't run redhat due to its flawless vulnerabilities. FreeBSD owns :)

However I recommend installing qmail ( qmail.org ) as your mail daemon, its alot more secure than sendmail. To setup your dns services visit isc.org/bind or use the redhat rpm. rpm -Uvh *named*

I agree FreeBSD is better. Qmail is probably better too, but Qmail is (in a lot of ways) basically just has a default configuration/setup, equal to a decent, start of a Sendmail install. But, most people can't secure Sendmail well and Qmail is a good alternative and offers almost as many features as Sendmail.

As for the partition scheme, I'd not suggest 2 x the amount of RAM, unless you have a small amount (64 MB or less). If you have 128 Megs RAM or more, you won't need to have a swap larger than 128 Megs, and in fact, there's no reason to. If you use all of the 128 Megs of physical RAM, it's going to be using 128 Megs of swap, and if it needs more than that, let the process(es) die. That's too slow and too much disk access and too much potential to bring the system down. I've seen people with 512 Megs have swaps of 512 or 1 GIG, and 1 GIG of RAM with 1 or 2 GIG's swap, and it's just too much. Imagine running out of 512 or 1 GIG or RAM and having to still need swap!? Swap is to offset the lack of RAM, so things can still run, with 128+ Megs, don't add more than 128 swap, ever.

Also, I'd suggest, for security reasons, that you put /tmp on it's own partition as well, just as you would with /var and /usr and /home, etc. The reason, is so it can lessen the chances of local exploits, expecially on SUID/SGID exploits, where you can mount certain partitions with SUID/SGID disabled and prevent hard link attacks, etc. (I.e., "nosuid" option -- the "defaults" option has it enabled. Disable it for /home and /tmp, to start, same for any partition that has any sort of access by users, such as one that has FTP access or anonymous FTP, for example).

So, going off the above poster's suggestion, I would modify it in this manner:

/swap 128 Megs
/ 50mb
/var 1000mb (Depending on the size of your logs, 2 GIG)
/usr 4000mb (4 is generous, you can probably do 2 or 3)
/tmp 250-500 Megs
/home whatever is left

Although his suggestion is good, you can surely use the size he suggested, just be sure to have a cron job or logrotate script go in and gzip the logs, so 1000mb on /var doesn't get too full too quick, depending on what sort of logging scheme you use. Otherwise, just be sure to put /tmp on it's own partition as well.

cperciva
04-26-2001, 07:20 PM
I have to disagree with you here, Tim, on the question of swap space. I'd say 4 * RAM, regardless of the amount of memory you have.

First, this is based on the fact that it is easier to add memory than it is to repartition the drive -- I believe that you should have 2 * RAM in swap space and that you might as much as double the RAM in a system before you want to repartition the drive.

Why should you have 2 * RAM? Because good operating systems swap proactively. I have a system sitting in front of me with 256MB of RAM, of which only 80MB is in use, yet 50MB of swap space is used. The operating system was smart enough to recognize that large blocks of memory hadn't been touched for days, and wrote them to disk so that if it needed more memory later it wouldn't have to spend time writing the memory to disk at that point.

Disk space is cheap compared to memory, and the more you can swap out sleeping applications the more memory you have left for disk caches.

Duster
04-26-2001, 07:35 PM
Originally posted by cahostnet
I will be using Redhat Linux 6.2 for now due to some software requirement and upgrading later to 7.x.

Be aware that some programs don't seem to work under 7. I think I read of difficulties here. More knowledgeable people suggest staying away from 7 for the time being.

Tim Greer
04-26-2001, 09:25 PM
Originally posted by cperciva
I have to disagree with you here, Tim, on the question of swap space. I'd say 4 * RAM, regardless of the amount of memory you have.

First, this is based on the fact that it is easier to add memory than it is to repartition the drive -- I believe that you should have 2 * RAM in swap space and that you might as much as double the RAM in a system before you want to repartition the drive.

Why should you have 2 * RAM? Because good operating systems swap proactively. I have a system sitting in front of me with 256MB of RAM, of which only 80MB is in use, yet 50MB of swap space is used. The operating system was smart enough to recognize that large blocks of memory hadn't been touched for days, and wrote them to disk so that if it needed more memory later it wouldn't have to spend time writing the memory to disk at that point.

Disk space is cheap compared to memory, and the more you can swap out sleeping applications the more memory you have left for disk caches.

Having disk space available is irrelevant though. There's no reason to having so much swap, when it's not going to be used, or more specifically, shouldn't need to be used. If that much is used, fine, but if you have all your physical memory used and it's needing more than 128 more Megs, then there is something wrong with the systems configuration or the program running. It still does caching, etc. Say someone has 512 Megs RAM, you're telling me they should have anywhere from a GIG to two GIG's of swap? You only want as much swap as you need and in reality, 512+ MEgs RAM, doesn't even need swap. Still, if it did, that's a bad sign.

It might use partial swap on boot, but not because it _needs_ it. If someone runs out of physical RAM at 512 Megs, and the system needs to use another 512 or a GIG or more, there is something seriously wrong, I can't emphasize that enough. You can have GIG's and GIG's of RAM and it'll still use a partial amount, but not because it's needed. That's fine, as I said, but if it truly needs that much RAM, you need to fix something.. conversely, if it uses that much RAM, things will be so slow and overloaded, that giving it another 512 of swap to use, is only going to make this problem get worse.

Granted, a good rule of thumb, as we all know, is to use 2 x the RAM for Swap, and on the old kernel's had a limit of 127 MB and anything over that, even though you could set it higher, was a waste of time and space, due to the fact of the limit. I'm not saying more RAM will hurt, just that is can... as you run out of physical RAM, it's going to start paging virtual RAM and that's slow.. an the more it need to use and work with, the more overloaded the system gets, the slower things are. Of course, you can solve part of that problem, by having faster drives, and even more so, by not having the swap partition(s) on the same drive as the root partition, which can be a big help. Still though, you have this potential issue of allowing the system to go too far and be able to swap too much. No more free memory and have 256 or 512 or a GIG of RAM used all up and need to swap, when the system is already highly loaded? That's just not a good idea.

Of course that's only a problem if it uses so much, if it doesn't, it doesn't matter. But, why then have it so large, unless it did matter, in which case, it's too much. Also, granted that some programs out now might consume so much resources, it needs more swap, but if it needs that much, that's a crappy program and shouldn't be ran. I compare this with more RAM, to be clear. Say you run out of 128 Megs, and it needs to swap. Say your swap is 8 GIG's. Do you really want to allow it to chew on and up to 8 GIG's of virtual memory on the drive, if it's incline to do so? This 1 and 2 GIG swap idea, is the same problem, that's a lot (too much) to allow it to chew on while it swaps out, that would just kill a system's performance. You have to better limit how far that can go, before something does use up all it's given and trash your drive or crash your system. That's not to say swap isn't a good thing or even needed, but there's limits on it's usefulness, before it becomes a problem.

Simply put, there's a point where more RAM is needed to run some applications, but how much they may consume, might define that application as being poor performing and not worth running. To say, do you want your disk to slow down reading chunks of disk in place of fast RAM and possibly just continue to build up a huge amount of swap, very, very slow, and basically kill everything, or do you want it to have a limit, to where if something uses an excessive amount of RAM and still needs 512 or 1 GIG more of swap to run, or have it simply die if it wants to abuse your system so much?
I'd rather have it die off, than abuse my system and consume so much resources to require an additional 512 or 1 GIG of swap. I think 128 is better, and I'm okay with 256, personally, but I have the opinion that anything over 256 is a bad idea and you've allowing things more opportunity to get out of control. It's better it dies before your system does. I guess we'll just disagree. I could probably find sites that discuss this, but the experts likely disagree anyway. I will admit that some RAM is usually better than none, but it can go too far with not enough, as well as too much.

[ Edit : Actually, may I suggest that they simply partition the drive out and set the partition for swap last? Say, set aside that much (even 2 x the RAM -- 4 is WAY too much) and simply set it at 128 or 256 and be able to just reset that partition to more if they want? That way, they'll find out fast enough if they need more anyway. In fact, I'd suggest 4 128 meg partitions, and use one, if that's not enough, add another, and so on. I still don't agree that over 128 Meg is a good idea. ]