LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2008, 04:47 PM   #1
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Rep: Reputation: 45
NFS vs. CIFS


Hey guys,

I've been mounting shared drives from one of my Slackware 11 servers using CIFS/Samba for a long time, and I'm quite happy with this solution. It works for both Linux and Windows clients.

Lately though I've been feeling the need to experiment with NFS, as I was hoping to gain a bit of speed for the Linux clients (not that they are slow with CIFS).

So I setup a test share, and mounted it on a Slackware 12 machine.

I tried copying a 100 mb file from client to server. Using NFS it took 28 seconds. From the exact same machine, to the exact same server, using CIFS it only took 10 seconds. This is a 100mbit network.

I tried adjusting rsize/wsize to every imaginable combination, but speed stayed approximately the same, with 8192 coming out a wee bit faster at 27 seconds.

My question: What could be wrong? I suspect NFS should be at least as fast as CIFS, so I'm fairly certain there's something wrong with my setup.

Any and all advice is more than welcome.

/Thomas
 
Old 07-13-2008, 08:52 PM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 231Reputation: 231Reputation: 231
Arrow

This thread prompted me to spend some time creating test files of particular sizes using dd and "time" 'ing the copy via nfs between machines.

Here are my results on a 100Mbit lan:

Code:
 File size     Machine A->B           Machine B->A
  100 MB            8.78                    9.193
  1 GB             89.870                 106.71
This would work out to around 100 Mb which sounds about right. So obviously something strange going on with your setup.

Sorry I can't offer any advice but the figures may be useful.

Have you more than one client to test this on? Have you tried it both ways (server->client,client->server) or even running the copy on the server from a share on a client ?

Not sure what any findings will highlight as I'm no expert with nfs but something useful may occur.
 
Old 07-14-2008, 02:19 AM   #3
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by bgeddy View Post
This thread prompted me to spend some time creating test files of particular sizes using dd and "time" 'ing the copy via nfs between machines.

Here are my results on a 100Mbit lan:

Code:
 File size     Machine A->B           Machine B->A
  100 MB            8.78                    9.193
  1 GB             89.870                 106.71
This would work out to around 100 Mb which sounds about right. So obviously something strange going on with your setup.
Your numbers are looking a lot better than mine!

I'm fairly certain nothing weird is going in the network, as CIFS are working like a charm. Is NFS perhaps more CPU intensive than CIFS? I didn't test that, and the server I tried it on is just a small VIA Epia testserver. Could be that it's simply running out of breath.

Other than that, I'm blank.


Quote:
Originally Posted by bgeddy View Post
Sorry I can't offer any advice but the figures may be useful.

Have you more than one client to test this on? Have you tried it both ways (server->client,client->server) or even running the copy on the server from a share on a client ?

Not sure what any findings will highlight as I'm no expert with nfs but something useful may occur.
I have more clients and servers to test on, and hopefully those tests will yield some useful results.

Can I ask how you've mounted your NFS shares?

/Thomas
 
Old 07-14-2008, 05:42 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 231Reputation: 231Reputation: 231
Code:
Can I ask how you've mounted your NFS shares?
Nothing special here. On machine A the nfs server - "bgeddy", (Slackware 12.1), the exports :

Code:
/home/ed/ 192.168.1.0/255.255.255.0(rw,no_subtree_check,async)
On machine B the nfs client - "dellhost", (Slackware 12.0), the mount :

Code:
mount -t nfs bgeddy:/home/ed/ /home/ed/mnts/bgeddy/
For the B->A timings I reversed the roles of client and server machines by exporting from B and mounting on A then used time to:
Code:
time cp /home/ed/mnts/dellhost/testfile/test100MB.dat .

Machine A bgeddy is a P3 centrino 1200Mhz with ATA 300 GB, hdparm -t 64.24 MB/sec,
hdparm -T 86.5 MB/sec.

Machine B dellhost is a core 2 duo 4300 with 320 GB SATA, hdparm -t 50.30 MB/sec,
hdparm -T 941.81 MB/sec.

Network is a small 100 Mbit lan.

Running iptraf on the client shows a peak of around 97Mb/sec when running the test.

These times are only returned the first time I run the test. If I run it over and over again the times are cut massively so there must be lots of cacheing going on and iptraf would indicate local cacheing as it drops proportionately to the increase in transfer speed.
 
Old 07-15-2008, 03:29 PM   #5
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 224Reputation: 224Reputation: 224
Here's some tests from my machines as well. Only the default settings are used for mounting, and the servers. 2 RTL8169's MTU=7200, GigE switch.

Server
AMD Sempron 3000+(1.8Ghz) 1024MB Ram
hparm -tT
478.12 MB/sec
55.19 MB/sec

Client
Intel 2140 (1.6Ghzx2) 2048MB Ram.
hdparm -tT
982.16 MB/sec
76.38 MB/sec

First I created 2 files -
Code:
dd if=/dev/zero bs=512 count=200000 of=test100.bin
200000+0 records in
200000+0 records out
102400000 bytes (102 MB) copied, 0.9588 s, 107 MB/s

dd if=/dev/zero bs=512 count=1000000 of=test500.bin
1000000+0 records in
1000000+0 records out
512000000 bytes (512 MB) copied, 7.68052 s, 66.7 MB/s
CIFS
Quote:
time cp test100.bin test/

real 0m1.841s
user 0m0.003s
sys 0m0.306s

time cp test500.bin test/

real 0m12.105s
user 0m0.022s
sys 0m1.591s
NFS

Quote:

time cp test100.bin testnfs/

real 0m3.998s
user 0m0.002s
sys 0m0.177s

time cp test500.bin testnfs/

real 0m26.354s
user 0m0.002s
sys 0m1.134s
As you can see, I have the same issues as you. NFS peaked at 25MB/s, but seemed to jump between 9-20MB/s. CIFS/Samba Peaked at 75MB/s for the first couple of seconds, and gave a steady 38-42MB/s from there.

I defintly need to tune NFS, but adjusting RWSize from 2048 upto 32768 has zero impact at all, also attempted different MTU sizes, down to the default of 1500. I'll have to investigate what the exact issue is. I'd rather use NFS because exporting with UID/GID is much easier than setting up Samba for me. Once I figured out (RTFM) about creating users with the same UID/GID across the network on different machines to preserve permissions.

Might be file locks. But I know for a fact locking is enabled for Samba. Perhaps NFS's file locking has a higher overhead.
 
Old 07-16-2008, 01:56 AM   #6
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Original Poster
Rep: Reputation: 45
Maybe CIFS simply is "better" than NFS?

Personally I don't much care what I use, as long as it works, and if CIFS is the new black, then that's good enough for me.

Anybody here got any numbers that has NFS as the clear winner?


/Thomas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 45 04-06-2020 06:31 AM
2.6.21.5 and CIFS mattydee Slackware 4 10-03-2007 11:28 AM
Can't mount nfs- or cifs-share rw in Debian pingu Linux - Networking 0 07-03-2007 08:43 AM
Cifs AlessPT Linux - Networking 3 11-30-2004 03:11 PM
using CIFS witukind Linux - Networking 0 12-18-2003 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration