grke / burp

burp - backup and restore program
http://burp.grke.net
Other
485 stars 77 forks source link

Feat. request: More fine grained bandwidth control #618

Open deajan opened 7 years ago

deajan commented 7 years ago

Hello,

Would it be possible to tune bandwidth depending on current time ? Example: backup with full bandwidth at night, and use a bandwidth limit at daytime, which gets enforced as soon as the night is over.

Best regards.

grke commented 7 years ago

Hello,

I think it is an interesting thought, but I cannot immediately picture what this would look like as config options. Do you have any ideas as to how the config would look?

pablodav commented 7 years ago

Hello @deajan @grke

I have some kind of scripts that those these kind of things actually.

The script is too ugly to be shared actually (in my own opinion), and have lot of hardcoded options that should be better provided in config file. Also the actual script is in powershell (because the need was to solve it on windows only for now), but I could propose to create something in python.

I was thinking in the possibility to open a vote to see if this kind of script/program is something that could be of interest to others in burp community.

The basic features I have now are:

The script changes dynamically burp.conf client file and executes burp -a t, also burp.conf calls this script in options script_pre and script_post.

If someone is interested I will try to share more details of the idea later.

deajan commented 7 years ago

@grke I was thinking of a timer_arg like config option:

bandwidth = xxx bandwidth_timed = yyy bandwidth_timer_arg =Wed,Thu,15,16,17

Normal backup bandwidth = xxx, and on wednesday and thursday from 15 to 17h59, backup bandwidth is yyy.

@pablodav Interesting scripts, maybe sharing them on your git would be a good base :)

pablodav commented 7 years ago

hello @deajan , I have now shared the script and idea in: https://github.com/pablodav/burp_eclient

grke commented 6 years ago

I think doing https://github.com/grke/burp/issues/209 first would be a step towards this.

ziirish commented 6 years ago

Hi,

I think a good starting point would be to have the ratelimit option available per client in clientconfdir files. Then a first iteration for such a feature could look like this:

  1. expose a $clientname variable in the configuration parser
  2. in the clientconfdir file, add a line like . /some/volatiledir/$clientname/*.conf
  3. pass the clientname to backup_script_pre and provide a script that will create the according /some/volatiledir/$clientname/ratelimit.conf file
  4. the conf should be re-sourced after the backup_script_pre so the new settings are loaded
grke commented 6 years ago

My impression of the initial idea was that the ratelimit would change within the same backup process.

Whereas, your volatiledir idea would set the ratelimit once per backup process. With this, a long-running backup with a high ratelimit would continue to use high bandwidth once the time has moved on into the low bandwidth part of the day.

deajan commented 6 years ago

Agree with @grke, this is actually what bothers me as of today, long backups that I have to manually stop on the beginning of the day because it eats the bandwidth on non QoS aware networks.