Samba36 Slow Speed - Router ADB P.DG A4001N1

Hello Some time ago I installed openwrt (OpenWrt 19.07.6 r11278-8055e38794 / LuCI openwrt-19.07 branch git-21.018.57536-6ba9740) to my A4001N1 router and I decided to use it to share files from a pendrive, but the reading and writing speed that samba (samba36-server 3.6.25-14) has is very low, I have tested the speed of my pendrive with the following command:

hdparm -Tt /dev/sda1

/dev/sda1:
 Timing cached reads:    72 MB in  2.00 seconds =  35.98 MB/sec
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 Timing buffered disk reads:  58 MB in  3.05 seconds =  18.99 MB/sec

The pendrive is mounted with the following command:

ntfs-3g /dev/sda1 /mnt/sda1 -o noatime,async,big_writes

But the Read speed is around 2.5 MB / sec and the Write speed is 2.6 MB / sec via network cable, this is my samba configuration:

[global]
	netbios name = |NAME| 
	display charset = |CHARSET|
	interfaces = |INTERFACES|
	server string = |DESCRIPTION|
	unix charset = |CHARSET|
	workgroup = |WORKGROUP|
	bind interfaces only = yes
	deadtime = 15
	enable core files = no
	invalid users = root
#	local master = no
	map to guest = Bad User
	max protocol = SMB2
	min receivefile size = 16384
	null passwords = yes
	passdb backend = smbpasswd
	security = user
	smb passwd file = /etc/samba/smbpasswd
	use sendfile = yes

# Optimizaciones
	log level = 1
       socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE
        max connections = 65535
        max open files = 65535
        strict locking = no
        oplocks = yes
        max xmit = 65535
        getwd cache = yes
        aio read size = 1
        aio write size = 1

# Otras Optimizaciones
        browseable = yes
        printable = no
        syslog = 2
        load printers = no

# OpenWRT Samba User Guide WINS Settings
        domain master = yes
        local master = yes
        name resolve order = wins lmhosts hosts bcast
        os level = 99
        preferred master = yes
        wins support = yes

Hopefully some of you can help, as I have little memory in this router I cannot use samba4, I appreciate your help in advance.

so the issue is samba over wifi only .... ?

The problem Is over lan cable.

You should probably do something like this instead, to get meaningful results.

dd if=/dev/zero of=/mnt/sda1/test1.img bs=1G count=1 oflag=dsync

First of all we're talking about a 320 MHz single-core mips SOC, USB 2.0 is also quite taxing and ntfs-3g running in userspace (fuse) makes the situation even worse, before even thinking about samba - 2.5 MByte/s throughput sounds reasonable for this hardware and environment. These routers have never been made to be a fileserver.

2 Likes
dd if=/dev/zero of=/mnt/sda1/test1.img bs=1G count=1 ofla
g=dsync
dd: invalid argument 'dsync' to 'oflag'

then skip the option...