NFS vs. CIFS (aka SMB)

Posted by Dietmar Schmidt Mon, 09 Mar 2009 14:51:00 GMT

Before we put a new file server into production, we make a few benchmarks for the CIFS and NFS performance. The new server was a Solaris box with huge ZFS volumes. On the Solaris server an NFS server and Samba (for CIFS) are running out of the box. Samba was configured to use our MS Active Directory for Authentication.

As benchmarks we use the following:

A program that reads files of different sizes (5GB, 100MB, 10MB 1MB) from the server share.

Different copy jobs with a 5GB file and 1GB folders with different file sizes.

If you are interested in the detailed environment, benchmark description, values and charts you can download this pdf .

For all the benchmarks we measure the time for completion and calculate the transfer rates.
To omit compression of the used protocols we used files created with /dev/urandom.

We expected nearly the same values for reading a file and copying to a local drive, since both tests do the same (copy additionally writes to a local disk and might therefore be slower).

Reading from a server share is the most common task done in the real world, so this performance has more effect in real environments.

The CIFS and NFS shares are in the same shared folder on the server.

We discovered that NFS was very fast, but CIFS was very slow. Especially when we read from the server or copied from the server. With NFS we read a 5 GB file with over 80 MB/s (about one minute), the same file has only 7 MB/s (about 12 minutes) with CIFS! All the different copy jobs from the server share to the local drive are under 10MB/s for CIFS; for NFS we are never under 40MB/s.

For the copy the files to the server jobs, NFS was also always faster than CIFS, but only by about 10 MB/s. So sending files to the server with CIFS has no such bad performance.

We were very surprised about the bad values for CIFS. To verify the results, we decided to measure another system. A Windows Server 2008 with a faster CPU and a fast storage system. The results were in the range of the Solaris NFS System. When copying to the server share, the Windows system is always faster than the Solaris system.

So CIFS is not slow, but our Solaris system is slow; maybe Samba is the problem?

To verify this we used a slower Linux box with Samba and NFS. On the Linux server we have also nearly 80 MB/s for NFS for the 5 GB file. If we use smaller files the transfer-rates are slower compared to our Solaris NFS server. As expected, asynchronous NFS was a bit faster than synchronous NFS. For the CIFS share we measured 37 MB/s. For the most benchmarks CIFS and NFS have comparable results. With some benchmarks CIFS wins, with others, NFS.

As expected Samba is not slow at all.

Back to our Solaris system, we discussed the next steps to find out why we measure such bad values for CIFS. First we tried some performance parameters in the Samba configuration. This gave us minimally better results. This made us think, maybe our Active Directory authentication is the problem, so we decided to use local authentication for Samba. This gave us marginally better results. After asking a Linux specialist in our IT Department to take a look at this, he found the problem (high log level for Samba) and solved it. Now Samba on the Solaris box is comparable to the Windows 2008 Server. As our tests are now finished, we can say the winner is NFS: If you are reading from a server share, the results are slightly better than for CIFS. When writing to a server share, CIFS is clearly faster for all writing benchmarks.

If you are interested in the results with charts, please download this pdf .

Posted in | no comments |

tp://')) %>
Powered by typo