LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-16-2019, 09:32 PM   #1
steelheat
Member
 
Registered: Jun 2006
Location: Western US of A
Distribution: Kubuntu20.04,Debian 9,10,11,#419541 wRegistered user ith the Linux Counter
Posts: 86

Rep: Reputation: 7
My swap memory dose not work.


I need help in truning on swap memory....
I load down my system with apps and then I use Htop along with KSysGuard and they both show no swap memory being used. The swap memory partition is 53gb.

I load down the system to a crawl, meaning a mouse click or typing in an editor it may take 20 to 30 seconds before it responds. I have a quad-core processor and during the time the system is loaded down all 4 processors are doing 99 to 100%,and Swap is at "0", doing nothing!!.

I have checked out:: "Enabling swap on debian based system". At https://debian-administration.org/ar...n_based_system
problem is, when I run "swapon -s" like it sayse to do, it comes back with "bash: swapon: command not found"!

I'm ruining Debian Stretch 8.5, and 8gb of ram.
My hard drive is 1Tb, divided into three partitions on average of 320Gb, with a Swap partition of 53gb. Over the years I've used several different Swap sizes from 30 to 100Gbs, and I have not been able to tell any performance gains on any of the different sizes that I've used. I always partition Swap to have 3 times my ram and that has worked so far for the last 3 or 4 months, then the slow down crepe in and without me being able to nailing the actual problem(s).

Here's the results of the swapon command:
:~$ swapon -s
Filename Type Size Used Priority
/dev/sda4 partition 55891964 0 -1
fireboy:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 931.5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0e059c0d


Copy of my fstab:

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 671991807 671989760 320.4G 83 Linux
/dev/sda2 671991808 1358858239 686866432 327.5G 83 Linux
/dev/sda3 1358858240 1841674239 482816000 230.2G 83 Linux
/dev/sda4 1841674240 1953458175 111783936 53.3G 82 Linux swap / Solaris
fireboy:~$ sudo mkswap /dev/sda4
mkswap: error: /dev/sda4 is mounted; will not make swapspace
fireboy:~$ sudo swapon /dev/sda4
swapon: /dev/sda4: swapon failed: Device or resource busy
fireboy:~$ swapon -s
bash: swapon: command not found


I was unable to find anything in the Man pages (fstab , mount, SWAPON) to shed any light on my problem.

A copy of my /fstab file:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=33b9c933-9485-49c6-924f-3cd4bd869dd0 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb4 during installation
UUID=06e4796f-e298-408f-83f1-5280fbe88c2f none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/disk/by-path/pci-0000:00:0b.1-usb-0:10:1.0-scsi-0:0:0:0 /mnt/pci-0000:00:0b.1-usb-0:10:1.0-scsi-0:0:0:0 auto nosuid,nodev,nofail,x-gvfs-show 0 0

Thanks again for letting me post to ask for help!sh
 
Old 06-16-2019, 09:42 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
create a swap file
https://linuxize.com/post/create-a-linux-swap-file/
creating a swap partition
https://opensource.com/article/18/9/...-linux-systems

it's a root thing.
Code:
#swapon -a
this has to do with your CPU load not a memory swap
Code:
I load down the system to a crawl, meaning a mouse click or typing in an editor it may take 20 to 30 
seconds before it responds. I have a quad-core processor and during the time the system is loaded 
down all 4 processors are doing 99 to 100%,and Swap is at "0", doing nothing!!.
meaning your CPUs are maxed out, not memory.

Last edited by BW-userx; 06-16-2019 at 09:46 PM.
 
1 members found this post helpful.
Old 06-16-2019, 09:42 PM   #3
wagscat123
Member
 
Registered: Jan 2009
Location: Maryland-Pennsylvania border, USA
Distribution: openSUSE 15.2/15.3, Tumbleweed, Kubuntu 18.04/21.04, macOS 10.15, antiX 19, and Linux Mint 19.3
Posts: 860
Blog Entries: 45

Rep: Reputation: 120Reputation: 120
So nothing shows up with "free -m"?

Also I'm pretty sure swapon -s isn't working because you likely forgot the sudo in front of it. It's probably one of those sbin commands
 
1 members found this post helpful.
Old 06-16-2019, 09:43 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

Quote:
fireboy:~$ sudo mkswap /dev/sda4
mkswap: error: /dev/sda4 is mounted; will not make swapspace
fireboy:~$ sudo swapon /dev/sda4
swapon: /dev/sda4: swapon failed: Device or resource busy
seems your sda4 is not actually a swap partition. Unmount it before trying to make it a swap partition.

Quote:
fireboy:~$ swapon -s
bash: swapon: command not found
I guess /sbin is not in your path.

Evo2.
 
1 members found this post helpful.
Old 06-16-2019, 10:11 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,864

Rep: Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358Reputation: 6358
swapon is located in the /sbin directory which isn't in a regular users path environment for debian and why the command not found error.

Code:
swapon -s
Filename   Type      Size     Used Priority
/dev/sda4 partition 55891964   0    -1

