Page 1 of 1
kswapd used too much ?

Posted:
Jun 23rd, '13, 12:41
by pmithrandir
Hello,
Since the migration to mageia 3, (reinstall from scratch)I have the impression that the system is using much more swap than before.
I have 4HB of RAM, and I'm using the 64bits distribution.
But all the time I'm happen to copy a file(or a bunch of file for an amount like 10GB), my CPU(double core) goes crazy to 100%.
At the same time, the system start to swap.
I have 2 process at the same time : (in real they are using all CPU)
kswapd0 at 35% of CPU
mount.ntfs at 20%
Honestly, I have still 2GB of memory free, but the system is swapping... I don't understand.
Do you know if there is anything I can do , and if it's new ?
Thank you,
Pierre
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 12:59
by pmithrandir
Maybe the problem is more on the config.
When the system has 50% of memory use, is it really time to swap ?
My config is that I have 4GB of RAM, and 4 of Swap...
Maybe I could just setup the level after which it start to swap a little bit higher ?
Or maybe I can find a way to use less memory during copy process(quite simple normally...)
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 14:12
by djennings
You can configure the 'swappiness' see
https://wiki.archlinux.org/index.php/Swap#SwappinessBut it should not be necessary. The default settings should be fine.
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 15:02
by doktor5000
Depends on what you copy. E.g. if you would try to write a 4GB image with dd somewhere, dd will try to read the whole 4GB file into RAM,
in which case it would start swapping on your configuration.
So which size/number of files do you copy and where?
I've understood that this happens with a bunch of small files, totaling at multiple GB's, writing to NTFS file systems?
I wouldn't expect much better performance, depending on the fill state, amount of free space and fragmentation writing to NTFS uses
quite a lot of CPU time and RAM, which may slow a system to a crawl.
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 15:13
by pmithrandir
Hi,
To be more specific, I'm copying 12 - 20 files of 350 MBytes from my ext4 home partition(still 130GB free) to an 99% free ntfs hard drive (250GB free)
That what is unusual, copying 120000 files would not seems strange to overload the CPU, but 20 ?
I'm using the simple copy past from dolphin.
No dd involved
Thank you, I will check the swap configuration, just in case there is an issue.
Pierre
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 15:20
by pmithrandir
here is my /etc/sysctl.conf file :
- Code: Select all
[root@localhost ~]# cat /etc/sysctl.conf
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.all.log_martians=1
Isn't it suppose to contain informations about swapiness ?
Thanks,
PIerre
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 16:03
by doktor5000
/etc/sysctl.conf only contains changes to the default settings. Run
- Code: Select all
sysctl -a
as root to get the current setting of all tunables.
Re: kswapd used too much ?

Posted:
Jun 23rd, '13, 16:18
by pmithrandir
hank you,
I get that :
- Code: Select all
vm.stat_interval = 1
vm.swappiness = 60
I will try to change it to 35 or something like that... as I I'm always in teh 60% zone with firefox launch, but I'm never getting bigger than 3GB.