View previous topic :: View next topic |
Author |
Message |
ckdake l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/11934487963f0a23d4e4918.gif)
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Tue Oct 26, 2004 1:06 pm Post subject: NFS or Samba? |
|
|
I'm doing some research for both self interest and to come up with a set of criteria for some things at work. Basically, I know that Samba nd NFS both do different thigns and each have their pros and con's but heres what I have so far and I'm just wondering if I've left anything significant out. Once this is all said and done I will be making a HOWTO for deciding which one to use.
NFS
-come with most unix/linux by default
-must be installed on windows using third party tools
-protocol designed for only file sharing
-well designed and documented yet supposedly difficult to configure
-unix permissions
-support for larger file sizes (2GB+)
-no required time synchronization
-locking issue: nfs is stateless so if A and B are connected to server C, A is working on a file and crashes during a write, the file will remain locked until either A or C is restarted. If C crashes while clients have a lock, all locks are lost and B could get a lock on the file while A thinks it has the lock, next time A tries to do something there could be problems (not a problem for a stable environment where files are only accessed by one user at a time or at all)
-Regardless of the system specifics, programs often assume that if they are unable to obtain a lock, it is because another program has the lock. This can cause problems as programs wait for the lock to be freed. Since the reason the lock fails is because locking is unsupported, the attempt to obtain a lock will never work. This results in either the applications waiting forever, or aborting their operation.
-A file creation will sometimes return success even if the file already exists. Programs written to work on a local file system will experience strange results when they attempt to update a file after using file creation to lock it, only to discover another file is modifying it (I have personally seen mailboxes with hundreds of mail messages corrupted because of this), because it also "locked" the file via the same mechanism.
-has delayed write caching on the client side
-accesstime on the filesystem may not reflect most recent NFS access
-files arent opened and closed the same way as unix so a file can be opened, nfs stores it as a .nfsXXXXX file, which then cannot be deleted if the process using it crashes
-user/group id numbers used so mapping must be the same on all machines.
-all data transmitted in the clear
-processes cannot be killed because they are waiting on the fast IO of the nfs server if it crashes because nfs is treated as a disk
-uses client for authentication
-"NFS uses an explicit resource browser capability. This means that an NFS client can poll a particular server using the showmount program, as in showmount -e fileserver, to see what directories have been exported. "
Samba
-installed on windows by default
-must be installed on linux
-protocol designed to handle all sorts of things
-ad-hoc and perhaps less well documented, but easy to install and configure
-can authenticate against a windows domain
-windows permissions
-locking issue with windows clients: use sendfile = no solves it
-uses server for authentication
-samba clients can see what servers are available on the network, not just shares on a specific server
Resources
http://www.time-travellers.org/shane/papers/NFS_considered_harmful.html
http://www.linuxplanet.com/linuxplanet/tutorials/2684/1/ _________________ http://ckdake.com/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Cosmin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 18 Dec 2003 Posts: 447 Location: Bucharest, Romania
|
Posted: Tue Oct 26, 2004 3:15 pm Post subject: |
|
|
It depends what you want to do. If you are in a linux only network, I'd suggest NFS. It's easy to setup. Also, it's easy not to export as RW the directories that cause problems. mail is just an example, there are many others.
On the other hand, if you are in a mixed environment (win+lin) than you should go for samba.
So, your decision should not be based on pros/cons, but on your environment.
My 0.02$... _________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ckdake l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/11934487963f0a23d4e4918.gif)
Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Tue Oct 26, 2004 4:10 pm Post subject: |
|
|
I definitely agree with that. I'm hoping to use the pro/cons of each to provide an easy way to evaluate which one will be better for any given application environment combination. _________________ http://ckdake.com/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|