3 ms·
I think that is where the confusion comes in. Almost everyone agrees that if your workload is slowing down due to paging that is bad. If your working set is bi
by kevincox 4y ago
I think that is where the confusion comes in. Almost everyone agrees that if your workload is slowing down due to paging that is bad.
If your working set is bigger than your RAM you have a problem, swap or not.
However swap helps optimize your RAM usage so that your working set can fit with less waste. It allows the kernel more flexibility with what pages to evict from RAM. Without swap it can only evict pages backed by files. If you start evicting files that are in your working set you are just as screwed as if it starts evicting anonymous pages in your working set. With swap it can evict other unused pages before touching the pages in your working set.
I think there is some truth that it can be harder to notice with swap because there is more buffer between running great and literally crashing. However, in either situation you should be monitoring IO wait and application performance to ensure that you have enough memory for your working set.