-
-
Notifications
You must be signed in to change notification settings - Fork 298
Description
I wrote a bash script busyppp.sh that uses nethogs. See
https://github.com/dg-demers/busyppp
This script starts background downloading with wget when it senses web browser downloading has stopped. Nethogs was crucial for this script. Thank you for creating it.
But one problem I have with nethogs is that after a process stops actively downloading nethogs continues to retain the process's last download rate in its output for far too long. So it's impossible to start the background downloading promptly by monitoring nethogs output alone.
I resorted to using ifstat to monitor the total download bandwidth to sense when to start the background downloading with wget. But I still use nethogs to sense when to stop it when a browser begins downloading. This makes the code more complicated.
Please add an option to nethogs that controls how many seconds stats for no longer actively downloading processes linger in its output. And also please allow it to be set to 0 seconds.
Following added later in edit:
This seems to be the same issue as mentioned by mbfoss in
Bandwidth remains frozen in last value when no app is using bandwidth #41
?Could I get this effect by changing the following lines in nethogs.h from
/* the amount of time after the last packet was received
* after which a process is removed */
#define PROCESSTIMEOUT 150
/* the amount of time after the last packet was received
* after which a connection is removed */
#define CONNTIMEOUT 50
to
#define PROCESSTIMEOUT 0
#define CONNTIMEOUT 0