You are not logged in.

#1 2013-04-01 15:09:58

shox
Member
Registered: 2012-06-20
Posts: 51

Disk usage is crazy

Hi ! I'm here to solve a problem with my archlinux installation
Sometime, my linux is very very slow : I have some troubles to move my mouse, I can't launch any commands..

When I succeed to launch a iotop, I see that every process use 100% of my disk.
On the top, there is jbd2, or some process that begin by "k"

It happend when I launch a flashplayer video, or when I use steam, or sometimes, just when I have too much process and that my computer is switch on for some days.

The testing repo is not actived, I use a non-modified kernel..
I used a Hdd before, I bought an SSD recently and the problem isn't solved...
I looked for other topics on archlinux forum but I didn't find the solution.
Is somebody have ideas..
(Sorry for my english)
Thanks !

Offline

#2 2013-04-01 15:29:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,611

Re: Disk usage is crazy

Sounds like your system is thrashing itself to death with virtual memory. 
What does free -h report?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2013-04-01 15:47:38

shox
Member
Registered: 2012-06-20
Posts: 51

Re: Disk usage is crazy

Yes, it's the same symptoms !
Actually, here is the out :

             total       used       free     shared    buffers     cached
Mem:          4,8G       4,0G       855M         0B        76M       879M
-/+ buffers/cache:       3,1G       1,8G
Swap:           0B         0B         0B

But I don't know how to reproduce the problem, but I'll make the command if the trouble comes back.

Offline

#4 2013-04-01 15:53:17

shox
Member
Registered: 2012-06-20
Posts: 51

Re: Disk usage is crazy

I launched a VM in VirtualBox, and it did it again,
I succeed to launch five times "free -h"

┌───| shom |───| ~/sr0 |
└───| 17:48 |───╼ free -h
             total       used       free     shared    buffers     cached
Mem:          4,8G       3,7G       1,2G         0B        46M       331M
-/+ buffers/cache:       3,3G       1,5G
Swap:           0B         0B         0B
┌───| shom |───| ~/sr0 |
└───| 17:48 |───╼ free -h
             total       used       free     shared    buffers     cached
Mem:          4,8G       3,9G       939M         0B        54M       331M
-/+ buffers/cache:       3,6G       1,3G
Swap:           0B         0B         0B
┌───| shom |───| ~/sr0 |
└───| 17:48 |───╼ free -h
             total       used       free     shared    buffers     cached