swap was on /dev/sdb4 during installation
UUID=06e4796f-e298-408f-83f1-5280fbe88c2f none swap sw 0 0
The output from the swapon command indicates it is active but not being used and you can not format active swap. However, your fstab does not match i.e sda4 vs sdb4.

swap usage depends on how much memory, what application/services you run and how you use the computer. Supposedly as the amount of RAM increases, beyond a certain point adding more swap space simply leads to thrashing well before the swap space even comes close to being filled.

The rule of thumb for swap has changed over the years and depends on how much RAM is installed and if you hibernate. How much RAM is installed in your computer?

Last edited by michaelk; 06-16-2019 at 10:14 PM.
 
1 members found this post helpful.
Old 06-16-2019, 11:14 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Quote:
Originally Posted by steelheat View Post
being able to nailing the actual problem(s).

Here's the results of the swapon command:
:~$ swapon -s
Filename Type Size Used Priority
/dev/sda4 partition 55891964 0 -1
Oops, missed that the first time (please use code tags in future). Looks like michaelk has the answer.
 
1 members found this post helpful.
Old 06-17-2019, 09:14 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
look at post #2 about load and memory is for swap, not how much load one is putting on the CPUs.
the more you give the cpus to do the longer time it is going to take to do more then one thing, due it cycles of the cpu and assessment to commands the cpu needs to execute with in that given cycle(s).

if you got one second to do one thing, then it can be done in one second or less.

if you keep adding to the things that need to be done within that one second eventually more time is going to be needed to do all of them things. things then get backed up and put into a que (and) a wait state. hence a simple mouse move takes longer to be seen being done due to the CPUs load being so high to get everything it is told to be done within the same time limit of its cycles.

everything is still being one on a one thing at a time series of events. The cycle time is what makes its faster. If it is only 1.3GHz vs 3GHz cycles. which is faster to get three things done? the clock cycle dictates that not swap and memory.

if you got a load up to 100% and you keep trying to get it to do more, that more you are trying to get it to do is going to be put into a cue until it can work it in to be done by the CPU. that is why his mouse moments are taking so long to be completed.

it has nothing to do with swap size.

--

if the apps running memory consumption is greater then available on board memory then swap comes into play.

conciser the operations behind a simple mouse moment. update and redraw to screen for every pixel moved to across the screen, not only the mouse cursor but the entire screen needs to be redrawn for every pixel the movement of the cursor changes the look of the screen. in order to have one see the cursor moving across the screen. it has to try and work in all of that math and redrawing within a cycle that the cpu has to time slice out for every other thing that is trying to be done at the same time.

the CPU does not do two things at once, it does them one at a time, more cycle speed the quicker it can do this operation. This is why a 1.3GHz is slower then a 5GHz doing the very same things. it is more noticeable during cpu LOADs being higher to get the same amount of operations completed. between the two different speeds.

you add more CPUs (cores) and keep load at 99% to 100% the effects are still going to be the same.

Last edited by BW-userx; 06-17-2019 at 09:45 AM.
 
1 members found this post helpful.
Old 06-18-2019, 10:49 PM   #8
steelheat
Member
 
Registered: Jun 2006
Location: Western US of A
Distribution: Kubuntu20.04,Debian 9,10,11,#419541 wRegistered user ith the Linux Counter
Posts: 86

Original Poster
Rep: Reputation: 7
Wow, thank you wagscat123, michaelk, evo2, and BW-userx for taking the time to look at my swap memory problem. I am sorry I am just getting back to my post. It's been a heavy couple days!

You all have given me plenty to check out and get busy on. This may take me a few days to get through it all, but I hope I can post my problem is solved with what your all have given me. I'll be back with the results or more questions! Thank you all!!sh
 
Old 06-18-2019, 10:51 PM   #9
steelheat
Member
 
Registered: Jun 2006
Location: Western US of A
Distribution: Kubuntu20.04,Debian 9,10,11,#419541 wRegistered user ith the Linux Counter
Posts: 86

Original Poster
Rep: Reputation: 7
Wow, thank you wagscat123, michaelk, evo2, and BW-userx for taking the time to look at my swap memory problem. I am sorry I am just getting back to my post. It's been a heavy couple days!

You all have given me plenty to check out and get busy on. This may take me a few days to get through it all, but I hope I can post solved my problem with what your all have given me. I'll be back with the results or more questions! Thank you all!!sh

Last edited by steelheat; 06-18-2019 at 10:53 PM. Reason: spelling correction.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gateway all in one up grade to ubuntu 11.10 touch screen dose not work work in 11.04 rogerscott Linux - Newbie 0 01-07-2012 05:59 PM
Why dose my internet work in windows but not in opensuse 10.2 on a dual boot computer jennylschofield Linux - Wireless Networking 6 04-21-2007 11:11 PM
My laptop's sound card dose not work.. supercarl Linux - Newbie 3 07-31-2005 09:16 AM
My laptop's sound card dose not work.. supercarl Linux - Laptop and Netbook 1 07-30-2005 02:26 PM
In KDE umont dose not work Aljaber Slackware 3 11-07-2003 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:28 AM.

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