Improving network speed on Synology DS207 NAS

I have relatively old DS207 NAS with a Gigabit Ethernet port. Device CPU is mpc8241 PPC running @ 266MHz, so i never expected very fast transfer speed. NAS firmware is DSM3.2 with PowerPC 2.6.24 linux kernel. Performance was reasonable but less then i expected. After some experiments i found that bottleneck is network card (HDD works faster). What i really like in Synology DSM that there is no any needs for the device hacking – all you need to get the root is to enable “Terminal” option in the web interface.

Using “dmesg” command i found that Ethernet card is Yukon Gigabit Ethernet 10/100/1000Base-T Adapter. I decided to test it speed with iperf tool (using ipkg), wget and smbclient from my Linux box. I found that network speed PC -> NAS is about 230Mbit/sec and NAS -> PC ~120Mbit/sec. Kernel drvier for this card is sk98lin so i decided to see if there are any settings affecting performance to play with.

In Documentation i found 2 such settings Moderation and IntsPerSec. I decided to play with them.

To do this i modified /etc/rc boot script. I decided to add my “ismode” line before vendor one, to make sure that if there are any error in the options – device will continue to boot. Because my line is before one from vendor – system will use my settings (vendor module will be silently ignored with “File exists” message). Vendor modules are loaded on SYNOLoadModule ${NET_MODULES} line, so i just added insmod /lib/modules/sk98lin.ko Moderation=Dynamic before and restarted device. After restart driver settings could be shown using “cat /proc/net/sk98lin/eth0” command. I did 4 tests: without any changes (moderation disabled), Dynamic Moderation, Static Moderation (2000 ints/sec) and Static Moderation (1000 ints/sec). On every mode i did 3 tests:

  1. iperf bidirectional test with “iperf -c diskstation -t 15 --format KBytes -x CMS -r” on client and “iperf -s” on NAS
  2. Downloading of 1 GB from nginx HTTP server installed on NAS  with command “wget  http://diskstation:2080/1000mb.bin  -O /dev/null -o /dev/stdout|grep saved
  3. Downloading file from nas using SMB (CIFS) protocol with smbclient tool: “smbclient -c 'get 1000mb.bin /dev/null' -U admin //diskstation/music password"

Every test was running 3 times, without any other activity on this device. Raw data is available from my server. Below is a summary with average values for every test:

Moderation type iperf DL iperf UP HTTP (nginx) SMB (samba)
Disabled (default) 120.8 MBit/sec 230.6 MBit/sec 118.7 MBit/sec 118.2 MBit/sec
dynamic (2000 ints/sec) 140.7 MBit/sec 235.3 MBit/sec 148.5 MBit/sec 128.0 MBit/sec
static (2000 ints/sec) 141.4 MBit/sec 240.8 MBit/sec 165.1 MBit/sec 148.5 MBit/sec
static (1000 ints/sec) 155.9 MBit/sec 241.0 MBit/sec 185.1 MBit/sec 163.2 MBit/sec

As you could see there is a real improvement on all services. It is especially noticeable with nginx, probably because it using senfile() and epoll() kernel functionality. On HTTP i got 36% improvement, on SMB ~28%. I found no regression from this step, so will leave it as is.

Advertisements
Tagged , , ,

16 thoughts on “Improving network speed on Synology DS207 NAS

  1. ilGaspa says:

    May I ask if this mod will work on a DS109 too? Will it survive DSM updates?
    I’m not a linux expert but I’d need a little improvement of my DS109 network performance…

    • sammczk says:

      as far as I could see – DS109 is build on different hardware platform (Marvell Kirkwood mv6281 ARM Processor). You can find which networc card is installed using “dmesg” command output in the NAS terminal.

  2. John says:

    Hi,
    I tried it on my old DS-207 and it works perfectly and it seems to be working on my other box the CS-407e as well.
    Thumbs up!

    Cheers,
    John

    • sammczk says:

      Thanks for the report.

      • MadsP says:

        Hi

        1. Have you seen the url about upgrading to a better DSM when fooling the synoinfo.conf.
        http://www.timo.dk/wp/2011/08/07/upgrading-the-synology-106e-firmware-to-to-3-1/

        2. Can you post where to put the line you made? My skills are only as a scriptkiddie so need som help here.

        “some content of RC:”
        SYNOLoadModule ${NET_MODULES}

        RunSynoBios=`/bin/get_key_value /etc/synoinfo.conf synobios`
        UniqueHD=`/bin/get_key_value /etc.defaults/synoinfo.conf unique | cut -d”_” -f2`
        if [ “no” != “$RunSynoBios” ]; then
        if [ “x${LinuxVersion}” != “x2.6″ ]; then
        SYNOBIOS=”synobios.o”
        else
        case “${UniqueHD}” in
        7820)
        SYNOBIOS=”thermAndFan-820.ko synobios.ko”
        ;;
        *)
        SYNOBIOS=”synobios.ko”
        ;;
        esac
        fi
        SYNOLoadModule ${SYNOBIOS}
        /bin/mknod /dev/synobios c 201 0 2>/dev/null
        fi

        for PidDir in /var/run /etc/dhcpc;
        do
        rm -rf ${PidDir}/*.pid
        done

        Kind regards

      • sammczk says:

        1. My device already running 3.x, so i don`t need it.
        2. right BEFORE
        SYNOLoadModule ${NET_MODULES}
        line

  3. Bram says:

    Thanks!
    Worked perfectly!

    • Richard says:

      so if I want to add the 1000 to the line it would be?

      insmod /lib/modules/sk98lin.ko Moderation=Static IntsPerSec=1000

      also the documentation list the name as “sk98lin.o ” not “sk98lin.ko” so which is correct?

      I did the dynamic and I only got about a 2 % change Looking for more

      • sammczk says:

        sk98lin.ko. Actual difference will depend on your workload. Also i would recommend to enable and use jumbo frames for additional improvements.

  4. p1_p1_p1 says:

    i have some problem with saving /etc/rc it says its read only, i tried edit it with vi /etc/rc and save with :q !sudo tee % but without success … any help?

  5. harry says:

    Hi, I ran into this blog of yours while troubled by the speed of reading and writing of my legacy DS207.

    I have gigabit network set up, but files transfer under windows 7 is average at 6MB/s max at 14MB/s

    I would like to try your method, but couldn’t understand how you get DSM3.2 installed.

    Any hints?

  6. Sven says:

    Hi,
    maybe you can help me, I edited my /etc/rc as you described it and added the following;
    /// ;;
    esac
    insmod /lib/modules/sk98lin.ko Moderation=Static IntsPerSec=1000

    SYNOLoadModule ${NET_MODULES}
    ////

    Should be the right position and file, or am I mistaken?
    But it`s not applied, dmesg and the “cat /proc/net/sk98lin/eth0”-output show Moderation as disabled.
    What I am doing wrong?

  7. Sven says:

    Hi,
    thanks for your Post!
    I added the line “insmod /lib/modules/sk98lin.ko Moderation=Static IntsPerSec=1000” before the “SYNOLoadModule ${NET_MODULES}”-line in the /etc/rc-file just as you wrote.
    But after a reboot I see Moderation=disabled in the dmesg-output and in “cat /proc/net/sk98lin/eth0”-output.
    Do you have any idea what I am doing wrong?
    Thanks!
    Sven

  8. Lithium says:

    Hi there,
    I am trying to mod the file in the same way a described above.
    Writing the file is no problem. After a reboot i tried to use the command: cat /proc/net/sk98lin/eth0
    But the files or directory doesn’t even exist:
    cat: can’t open ‘/proc/net/sk98lin/eth0’: No such file or directory

    Would it be possible to help me a bit?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: