CodexBloom - Programming Q&A Platform

Debian 11 - Slow Performance When Using Samba with Large Files Over VPN

πŸ‘€ Views: 46 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-09
samba debian vpn performance bash

I've hit a wall trying to I'm experiencing important performance optimization when trying to transfer large files via Samba on a Debian 11 server. The server is configured with Samba version 4.13.1, and I'm accessing it over a VPN connection. I've noticed that file transfers are extremely slow, often taking several minutes for files that should transfer in seconds. I've checked the Samba configuration in `/etc/samba/smb.conf`, and here’s a relevant excerpt: ```ini [shared] path = /srv/samba/shared browsable = yes writable = yes guest ok = yes read only = no create mode = 0755 directory mode = 0755 ``` Despite having proper permissions set, performance remains an scenario. To troubleshoot, I've tried several things: - Adjusting the `socket options` in the Samba config to include `TCP_NODELAY` and `SO_RCVBUF=8192 SO_SNDBUF=8192`. - Testing the connection speed to the server using `iperf`, which showed good bandwidth but high latency. - Disabling SMB signing and encryption in the config, but that didn't help much either. When I perform a file transfer, I can see the following in the Samba logs (`/var/log/samba/log.smbd`): ``` [2023/10/10 14:15:12.345678, 0] ../source3/smbd/smb2_server.c:1234(smbd_smb2_request_receive) Received SMB2 request, behavior: NT_STATUS_CONNECTION_RESET ``` This behavior seems to occur intermittently and correlates with the slowness. Has anyone encountered similar issues, and what steps did you take to resolve the performance problems when using Samba over a VPN? Any insights would be greatly appreciated.