TCP Port Numbers Reused: VE -> PBS

Jan 12, 2022
39
8
8
34
I have recently come across an issue with Proxmox VE 8 and Proxmox Backup Server 3.

Every couple of hours, a log message will appear saying VE couldn't connect to the backup server.

After doing a packet capture, I saw that Proxmox is creating two connections at a time of about 22-27 packets every 10 seconds.
Each of these connections is closed with a RST packet by VE.
This leaves sockets in the time_wait state, which by default will not go away for a few minutes (in which many other connections will be started and stopped).
The source port used by VE will occasionally conflict with one of these dead connections, and the PBS server will respond with a RST packet after syn and cause the log message.

I would suggest that the frequency of connections be reduced. 10 Seconds seems excessive. I'm not entirely sure why this time period was chosen or if its even technically necessary for a proper functioning backup chain (if its just a heartbeat, why not a couple minutes between pings?).

I don't mean to nitpick here, but it seems a little sloppy to be creating these extremely short (both data and time) connections so often and not address the very real problem of filling each system with improperly closed sockets.
 
I have reduced the number of failed connection attempts by about ~50% by increasing the ephemeral port range on PVE
net.ipv4.ip_local_port_range = 1024 65535

Not a solution, but it helps. I think it would actually be better if PVE just maintained a long lived TCP connection and reused that instead of creating two new connections every 10 seconds...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!