Mem:          4,8G       4,5G       391M         0B       2,6M       241M
-/+ buffers/cache:       4,2G       635M
Swap:           0B         0B         0B
┌───| shom |───| ~/sr0 |
└───| 17:48 |───╼ free -h
^[[A
             total       used       free     shared    buffers     cached
Mem:          4,8G       4,7G       156M         0B       652K       216M
-/+ buffers/cache:       4,5G       373M
Swap:           0B         0B         0B
┌───| shom |───| ~/sr0 |
└───| 17:48 |───╼ free -h
             total       used       free     shared    buffers     cached
Mem:          4,8G       4,7G       109M         0B       644K       221M
-/+ buffers/cache:       4,5G       331M
Swap:           0B         0B         0B

And I was unable to do something

Offline

#5 2013-04-01 17:46:23

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Disk usage is crazy

Did you try adding swap? If you don't have a spare partition, create a swap file like this:

dd if=/dev/zero of=foo bs=1M count=2048    # for 2GB
mkswap foo
swapon foo    # now it's active

swapoff foo   # to disable
rm foo

Last edited by mich41 (2013-04-01 17:47:14)

Offline

#6 2013-04-01 19:24:38

shox
Member
Registered: 2012-06-20
Posts: 51

Re: Disk usage is crazy

Thanks for the answer ! I made a swap partition (and 1.4Go are used !)
It's a little better but it is always very very slow.... Any ideas ?

More, I've seen that kswapd0 write a lot during this "freeze".. Is there a relation ?

Last edited by shox (2013-04-01 19:25:19)

Offline

#7 2013-04-02 03:20:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,168

Re: Disk usage is crazy

I assume that that is writing to the swap area. What you need to figure out is what is eating its way through your memory like that. Then you can figure out what to do about it.

I think you can use top to figure out what is eating your memory.

Last edited by cfr (2013-04-02 03:24:14)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-04-02 06:11:16

ismaelvc
Member
From: México, D.F.
Registered: 2012-02-26
Posts: 136

Re: Disk usage is crazy

You have 5G of ram and it still swaps?? what kind of work do you usually do?

You could try with the zram swap module, it's faster than swapping to disk, I assume you have a 1Ghz cpu or higher (else is not a good idea):

EDIT:  zramswap is in AUR:
https://aur.archlinux.org/packages/zramswap/

Some people claims instability, but I have never had a problem in a 259 / 378MB install

Once installed:

sudo systemctl start zramswap.service     # Start instantly
sudo systemctl enable zramswap.service    # Start at boot

By default the zram device will have higher priority than other swap partitions or swap files, but you can check also this:

https://wiki.archlinux.org/index.php/Swap
https://wiki.archlinux.org/index.php/Ma … e_.2F_Zram

Last edited by ismaelvc (2013-04-02 06:20:37)


Laptop: LG LM70 Express                                                  Kernel: 3.14.2-1-ARCH   
CPU: Intel Pentium M processor @1.86GHz                  Hard Drive: 80G
Video: Mobility Radeon X600                                            X Driver: xf86-video-ati
Memory Size: 1.5G + zramswap: 384M + swap: 3G

Offline

#9 2013-04-02 06:16:48

Max-P
Member
Registered: 2011-06-11
Posts: 164

Re: Disk usage is crazy

You are using too much memory, causing memory pressure, which in turn causes the kernel to either swap some memory on disk (thus using disk a lot), or if it still doesn't work, it has to use the oom-killer and sacrifice a process for the other to work.

You can tune those a bit with vm.swappiness and vm.memory_overcommit using sysctl so it swaps less or denies abusive memory usage. Be careful with that, it cas cause worse results too.

A temporary workaround that I use is to use zram to compress a part of the system RAM, so we can store a bit more in it before it swaps out to disk. I think zram is there by default and only need to be enabled in systemd (zram.service, provided by "arch-systemd-units). Don't search for settings, the script does it all by itself.

Also, some programs seems to find their way to abuse disk IO. So far I've only seen VirtualBox and Wine do this. When I boot my VMs, VBox makes my disk unresponsive, every time.

You could also try the linux-ck kernel with the BFQ scheduler, which seems to have made my disk more responsive while it's being heavily used (but your mileage may vary).

Offline

#10 2013-04-02 06:24:49

ismaelvc
Member
From: México, D.F.
Registered: 2012-02-26
Posts: 136

Re: Disk usage is crazy

@Max-P: I don't know if zram is there by default now (I remember I had to install it), and I can't confirm right now (vacations yeey!), does anyone know for certain?

EDIT: Still if some programm is leaking your memory, in the end it will be the same swap (of any kind) or not, when the system uses most of the memory for whatever reason, userspace programs are killed to free memory until it normalizes again to ensure the system don't crash. (completely!)

Last edited by ismaelvc (2013-04-02 06:33:59)


Laptop: LG LM70 Express                                                  Kernel: 3.14.2-1-ARCH   
CPU: Intel Pentium M processor @1.86GHz                  Hard Drive: 80G
Video: Mobility Radeon X600                                            X Driver: xf86-video-ati
Memory Size: 1.5G + zramswap: 384M + swap: 3G

Offline

#11 2013-04-02 23:22:13

PReP
Member
From: Sweden
Registered: 2010-06-13
Posts: 359
Website

Re: Disk usage is crazy

I think you really need to find the process/processes that are using up all your memory, no matter swap or no swap.

ps -aux, pstree, htop?, just check with something : )


. Main: Intel Core i5 6600k @ 4.4 Ghz, 16 GB DDR4 XMP, Gefore GTX 970 (Gainward Phantom) - Arch Linux 64-Bit
. Server: Intel Core i5 2500k @ 3.9 Ghz, 8 GB DDR2-XMP RAM @ 1600 Mhz, Geforce GTX 570 (Gainward Phantom) - Arch Linux 64-Bit
. Body: Estrogen @ 90%, Testestorone @ 10% (Not scientific just out-of-my-guesstimate-brain)

Offline

#12 2013-04-02 23:41:17

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Disk usage is crazy

zram was moved to the AUR some time ago.  The package is called (unsurprisingly) "zramswap".  The module on the other hand is in-tree and provided with our default kernel.

Edit: Here I proves it:

% zgrep ZRAM /proc/config.gz
CONFIG_ZRAM=m
# CONFIG_ZRAM_DEBUG is not set

Last edited by WonderWoofy (2013-04-02 23:42:16)

Offline

#13 2013-04-03 02:47:02

ismaelvc
Member
From: México, D.F.
Registered: 2012-02-26
Posts: 136

Re: Disk usage is crazy

I'm sure we could clearly start identifying the issue if you would post the output of:

top 
#or 
htop 

instead of 'free' at that same momments the issue is happening, as we have seen those allready.   wink

Last edited by ismaelvc (2013-04-03 02:48:52)


Laptop: LG LM70 Express                                                  Kernel: 3.14.2-1-ARCH   
CPU: Intel Pentium M processor @1.86GHz                  Hard Drive: 80G
Video: Mobility Radeon X600                                            X Driver: xf86-video-ati
Memory Size: 1.5G + zramswap: 384M + swap: 3G

Offline

Board footer

Powered by FluxBB