My digital photos are stored on an inexpensive NAS. This CH3SNAS consists of dual 3.5″ SATA drives of, in my case, 1 TByte each. Each drive contains a copy of each photo (RAID 1) for robustness. Lightroom 3 maintains a catalog of these photos (with associated keywords, metadata and a cache of previews) on the computer’s local hard disk. Unfortunately, although the NAS is fine for archiving and backup tasks, Lightroom’s access to the stored photos is rather slow. The question is thus whether I can get better read performance by tweaking this setup, or need to upgrade to a fancier NAS.
The NAS and its drives
- the NAS is a small Linux-based ARM9 box with 64 MBytes of memory
- the drives in the NAS and in my desktop PC are all:
- Samsung Spinpoint F1 HD103UJ
- drive specs: SATA-300, 7200 RPM, 32 MB cache
- the NAS is connected to the client PC via a switch. The router, the NAS and the PC are capable of running Gigabit Ethernet.
- the relevant partition is formated as RAID 1 (although I don’t recommend that any more) meaning that each file is simply stored on both drives for safety
Basic drive performance
I benchmarked one of the Samsung Spinpoint F1 HD103UJ drives mounted inside a desktop PC using HD Tune Pro. This test thus tests what the drive can do under normal (non-NAS) conditions.
Detail: I restricted the part of the drive under test to 0.75 Terrabytes because the data on the NAS was confined to a 750 GB RAID 1 partition on each drive. This doesn’t change the measurements significantly.
The average transfer rate is thus 84 MB/s while the average latency was 13.5 ms. In other words, the drives themselves can sustain read speeds of 5 GBytes/minute if the files are big enough. I am ignoring write performance because it gives similar results and is less relevant for my usage (“read-mostly”).
Usage of the NAS
I currently have 26,000 digital photos (JPG, RAW, occasionally other stuff) requiring 225 GBytes of space. In RAID 1, this takes 225 GBytes per drive.
The average size of a single photo is roughly 17 MBytes (a mix of recent JPGs and two types of RAW). A worst case photo (Raw, full resolution, depends on compressibility) can exceed 30 MBytes.
NAS performance across the network
Copying a 16 GByte directory consisting of 902 photos (Egypt) from the NAS to the local disk:
- took 26.5 minutes = 11 MBytes/s = 0.6 GBytes/minute = 34 photos/minute
- generating an average network traffic of 10.1 MByte/s (received). Note sure where the 10% discrepancy comes from.
- CPU load on the NAS (log in with
topcommand) is about 50%
To check this, I copied the same directory from the NAS to the NAS (to a non-RAID partition):
- took 53.5 minutes = 4.9 MBytes/s = 0.3 GBytes/minute = 17 photos/minute
- generating network traffic of 5 MBytes/second per direction
This is consistent (enough): the NAS now needs to read and write the data. It incidentally shows that the time needed to store data on the local hard disk in the 11 MBytes/s test case was apparently negligible.
So the problem is that the drives can read (or write) data at 5 GBytes/minute, but the NAS is only reading at 0.6 GBytes/minute. The “34 photos/minute” also implies that the NAS performance can easily limit the performance of browsing of photos that are not stored in the cache.
One reviewer, however, measured 21 MBytes/s rather than my 11 MBytes/s. So this gives hope that performance can be tweaked.
Optimizations and errors found
- I found I had 100% CPU load on the NAS, even when running on a 100 Mbps link: 50% went to
samba, 25% to
inotify_itunesand 25% to
inotify_upnp. Disabling iTunes and univeral Plug-and-Play using the Web interface thus got the CPU load down to about 50%. Apparently this is a bug in older versions of the CH3SNAS firmware that causes these two processes to eat all remaining idle time. Apart from wasting power, they undoubtedly don’t help performance.
- The NAS was still configured to run at 100 Mbps, despite having a 1000 Mbps Ethernet link to the router (and beyond).
- Adobe itself just announced that the imminent version of Lightroom would fix “Library: Sub-optimal preview rendering performance could impact application performance“. Whatever that means, it is always welcome.
Checking the NAS performance locally
[ coming ]
So where is the bottleneck?
[ coming ]