LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-23-2021, 04:52 AM   #31
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121

Perhaps you should read the link pan64 posted - covers swappiness in detail and attempts to correct the importance most mistakenly give to it.
 
Old 09-23-2021, 09:20 AM   #32
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,662
Blog Entries: 4

Rep: Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942
Most likely (IMHO), what is actually happening to you right now is a phenomenon known as thrashing. (Link here.) Your system's reliance on a swap-area that's almost half again as big as your RAM strongly suggests this. That is to say, "the problem isn't your swap area – it's how you use it."

At the risk of getting too technical, virtual memory relies on the concept of locality of reference: "the next memory address requested by the CPU is likely to be close-by to another address that the CPU has requested recently." As long as this holds true, virtual memory works quite well and the running process does not experience excessive delays due to so-called "page faults." And, when this holds true, it does so only up to a point. Beyond that point, as they say, "it hits the wall."

Process performance almost-instantly degrades: a basically-linear curve suddenly turns exponential.

To cite one example from my long-ago past, I discovered that if less than three engineering jobs were running at the same time, each one of them would reliably complete in under 45 seconds. But, if six were running, each one might take well more than an hour. (I became quite famous for diverting them into a separate job queue and placing a limit on that queue, back in the day.) Yes, the difference is "that extreme."

Programmers often get into this mess when they try to over-use "hash-table" based "in memory" storage methods when they ought to be using some kind of indexed file. Hash algorithms are designed to produce random distributions of hash keys in order to minimize the number of nanoseconds needed to locate a value ... which is just fine as long as "memory access is cost-free." But they can play hell with virtual-memory algorithms, and your process is the one that pays the price. You have to re-design the application to fix it, unless you can just "throw sand (silicon ...) at it."
 
Old 11-11-2021, 08:07 PM   #33
MadMartian
LQ Newbie
 
Registered: Jun 2021
Distribution: N00buntu
Posts: 11

Original Poster
Rep: Reputation: Disabled
My last solution didn't work, and I've waited for up to 30 minutes for the system to unfreeze itself assuming that thrashing would eventually resolve. It did not, and this was no help. So I found a better solution that has resulted in much better stability.

What I did is moved my swap to stripe across an NVMe/M.2 and an SSD/SATA and I haven't run into any system stability or even performance issues after a few weeks of use. Since I'm using SSDs for swap I've turned my swapiness way down to 35, so now any swap usage over a couple GB is rare with the exception of Java.
 
Old 11-12-2021, 01:45 AM   #34
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Actually I don't know what was your last non-working solution. Anyway, if your problem is solved, please mark the thread solved.
 
Old 11-12-2021, 02:49 PM   #35
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
Post #6 suggestion?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] diagnosing heavy cpu system usage andrews-mark Linux - General 3 10-24-2011 03:48 PM
System freeze on large file/heavy disk jshellman Linux - Hardware 1 11-15-2006 03:47 PM
LCD Screens ~ Dangerous under heavy usage? Twiggy794 Linux - Hardware 8 01-10-2004 01:13 PM
Heavy processor usage while doing almost nothing Wynd Linux - General 12 01-09-2004 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration