Notes to Self

Alex Sokolsky's Notes on Computers and Programming

11 April 2012

Hardware, New Iteration

Here is my new NAS box:

Interestingly enough, this configuration refused to boot with both memory sticks installed. Overclocking from 200MHz to 266MHz solves the problem. I conclude that the memory is just too fast for such a slow CPU. As a result CPU runs at 2.3GHz. Not a big deal, given that SpeedStep throttles it down most of the time anyway. Setup ssh.

One of my clients is a Windows 7 HTPC:

Another Windows 7 client is

I also have Intel PCI-E Gigabit NIC to play with. All computers are connected to this Gigabit switch.

Network Performance

My first attempts to figure out why performance is lacking were very confusing. Therefore I am testing separately performance of the network, disks, and file system.

For network performance testing I use iperf which is available for all OSs I am running. From HTPC:

C:\utils\iperf-2.0.5-cygwin>iperf.exe -c nas -f M
------------------------------------------------------------
Client connecting to nas, TCP port 5001
TCP window size: 0.06 MByte (default)
------------------------------------------------------------
[  3] local 192.168.1.104 port 49575 connected with 192.168.1.10 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  13.4 MBytes  1.33 MBytes/sec

C:\utils\iperf-2.0.5-cygwin>iperf.exe -c nas -f M -w 512k
------------------------------------------------------------
Client connecting to nas, TCP port 5001
TCP window size: 0.50 MByte
------------------------------------------------------------
[  3] local 192.168.1.104 port 49579 connected with 192.168.1.10 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1052 MBytes   105 MBytes/sec

Notice a dramatic impact of the window size on the measured bandwidth. For UDP however larger window size does not help at all:

C:\utils\iperf-2.0.5-cygwin>iperf.exe -c nas -f M -w 256k -u
------------------------------------------------------------
Client connecting to nas, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 0.25 MByte
------------------------------------------------------------
[  3] local 192.168.1.104 port 62782 connected with 192.168.1.10 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.25 MBytes  0.13 MBytes/sec
[  3] Sent 893 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec  1.25 MBytes  0.13 MBytes/sec   0.338 ms    0/  892 (0%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order

I then will use FTP and only then Samba for throughput measurements. On NAS side I will use

netstat

and

sysctl dev.re.0.stats=1
dev.re.0.stats: -1 -> -1

command, where re0 is the Realtek NIC. Start with direct cable connection, to avoid bad cable/switch issues. Techniques to consider: network polling, Windows-side optimization. More on Enabling High Performance Data Transfers, and FreeBSD Network Performance Tuning.

Disk Performance

Disk performance testing using diskinfo -t.

nas:/mnt# camcontrol devlist
<SanDisk SDCFH-004G HDX 6.02>      at scbus0 target 0 lun 0 (ada0,pass0)
<ST3320620AS 3.AAK>                at scbus1 target 0 lun 0 (ada1,pass1)
<ST2000DL003-9VT166 CC3C>          at scbus1 target 1 lun 0 (ada2,pass2)
<WDC WD5000AAKS-00V1A0 05.01D05>   at scbus2 target 0 lun 0 (ada3,pass3)
<ST2000DL003-9VT166 CC3C>          at scbus2 target 1 lun 0 (ada4,pass4)
nas:/mnt# diskinfo -t ada1
ada1
        512             # sectorsize
        320072933376    # mediasize in bytes (298G)
        625142448       # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        620181          # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        9QF3BS42        # Disk ident.

Seek times:
        Full stroke:      250 iter in   5.238228 sec =   20.953 msec
        Half stroke:      250 iter in   3.867091 sec =   15.468 msec
        Quarter stroke:   500 iter in   6.215048 sec =   12.430 msec
        Short forward:    400 iter in   1.674251 sec =    4.186 msec
        Short backward:   400 iter in   2.023333 sec =    5.058 msec
        Seq outer:       2048 iter in   0.989333 sec =    0.483 msec
        Seq inner:       2048 iter in   1.033952 sec =    0.505 msec
Transfer rates:
        outside:       102400 kbytes in   1.774573 sec =    57704 kbytes/sec
        middle:        102400 kbytes in   1.783387 sec =    57419 kbytes/sec
        inside:        102400 kbytes in   2.684722 sec =    38142 kbytes/sec

nas:/mnt# diskinfo -t ada2
ada2
        512             # sectorsize
        2000398934016   # mediasize in bytes (1.8T)
        3907029168      # mediasize in sectors
        4096            # stripesize
        0               # stripeoffset
        3876021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        6YD20H52        # Disk ident.

Seek times:
        Full stroke:      250 iter in   6.660599 sec =   26.642 msec
        Half stroke:      250 iter in   5.055938 sec =   20.224 msec
        Quarter stroke:   500 iter in   8.201362 sec =   16.403 msec
        Short forward:    400 iter in   2.848986 sec =    7.122 msec
        Short backward:   400 iter in   3.272430 sec =    8.181 msec
        Seq outer:       2048 iter in   0.578140 sec =    0.282 msec
        Seq inner:       2048 iter in   0.583157 sec =    0.285 msec
Transfer rates:
        outside:       102400 kbytes in   1.093656 sec =    93631 kbytes/sec
        middle:        102400 kbytes in   1.081835 sec =    94654 kbytes/sec
        inside:        102400 kbytes in   1.656841 sec =    61804 kbytes/sec

nas:/mnt# diskinfo -t ada3
ada3
        512             # sectorsize
        500107862016    # mediasize in bytes (465G)
        976773168       # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        969021          # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        WD-WCAWF0558229 # Disk ident.

Seek times:
        Full stroke:      250 iter in   6.727210 sec =   26.909 msec
        Half stroke:      250 iter in   4.525683 sec =   18.103 msec
        Quarter stroke:   500 iter in   6.967313 sec =   13.935 msec
        Short forward:    400 iter in   2.097940 sec =    5.245 msec
        Short backward:   400 iter in   1.366547 sec =    3.416 msec
        Seq outer:       2048 iter in   0.699322 sec =    0.341 msec
        Seq inner:       2048 iter in   0.693734 sec =    0.339 msec
Transfer rates:
        outside:       102400 kbytes in   1.193988 sec =    85763 kbytes/sec
        middle:        102400 kbytes in   1.071763 sec =    95544 kbytes/sec
        inside:        102400 kbytes in   1.639349 sec =    62464 kbytes/sec

nas:/mnt# diskinfo -t ada4
ada4
        512             # sectorsize
        2000398934016   # mediasize in bytes (1.8T)
        3907029168      # mediasize in sectors
        4096            # stripesize
        0               # stripeoffset
        3876021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        6YD1Z7CA        # Disk ident.

Seek times:
        Full stroke:      250 iter in   6.561036 sec =   26.244 msec
        Half stroke:      250 iter in   4.939224 sec =   19.757 msec
        Quarter stroke:   500 iter in   8.066986 sec =   16.134 msec
        Short forward:    400 iter in   3.188722 sec =    7.972 msec
        Short backward:   400 iter in   3.768447 sec =    9.421 msec
        Seq outer:       2048 iter in   0.565191 sec =    0.276 msec
        Seq inner:       2048 iter in   0.601144 sec =    0.294 msec
Transfer rates:
        outside:       102400 kbytes in   1.079444 sec =    94864 kbytes/sec
        middle:        102400 kbytes in   1.081266 sec =    94704 kbytes/sec
        inside:        102400 kbytes in   1.409226 sec =    72664 kbytes/sec

Alternatively create load

dd bs=1m of=/dev/null if=/dev/da6

and then use gstat

Original post

tags: hardware