SAMBA tweaks and refinements

Hello everyone, I need your help once again. I’m running a SAMBA server on my Raspberry Pi but I’m not fully satisfied about it. I’d like to know A) How to fix the accented letters issue: on all of my machines the folders or files on the server with accented letters in file name have names all screwed up and I didn’t manage to fix it because all the guides around are quite old; B) Transfer speed do not go above 3MB/s even if the wifi connection is a strong 144.4Mb/s and I’m transfering back and forth a USB FAT32 drive (I know NTFS is hard on the CPU and might be slower). Thanks.

usb 2.0 has a max speed of 480 Mb/s so that might be the cause.
As for the letters, no clue. might try and change your encoding settings.

Well I've seen people on the web achieving around 20MB/s but I didn't manage to replicate what they did since the protocol has changed quite a bit in 3 years. I already added some lines to the config file but none of them seemed to have helped unfortunately.

To be quite honest the RPi's net IO performance is just simply bad. This all stems from the fact that in the name of simplicity and cost reduction the SMSC 951x usb hub and ethernet chipset was cobbled to the already bottlenecked Broadcom system bus.
All data has to pass through single USB 2 bus, 480Mbits/s max
On the Raspi you can take away half for USB overhead so ~280Mbits/s.
Share that between USB stick and wifi that makes 140Mbits/s absolute max. Divide by 8 to get Mbyte/s
Leaves 17.5Mb/s now subtract TCP/IP + Samba overhead probably about 15Mb/s remaining
Think of it like:

disk ----usb bus----> CPU ----usb bus----> usb wifi

So throughput is just going to be slow as hell. Your best option to get the most out of the IO data rate is to switch to a lighter protocol like FTP or if you know your way around NFS. Im able to get NFS performance of 12.5Mb/s to 14.5Mb/s. But just now with Samba.

Yeah, I'm not expecting to trasfer at crazy speeds but I've seen people reaching the speeds you mentioned with SAMBA and I was wondering why I can't get around to get them. SFTP is integrated into Raspbian already but I wanted to do something simpler (wich is turning to not be simpler). I'm gonna test the SFTP and hope I'm getting better speeds.

SFTP (SecureShell-FTP) is going to be much slower. Crypto is not fast on the Raspi.
Plain old FTP though is quite fast.
Though I think you should be quite fine with Samba, I assume you want easy access from a windows machine?
Have you gone through this thread before? It should get you most of the way there
https://archlinuxarm.org/forum/viewtopic.php?f=18&t=5001
It references this tutorial which also works for Raspbian. Go over it and compare to your setup.
http://obihoernchen.net/category/projects/pogoplug-projects/#post-877

1 Like

Thanks. As soon as I can I'll check everything out and upate the thread.

@shokhan No change whatsoever following those instructions.

Well damn. What Wlan connector are you using?
What data rate is it indicating on your router that its connecting at?

I'm using this dongle: http://www.tp-link.it/products/details/cat-11_TL-WN823N.html
My Netgear D6200 doesen't show that but the "sudo iwconfig" says that I'm connected at 144.4Mb/s.

EDIT: the Raspberry is connected to a FRITZ!WLAN Repeater 1750E connected to the Netgear D6200. This is not a bottleneck since I transfered data before from my notebook to the main PC (1Gb/s LAN) maxing out the wireless card on the notebook.

Well it seems to be using the rtl8192 chipset. I have plenty of those and they are well supported under linux.
At this point without me getting my grubby hands on the system I have no idea anymore.

I bought it because of that, had good reviews online, is on the supported list of tested hardware and it's cheap. Well, I'll wait for someone else to try to help me and in the mean time I'll tinker even more with it and hope to fix it somehow. I think the fix you suggested didn't work because the config file has changed and maybe old lines are deprecated or not functioning anymore (for example mangled names = no and other two lines about charset to fix the accented letters issue do not work properly even if in old blogs on the internet people have solved the issue that way).

I was worried that my wifi dongle was the problem but I tested it and it works as good as my laptop connected on the same wifi network so there's something in the SAMBA protocol to improve. Also I've took a look at all the wikis but they're not useful at all. I'm lost really. Using ethernet and with the wifi dongle disconnected I can get only about 4MB/s, wich is really underwelming.

sounds like the wifi and usb drive are sharing the same connection. like a hub.

They totally are but even if connecting more devices to the USB-Ethernet bus the speeds remain the same

2 things to try and rule out something. A test with network cable. wifi in the end is wifi and although it say 144mbit doesn't mean you will reach it. B test the usb drive on for instance the laptop and if you have another one on the Rpi. The default samba settings are good to go way beyond what you are reaching.

The USB drive I'm using does about 25MB/s read and 20MB/s write on my PC.

I guess we're all assuming it's 1 transfer and one transfer only not 2 transfers or 1 and a stream or anything like that because hdd's tank when they don't do things sequentially.

Sure, just one and only transfer at the time. CPU and RAM on the RPi are barely in use with any kind of transfer, even one of multiple GBs. Also not matter how much I wait between multiple transfers but the speed is always the same.

I finally f******* fixed the damn slow speeds. Now I max out the bandwith on the LAN port on the Raspberry but the wifi transfer is still slow unfortunately.
In all of this mess I still have a problem with accented letters not read properly in the share. I can't even copy files with accented names into the share and the following error appears on screen "the file might be too large for the filesystem".