DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-08-08 04:48:59

Loose Gravel
Member
Registered: 2008-10-14
Posts: 50

Limit upload bandwidth

Hi!

My dns-323 is too fast. I'm using rsync to backup my data to a datacenter via the internet. rsync is using all the available upload bandwidth, as it should be. But "internet" is slow on other PCs using the same shared Internet-DSL-router (upload, that is).

I want to limit the (upload) bandwidth of rsync or the whole dns-323, lets say to 256 Kbps, but only from 7am to 11pm

My current solution
- start rsync at midnidht with no bandwidth limit
- kill rsync at 7am via crond
- detect killing of rsync and automatically restart with bandwidth limit (rsync option --bwlimit=256), resuming transfer
- kill rsync at 11pm
- detect killing of rsync and automatically restart with bandwidth limit (rsync option --bwlimit=256), resuming transfer
- and so on until rsync is complete. I't will take several days sometimes to transfer some 300 GB.

My problem: Killing rsync and restarting sometimes throws away partially transferred files (I'm using --partal). Especially if rsync transfers a very big file and while doing so rsync gets killed twice. (first at 11pm, then at 7 am.)

Better would be: Throttle upload bandwidth on network level "underneath" rsync, while keeping rsnyc alive.

Is there a command like "set upload bandwidth to 256KBps for the whole dns-323" (or for a process)

Any other solution?

Thanks in advance!
Loose gravel

Last edited by Loose Gravel (2011-08-08 04:50:03)

Offline

 

#2 2011-08-08 12:29:07

JamesD
Member
Registered: 2009-05-23
Posts: 10

Re: Limit upload bandwidth

Loose Gravel wrote:

Hi!

My dns-323 is too fast. I'm using rsync to backup my data to a datacenter via the internet. rsync is using all the available upload bandwidth, as it should be. But "internet" is slow on other PCs using the same shared Internet-DSL-router (upload, that is).

I want to limit the (upload) bandwidth of rsync or the whole dns-323, lets say to 256 Kbps, but only from 7am to 11pm

My current solution
- start rsync at midnidht with no bandwidth limit
- kill rsync at 7am via crond
- detect killing of rsync and automatically restart with bandwidth limit (rsync option --bwlimit=256), resuming transfer
- kill rsync at 11pm
- detect killing of rsync and automatically restart with bandwidth limit (rsync option --bwlimit=256), resuming transfer
- and so on until rsync is complete. I't will take several days sometimes to transfer some 300 GB.

My problem: Killing rsync and restarting sometimes throws away partially transferred files (I'm using --partal). Especially if rsync transfers a very big file and while doing so rsync gets killed twice. (first at 11pm, then at 7 am.)

Better would be: Throttle upload bandwidth on network level "underneath" rsync, while keeping rsnyc alive.

Is there a command like "set upload bandwidth to 256KBps for the whole dns-323" (or for a process)

Any other solution?

Thanks in advance!
Loose gravel

You should be able to do this... IIRC the switch for rsysnc is --bwlimit=(value)

I've used this before when rebuilding my 323.

Jim

Offline

 

#3 2011-08-09 00:53:08

Loose Gravel
Member
Registered: 2008-10-14
Posts: 50

Re: Limit upload bandwidth

JamesD wrote:

You should be able to do this... IIRC the switch for rsysnc is --bwlimit=(value)

Jim

Jim: Thank you. I know the switch. Unfortunately I can only set one value here. The bandwidth should be time-dependent and change while rsync is running. Which bwlimit can't do directly. See my (troubled) solution above.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB