quick swap use and system overload

Ask questions about Arch Linux ARM. Please search before making a new topic.

quick swap use and system overload

Postby ard » Fri Oct 14, 2011 10:56 am

I have strange issue with swap on my Seagate GoFlex Home. I've followed instructions and successfully moved to archlinuxarm and was able to setup all necessary services. But suddenly I found the following in messages:

$this->bbcode_second_pass_code('', '[14420.744435] Out of memory: Kill process 1079 (minidlna) score 74 or sacrifice child
[14420.752230] Killed process 1079 (minidlna) total-vm:40112kB, anon-rss:9132kB, file-rss:0kB')

And I decided to get swap partition. I've created additional partition for swap on the main drive and formatted it.

$this->bbcode_second_pass_code('', '[root@ardnas conf]# fdisk -l /dev/sda

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000208d1

Device Boot Start End Blocks Id System
/dev/sda1 64 49999992 24999964+ 83 Linux
/dev/sda2 50000000 50499992 249996+ 82 Linux swap / Solaris
/dev/sda3 50500000 3907029167 1928264584 83 Linux
[root@ardnas conf]#
')


And found that once I enable swap the system starts using alot, as result load grows 'wa' alway high and everything slowdown. even file copying over ftp...

$this->bbcode_second_pass_code('', '
top - 13:37:27 up 16:19, 2 users, load average: 1.56, 0.88, 0.49
Tasks: 72 total, 1 running, 70 sleeping, 0 stopped, 1 zombie
Cpu(s): 1.8%us, 34.1%sy, 2.4%ni, 3.3%id, 49.8%wa, 0.0%hi, 8.5%si, 0.0%st
Mem: 123904k total, 122400k used, 1504k free, 664k buffers
Swap: 249992k total, 88484k used, 161508k free, 106508k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP COMMAND
1129 torrent 20 0 64444 1172 1172 S 2.4 0.9 24:34.20 61m transmission-da
22925 nobody 20 0 38272 956 900 S 6.7 0.8 0:05.79 36m minidlna
1069 nobody 20 0 35988 36 36 S 0.0 0.0 0:04.03 35m mt-daapd
15837 ard 20 0 20556 112 100 S 0.3 0.1 1:46.43 19m afpd
1060 root 20 0 20088 72 72 S 0.0 0.1 0:00.06 19m smbd
1057 root 20 0 19984 284 284 S 0.0 0.2 0:03.97 19m smbd
1091 root 20 0 19552 48 48 S 0.0 0.0 0:01.14 19m cnid_dbd
1039 root 20 0 16548 36 36 S 0.0 0.0 0:11.01 16m afpd
1061 root 20 0 10856 312 312 S 0.0 0.3 0:05.99 10m nmbd
10047 root 20 0 10040 48 48 S 0.0 0.0 0:24.76 9992 mc
1626 root 20 0 9384 0 0 S 0.0 0.0 0:03.48 9384 sshd
1092 root 20 0 9000 160 160 S 0.0 0.1 0:11.41 8840 sshd
1098 root 20 0 9000 172 172 S 0.0 0.1 0:05.89 8828 sshd
944 root 20 0 6484 144 144 S 0.0 0.1 0:03.77 6340 syslog-ng
1004 root 20 0 5728 0 0 S 0.0 0.0 0:00.01 5728 sshd
1100 root 20 0 5248 0 0 S 0.0 0.0 0:00.19 5248 bash
1095 root 20 0 5248 288 288 S 0.0 0.2 0:01.43 4960 bash
1048 root 20 0 4900 0 0 S 0.0 0.0 0:00.01 4900 cnid_metad
10049 root 20 0 5248 440 440 S 0.0 0.4 0:03.93 4808 bash
22818 nobody 20 0 4236 120 120 S 0.0 0.1 0:00.03 4116 vsftpd
1163 root 20 0 4036 24 24 S 0.0 0.0 0:00.02 4012 vsftpd
22820 ard 20 0 4336 388 300 S 38.8 0.3 11:42.31 3948 vsftpd
943 root 20 0 3788 0 0 S 0.0 0.0 0:00.00 3788 syslog-ng
1084 root 20 0 3780 0 0 S 0.0 0.0 0:00.00 3780 agetty
1085 root 20 0 3780 0 0 S 0.0 0.0 0:00.00 3780 agetty
22776 root 20 0 3768 40 40 S 0.0 0.0 0:00.00 3728 crond
22765 root 20 0 3772 48 48 S 0.0 0.0 0:00.02 3724 crond
1013 root 20 0 3452 32 32 S 0.0 0.0 0:00.79 3420 ntpd
1012 ntp 20 0 3320 180 180 S 0.0 0.1 0:01.13 3140 ntpd
1031 avahi 20 0 2992 0 0 S 0.0 0.0 0:00.00 2992 avahi-daemon
1628 root 20 0 2988 0 0 S 0.0 0.0 0:00.01 2988 bash
1629 root 20 0 2988 0 0 S 0.0 0.0 0:20.75 2988 sh
1030 avahi 20 0 3116 180 180 S 0.0 0.1 0:07.44 2936 avahi-daemon
989 root 20 0 2756 220 220 S 0.0 0.2 0:01.33 2536 crond
1022 dbus 20 0 2452 0 0 S 0.0 0.0 0:00.02 2452 dbus-daemon
22799 root 20 0 2484 124 124 S 0.0 0.1 0:00.06 2360 sadc
715 root 20 0 2184 80 80 S 0.0 0.1 0:00.24 2104 udevd
753 root 20 0 2072 0 0 S 0.0 0.0 0:00.00 2072 udevd
752 root 20 0 2072 88 88 S 0.0 0.1 0:00.06 1984 udevd
974 root 20 0 1888 0 0 S 0.0 0.0 0:00.00 1888 dhcpcd
1083 root 20 0 1732 0 0 S 0.0 0.0 0:00.00 1732 agetty
1 root 20 0 1652 36 36 S 0.0 0.0 0:03.10 1616 init
23035 root 20 0 2332 728 624 R 0.9 0.6 0:00.22 1604 top
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 0 kthreadd
')

Once I disable swap, the device start working fast. 'wa' is minimum, load average is almost 0.

To use swap only when caches ended I set the following:
$this->bbcode_second_pass_code('', '[root@ardnas ~]# sysctl vm.swappiness
vm.swappiness = 0')

But this didn't help, the result is the same.

Could someone explain what I am doing wrong and why it starts using swap so fast and so lots. Such swap use cause really pure performance to the system.

--
$this->bbcode_second_pass_code('', '[root@ardnas ~]# uname -a
Linux ardnas 3.0-ARCH #1 PREEMPT Sat Aug 20 04:27:21 UTC 2011 armv5tel Feroceon 88FR131 rev 1 (v5l) Seagate GoFlex Home GNU/Linux
[root@ardnas ~]# cat /etc/plugapps-version
2011.06
')
ard
 
Posts: 3
Joined: Fri Oct 14, 2011 10:16 am

Re: quick swap use and system overload

Postby kmihelich » Fri Oct 14, 2011 3:29 pm

Swapping on these devices heavily penalizes performance, depending on how much swap is actually being used. If you're running the system and swap from SATA drive, the hit shouldn't be too terrible but it will be noticeable. If you're running system and swap from USB, you're shooting yourself in the foot.

With only 128MB of RAM, you need to be a bit more judicial of what is running on the system. Use lighter weight programs, or get rid of services you don't explicitly need.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: quick swap use and system overload

Postby hydro » Fri Oct 14, 2011 3:47 pm

Increased swapping may also be partially caused by kernel 3.0, as was observed by some users here. It seems like vm.vfs_cache_pressure=0 and vm.dirty_ratio = 5 may help. You can also slightly "increase" RAM by comressing it using compcache. The module zram is already in the kernel, you only need the initscript and configuration file (or set up /dev/zram0 manually). I've been using it for some months now on my DockStar and it is sufficient for me (I have no real swap partition or file).

Edit: The compcache AUR package was updated today, the unnecessary building of the module was removed, so you can use the package without modification.
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: quick swap use and system overload

Postby ard » Fri Oct 14, 2011 10:43 pm

Thank you hydro,

I've decided to try vm.vfs_cache_pressure = 50 vm.dirty_ratio = 15 for the beginning. An in case of positive effect in terms of performance, will lower them more.

…compcache… it is something very-very cool. The idea to put swap into ram… Already testing this... this should have been present in "Guides" on the main site. To pay attention of the new users.
ard
 
Posts: 3
Joined: Fri Oct 14, 2011 10:16 am

Re: quick swap use and system overload

Postby Highvoltag3 » Mon Oct 31, 2011 6:59 pm

@ARD how did this turn out? I've been using swap for a while an it is not until now I see there's a performance issue here...

Besides explaining how this turned out for you a small guide if you have time would be nice (here in the forum).

Thanks in advance.
Highvoltag3
 
Posts: 45
Joined: Sat Mar 19, 2011 10:28 am

Re: quick swap use and system overload

Postby WarheadsSE » Mon Oct 31, 2011 7:11 pm

Compcache, is relatively new to the plugs, AFAIK, and putting SWAP into RAM is like plugging your power strip into itself.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: quick swap use and system overload

Postby Highvoltag3 » Mon Oct 31, 2011 7:15 pm

$this->bbcode_second_pass_quote('WarheadsSE', 'C')ompcache, is relatively new to the plugs, AFAIK, and putting SWAP into RAM is like plugging your power strip into itself.


LMAO
Highvoltag3
 
Posts: 45
Joined: Sat Mar 19, 2011 10:28 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 9 guests