# Do Dummynet Pipes Limit Bandwidth on Already Existing Connections?



## dkovacevic (Aug 14, 2012)

I am using pfsense. I have rsync backing up every night (ssh). However, if rsync continues to run into the morning, it uses all the upload bwidth from the one location, causing the VPN to stutter horribly.

So I wanted to allow rsync all the bandwidth that it can be allotted at night, but then limit it once people start trying to use the network (morning).

Pfsense uses Dummynet pipes to accomplish bandwidth squeezing. This works fine if rsync is initiated AFTER the pipe is already active. However, if rsync is running through the night, and the pipe becomes active the following morning, rsync keeps using all of the bandwidth available.

Out of curiosity, why is it that the Dummynet pipe does not apply to the already existing connection?

Are there any suggestions on how to do what I wish? I don't necessarily need to use rsync in particular; it seemed to be the most simple solution to use for doing backups at the time.


----------



## dkovacevic (Aug 15, 2012)

Might have figured this one out.

I found a wrapper script that restarts rsync on failure due to dropped ssh here: http://x-ian.net/2009/05/15/resume-rsync-transfer-after-ssh-connection-crash/

I modified that script to fit our specific routine.

Last, to fix the issue of the bandwidth: a crontab entry of "killall ssh" at 6AM solves our trouble. (Yes, if anyone is sshed into the server at the time, they will lose their session, but that is not a big concern to us as that server is only used for backups).

Basically, by killing the ssh process @ 6AM, the wrapper script from above will initiate a new rsync process, but that process will follow the Dummynet bandwidth rule.


----------

