4

This is a question about my home network setup.

I have a NAS, connected via gigabit ethernet to a switch, which is connected via 100mbit ethernet to router. Then I have my mac, connected via wireless N to my router.

Now, I transfer files to and from my NAS via samba. My NAS has terrible specs, 64mb RAM and a powerpc cpu thing.

My question is, is my transfer speed limited by my wifi, or by the specs of my NAS? What about if I connected directly to the router 100mbit? or the switch 1gbit? What then is the limiting factor?

I'd like to know a way I can check this, via linux tools on the NAS preferably as to whether i'm maxing out CPU or RAM? How would I go about preparing a report on this with real world numbers if I was doing this properly?

This is mostly for my curiosity (And to see where money needs to get spent next).

1
  • 1
    > What about if I connected directly to the router 100mbit? Well, I guess this is something you could just try, no?
    – scherand
    Feb 23, 2013 at 12:16

5 Answers 5

4
+50

So basically you have:

Mac <-- wireless N --> Router <-- 100MbE --> Switch <-- GbE --> NAS

The main things you can check here are the traffic capabilities of your network and the file copy capabilities of your devices. There are a number of utilities that are fast and efficient in addressing the characteristics of each.

Network

There's a cross-platform program called iperf which utilizes a client-server model to assess, among other things, network bandwidth. You'll want to download and/or compile a copy of iperf to both the NAS box and your Mac. Your NAS box in this instance is acting as your server, so you'll want to start iperf as a server: iperf -s. On your Mac, you'll want to run iperf -c <ip> where ip is the IP-address of your NAS box. This should give you an estimate of the raw capabilities of your network configuration between the Mac and the NAS system.

NAS File Copy

I noticed that the Synology 407e has two USB ports in the back. One thing you could to do assess strictly the file-copy capabilities of your NAS system is to attach an fast external hard drive, or preferably a solid state drive, and copy files to and from the external drive to your Samba share. To do this you could simply copy large files and estimate the time taken for transfer and divide it into the bulk transfer size. Or you could use a utility such as fio which operates as a file I/O benchmark. fio is a feature-rich utility that provides comprehensive statistics about the I/O operations it conducts. In conjunction with Chris' suggestion, you could run top as the file transfer is in progress to view real-time CPU and memory usage. Some other good system stat utilities are vmstat and dstat

Summary

If your network, NAS box, Mac, switches and routers are all functioning within their specifications, there is a possibility that one or more of your hard drives within the NAS are bad, or that the RAID array is corrupted. There could also be latency issues within your network that may need further investigation.

Tools

  • fio
  • iperf
  • Wireshark
  • dstat
  • traceroute

Report Preparation

Usually such a report would focus on bandwidth (MB/s), throughput (IO/s) and latency (ms). Smaller file sizes for transfer (512 bytes) generally offer higher throughput but worse bandwidth with minimal latency. Larger file sizes >64KB would show higher bandwidth, lesser throughput, and increased latency dependent on the transfer size and speed of the medium.

Source: 14 months of storage application benchmarking within a tech company.

2

The bottleneck will generally always be the network. Wireless will always be slower than wired. To test, connect your computer to directly to the NAS, then the switch, then the router, then via wireless, and use these commands on your computer:

time cp -r /nas/representative/directory /tmp # will print the durantion
rm -r /tmp/directory

That will time the copy for each connection, and you can judge from there.

1

What transfer speed are you seeing now? If it's around 10MBps, that's the fastest the 100Mb connection will go. This is probably the slowest connection in your network, though that's a best guess.

The unit itself it probably capable of cranking out 100MBps. There's definitely nothing wrong with the Power-PC architecture. 64MB of RAM is plenty enough for a purpose built device as well. I know of a few Power-PC SoCs that can crank out several times what the 1000Mb Ethernet connection on the back of the box can provide.

It's also possible that your disk drives in the array are limiting performance, or the disk controllers. There's really quite a few places a bottleneck could be. Without knowing much more about your setup it's impossible to give a reasonable guess.

4
  • I only see around 4.5MB/s at the moment over wifi. The NAS is a synology 407e with a Freescale MPC8245 and has RAID 1 4x750gb 7200rpm SATA Samsung drives.
    – Salgar
    Feb 18, 2013 at 19:22
  • But I'd rather have a way of measuring all the things you mentioned. e.g. I can monitor top and see that while i'm copying SMBD uses 20% cpu and 40% ram, but I can't tell if that is because there is only 40% of the ram available or because that's all it needs.
    – Salgar
    Feb 18, 2013 at 19:23
  • top should indicate how much RAM is free. Check ping times between your computer and the device. I'm not familiar with Synology devices, can you change smbd's configuration directly? The Freescale processor is more than capable of saturating 1GbE under normal conditions. The drives should be fine too.
    – Chris S
    Feb 18, 2013 at 19:38
  • iotop is the equivalent for IO monitoring. Generally storage throughput is a function of drive and network speed. Rarely are CPU/RAM an issue in file transfers. sar from the sysstat package is good for more in depth monitoring.
    – Ryan
    Feb 21, 2013 at 19:31
1

Obviously you have several bottlenecks combined, which doesn't make things better:

  • your NAS maxes out at about 20MB/s from what can be found on the internet
  • 100MBit/s network maxes out at about 12MB/s
  • 802.11n has high theoretical speeds, but I suspect you're on 2.4GHz, which has troubles going over 100MBit/s effective transfer speed - that's also clear from the 100MBit/s LAN interfaces

So to get maximum performance from your NAS, obviously a direct cable connection (1GBit/s) would be best.

With a better router (and maybe 5GHz support) you could at least minimize the Wifi slowdown, but obviously it would still be slower than a direct cable connection.

With a better router and a better NAS you'll be able to achieve reasonable performance (~30MByte/s I suspect from my own experience), but it'll likely cost you quite some money. You might be able to remove the switch, too, although it isn't part of the problem. Also, 5GHz also has heavy limitations in regards to range.

0

Check the link state of your NAS ethernet NIC. It's probably in 100Mbps half duplex mode. Some chips soemtimes won't auto detect link speed correctly with Gigabit switches. I had that with some Realtek chips.

Just do a ethtool eth0 or whatever NIC is called. Maybe that's it. To force Gigabit speed use ethtool -s eth0 speed 1000 duplex full.

2
  • 10Mbps is ~1.2MB/s, so clearly that's not the issue as @Salgar stated that he sees 4.5MB/s. Feb 28, 2013 at 8:06
  • That was a typo. I meant 100Mbps half duplex which is 12.5 / 2 = 6.25 MB/s maximum thorughput including protocol overhead. I remembered because I had the problem too with around 4.5MB/s throughput with samba.
    – kschurig
    Feb 28, 2013 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .