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
')