Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up a file server using Ubuntu 12.04 Server. The purpose is to serve several network drives to Windows users that have heretofore been served by numerous NAS drives.

I have Samba set up with one share defined so far. I can connect to it fine from my test Windows 7 and Windows XP machines.

When I do a directory listing on the share from Windows, it can take up to two minutes to get all the files listed--would have taken about 1.5 seconds when I was using the Buffalo NAS. Sometimes it times out with no response at all.

I have used the default smb.conf and simply added the following for the share I have set up so far:

comment = Ubuntu File Server Share
path = /networkdriveshares/engineering
browsable = yes
guest ok = yes
read only = no
create mask = 0755

I have tried changing the workgroup setting to the Active Domain name our Windows computer use but didn't notice any difference.

The only other change I made to the default smb.conf was adding in the recommended socket settings:

     SO_RCVBUF=8192 SO_SNDBUF=8192
     socket options = TCP_NODELAY

Lots of information about slow Samba shares online but I have tried all of the solutions I have found and none have made a lick of difference. If there is no solution, is there a better way to set up a file server to be used by Windows clients?

share|improve this question
How much RAM does the server have? I've found that you can exhaust low RAM servers when viewing a lot of files or copying big files from/to a Samba server. – brousch Jun 8 '12 at 17:30
Another thing to look out for are directories with a bunch of images. If you're using thumbnail view in Windows explorer it will try to build a thumbnail preview of every picture. – brousch Jun 8 '12 at 17:47
Server has 8 gb RAM. And I have only set up one share and it doesn't have any images to speak of in the root of the share. Just getting a directory listing takes forever and more ofen than not, times out. If I go into a directory with only a few files, speed seems fine. – swalker2001 Jun 10 '12 at 12:38
One last issue I've run into is a directory with a lot of executable files, such as Windows program installers. The problem here there is with the antivirus on the Windows clients scanning everything on the network share each time you try to look at it. If you disable scanning the share from your AV, you might get a big improvement. – brousch Jun 10 '12 at 17:00
Your question as asked has a bug in the config file; the SO_RCVBUF and SO_SNDBUF settings need to go on the same line as "socket options =". I've answered your question below assuming you actually have socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 – Nelson Jun 12 '12 at 21:29

Try configuring your server without setting SO_RCVBUF and SO_SNDBUF. Ie:

socket options = TCP_NODELAY

and nothing else. Or comment out socket options entirely and use Samba's default.

I had a similar problem with Ubuntu 12.04 and a Mac client on gigabit ethernet. Reading a file was getting about 100kbytes/second, or 300 times too slow. In Ubuntu 11.10 I was setting both buffers to 8192 as you tried. But when I upgraded to 12.04 I found I had to remove that setting to get performance back to where it should be (about 30mbytes/second, the disk speed).

Another solution I've seen suggested is to set max protocol = NT1. I tried that first and it didn't help me.

share|improve this answer
I have tried all the suggestions and can't figure out why it is so slow. Is using Ubuntu Server, or Linux in general, considered a bad way to serve files for Windows machines? I thought it was fairly common. Seems like a much better way than having all these little NAS boxes sitting around just waiting to fail. And I have another machine all set up to run backups from this one with whole plan is falling apart since I can't make samba work. – swalker2001 Jun 14 '12 at 18:01
Ubuntu Server / Linux is a fine way to run a Windows fileserver. Almost every single Windows file server other than Windows itself is running the same Samba code that Ubuntu does. NAS boxes are generally just little Linux boxes running Samba. I wish I could be of more help, sorry. – Nelson Jun 17 '12 at 1:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.