Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] UEFI kernel installation?
Date: Sun, 16 Jun 2019 23:29:26
Message-Id: 41f13f06-8752-62ca-400a-0724098383c8@spamtrap.tnetconsulting.net
In Reply to: Re: [gentoo-user] UEFI kernel installation? by Wols Lists
1 On 6/16/19 1:14 PM, Wols Lists wrote:
2 > I'd have a single /home partition
3
4 I was thinking of the other OS as more of a live distro copied to the
5 system than anything else. I wasn't thinking that the OP wanted to
6 actively use the alternate distro frequently. As such, I figure that
7 most customizations can live on the main OS and it's associated home.
8
9 > Drives are cheap. The old "swap is twice ram" rule actually isn't an
10 > old wife's tale - the basic Unix swap mechanism NEEDS twice ram.
11
12 No, it doesn't. Not any more. It hasn't for quite a while.
13
14 Swap was FAR more important when there wasn't enough ram for the
15 server's workload. Or when the workload was transient like a multi-user
16 system. (Think terminals and / or telnet and / or ssh sessions for many
17 users logged in and sporadically using the system.)
18
19 Red Hat's recommendation last I looked was the following:
20
21 If the system has ≤ 2 GB of memory, have 4 GB of swap (if you can).
22 If the system has > 2 GB of memory, have the same amount of swap as memory.
23 If the system has > 16 GB of memory, have 16 GB of swap.
24
25 Take a look at the output of free on most systems. I'm betting that you
26 won't find very much swap used, if any. So dedicating 64 GB to swap on
27 a machine with 32 GB of memory is … silly. Especially if you never have
28 more than about 100 MB ~ 1 GB of swap used (if that).
29
30 You can probably get away with < 1 GB of swap on many systems. But
31 there is a different thing where that small amount of swap starts to be
32 an issue. That's when you want to do things like take a dump of kernel
33 memory and the stack. That does need some space. But I think 1 or 2 GB
34 is plenty.
35
36 > Okay, optimisations turned "must" into "should", and the swap mechanism
37 > was seriously revamped many moons ago and may have changed things
38 > completely (I've never managed to get anyone knowledgeable to tell
39 > me what happened), but what I do is always ...
40
41 We've also drastically changed how we use Unix systems. We no longer
42 have 25 ~ 250 people logged into them via terminals. Now most Unix
43 systems are dedicated to a single task, be it web serving, or a
44 database, or something else.
45
46 Plus, we don't want those workloads to be running in swap, so we give
47 the servers more memory thus making them even less likely to hit swap.
48
49 > Multiply my mobo's *maximum* ram by two. For *each* disk, create a swap
50 > partition that size. Add all swap partitions in with equal priority.
51
52 I think that's bad advice and I discourage that. Especially if you're
53 running all SSDs and your system can take half a TB of memory. Do you
54 /really/ want to dedicate 1 TB of each SSD to swap? Just how big are
55 the SSDs anyway? ;-) Also, if you've got eight or more SSDs, your
56 recommendation would mean that you have 16 times the memory as swap. It
57 would be even worse on a server with 24 x 2.5" SSDs. That would be 48
58 times the memory.
59
60 > It has been pointed out that this is not necessarily a good idea,
61 > a fork bomb would cause havoc because the machine would grind to a
62 > swap halt long before the OOM killer realised anything was wrong, for
63 > example, but it suits me especially as I put /tmp and /var/tmp/portage
64 > on tmpfs.
65
66 To each his / her own.

Replies

Subject Author
Re: [gentoo-user] UEFI kernel installation? Wols Lists <antlists@××××××××××××.uk>