Live data from Hacker News

A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

lowendbox.com

31–40 of 137 posts

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#31
post #23

Swap on servers somewhat defeats the purpose of ECC memory: your program state is now subject to complex IO path that is not end-to-end checksum protected. Also you get unpredictable performance. So typically: swap off on servers. Do they have a server story?

I can see it now: pro ecc sata and m.2 ssds

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#32

Using the example from the article, extracting an archive. Surely that use case is entity not possible using in-memory? What happens if you're dealing with a not-unreasonable 100gb archive? Who runs around with 100gb+ of swap?!

Who runs around with a 100gb+ /tmp partition? Our default server images come with a 4.4GB /tmp partition...

I run a script that rotates my /tmp/ each day, so I can access yesterday's tmp files at /tmp/20250828/ and so on.

My /tmp is my default folder for downloads and temporary work. It will grow 100GB+ easily.

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#33
post #30
post #11

The third mitigating feature the article forgot to mention is that tmpfs can get paged out to the swap partition. If you drop a large file there and forget it, it will all end up in the swap partition if applications are demanding more memory.

what swap partition? I meant this sort of jokingly. I think have a few linux systems that were never configured with swap partitions or swapfiles.

I'm with you. I don't swap. Processes die. OOM. Linux can recover and not lose data. Just unavailable for a moment.

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#34
post #18

Earlier quoted context omitted.

Which is a great reason to have a big swap file now.

Note though that if you don't have swap now, and enable it, you introduce the risk of thrashing [1] If you have swap already it doesn't matter, but I've encountered enough thrashing that I now disable swap on almost all servers I work with. It's rare but when it happens the server usually becomes completely unresponsive, so you have to hard reset it. I'd rather that the application trying to use too much memory is ki…

[deleted]

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#35
post #26

Earlier quoted context omitted.

Disabling swap on servers is de-facto standard for serious deployments. The swap story needs a serious upgrade. I think /tmp in memory is a great idea, but I also think that particular /tmp needs a swap support (ideally with compression, ZSWAP), but not the main system.

Swap always seemed more meant for desktop use. Servers you need to give the real memory expected of the application stack.

plenty of footguns in that general advice, local in memory storage services with default config, etc

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#36
post #15
post #12

Earlier quoted context omitted.

Why is reading the data back from swap be slower at all -- much less "DRAMATICALLY" so -- than saving the data to disk and reading it back?

Because swapping back in happens 4kb at a time

Why?

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#37
post #24
post #18

Earlier quoted context omitted.

Note though that if you don't have swap now, and enable it, you introduce the risk of thrashing [1] If you have swap already it doesn't matter, but I've encountered enough thrashing that I now disable swap on almost all servers I work with. It's rare but when it happens the server usually becomes completely unresponsive, so you have to hard reset it. I'd rather that the application trying to use too much memory is ki…

This is why I’m running with overcommit 2 and a different ratio per server purpose. …though I’m not sure why we have to think about this in 2025 at all.

I'm assuming that you monitor the service closely for OOM then adjust with demand ?

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#38
post #26

Earlier quoted context omitted.

Disabling swap on servers is de-facto standard for serious deployments. The swap story needs a serious upgrade. I think /tmp in memory is a great idea, but I also think that particular /tmp needs a swap support (ideally with compression, ZSWAP), but not the main system.

Swap always seemed more meant for desktop use. Servers you need to give the real memory expected of the application stack.

Pretty much all the guidelines about swap partitions out there reference old allocator behaviour from way over a decade ago - where you'd indeed typically run into weird issues without having a swap partition, even if you had enough RAM.

Short (and inaccurate) summary was that it'd try to use some swap even if it didn't need it yet, which made sense in the world of enough memory being too expensive, and got fixed at the cost of making the allocator way more complicated when we started having enough memory in most cases.

Nowadays typically you don't need swap unless you work on a product with some constraints, in which case you'd hand tune low memory performance anyway. Just don't buy anything with less than 32GB, and you should be good.

Re: A deep dive into Debian 13 /tmp: What's new, and what to do if you don't like it

#40
I'm still a fan of poly instantiated /tmp and PrivateTmp (systemd). This may confuse/annoy admins who are not aware of namespaces, but I know that it definitely closes the attack vector of /tmp abuse by bad actors.

https://www.redhat.com/en/blog/polyinstantiating-tmp-and-var...

Post reply on HN