Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Graham Perrin
Graham Perrin
@grahamperrin@mastodon.bsd.cafe  ·  activity timestamp 3 hours ago

tuning(7) begins:

"The swap partition should typically be approximately 2x the size of main memory for systems with less than 4GB of RAM, or approximately equal to the size of main memory if you have more. "

I can't believe that 64 GB swap should be a norm for a system with 64 GB RAM.

<https://man.freebsd.org/cgi/man.cgi?query=tuning&sektion=7&manpath=freebsd-current>

#FreeBSD #swap #tuning #documentation

tuning(7)

  • Copy link
  • Flag this post
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange replied  ·  activity timestamp 3 hours ago

@grahamperrin

I think that advice predates the unified buffer cache.

I have a machine with 64 GiB of RAM and 64 GB of swap, mostly because the disks are big and it’s sometimes useful to have a partition you can nuke (I installed FreeBSD on a BIOS-only machine and then replaced the motherboard with a UEFI-only one, so it was very useful to have space to pop a UEFI partition). But I don’t think I’ve seen it put even 1 GiB in swap.

Quite a few processes have some pages that are used on startup and not touched, and if you leave them for long enough these will eventually be swapped out and the RAM used for hotter disk pages, but these days a lot of RAM is typically filled with disk cache and will be preferentially evicted in case of memory pressure.

I’ve seen large swap cause some real problems with processes with run-away allocation. The process grows to fill RAM and swap, then segfaults and dumps core. Dumping core requires paging in every page that was swapped out and writing it to disk. That can take a really long time, hurt system performance while it’s happening and, if you’re really unlucky, fill up the disk (bonus points if the program was running as root).

  • Copy link
  • Flag this comment
  • Block
TomAoki
TomAoki
@TomAoki@mastodon.bsd.cafe replied  ·  activity timestamp 2 hours ago

@david_chisnall @grahamperrin
I saw swapping around 14GB (or possibly more I've not noticed, as I've not logged the usage) while running poudriere bulk builds on i9-12900H detected as 20 CPUs (6 HTT-capable p-cores and 8 HTT-incapable e-cores) with 64GB of RAM, limiting 6 builder jails (-J 6).

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.27 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct