Monitor network traffic of a process and its entire subprocesses tree
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to know the amount of the network traffic (inbound and outbound) in a time period, generated a specific process and all subprocesses that it spawns.
I have developed a software that contains a "job manager" that runs forever and generates no network traffic on its own. It instead spawns child "workers" that does the main work, including the majority of network traffic. The tricky point is, several "workers" may work simultaneously, and a single worker process is expected to exit after a short period (a few hours). Furthermore, these workers also spawns more subprocesses that generates traffic like git fetch
that needs to be monitored as well.
There will be only one instance of "job manager" and it can be started or killed on-demand on my development and testing server, which runs Ubuntu Server 18.04, architecture amd64.
I want to monitor the network traffic of all the workers and the processes that workers spawn, for a prolonged period (one week or more). Is there a solution?
networking process monitoring
add a comment |
I want to know the amount of the network traffic (inbound and outbound) in a time period, generated a specific process and all subprocesses that it spawns.
I have developed a software that contains a "job manager" that runs forever and generates no network traffic on its own. It instead spawns child "workers" that does the main work, including the majority of network traffic. The tricky point is, several "workers" may work simultaneously, and a single worker process is expected to exit after a short period (a few hours). Furthermore, these workers also spawns more subprocesses that generates traffic like git fetch
that needs to be monitored as well.
There will be only one instance of "job manager" and it can be started or killed on-demand on my development and testing server, which runs Ubuntu Server 18.04, architecture amd64.
I want to monitor the network traffic of all the workers and the processes that workers spawn, for a prolonged period (one week or more). Is there a solution?
networking process monitoring
add a comment |
I want to know the amount of the network traffic (inbound and outbound) in a time period, generated a specific process and all subprocesses that it spawns.
I have developed a software that contains a "job manager" that runs forever and generates no network traffic on its own. It instead spawns child "workers" that does the main work, including the majority of network traffic. The tricky point is, several "workers" may work simultaneously, and a single worker process is expected to exit after a short period (a few hours). Furthermore, these workers also spawns more subprocesses that generates traffic like git fetch
that needs to be monitored as well.
There will be only one instance of "job manager" and it can be started or killed on-demand on my development and testing server, which runs Ubuntu Server 18.04, architecture amd64.
I want to monitor the network traffic of all the workers and the processes that workers spawn, for a prolonged period (one week or more). Is there a solution?
networking process monitoring
I want to know the amount of the network traffic (inbound and outbound) in a time period, generated a specific process and all subprocesses that it spawns.
I have developed a software that contains a "job manager" that runs forever and generates no network traffic on its own. It instead spawns child "workers" that does the main work, including the majority of network traffic. The tricky point is, several "workers" may work simultaneously, and a single worker process is expected to exit after a short period (a few hours). Furthermore, these workers also spawns more subprocesses that generates traffic like git fetch
that needs to be monitored as well.
There will be only one instance of "job manager" and it can be started or killed on-demand on my development and testing server, which runs Ubuntu Server 18.04, architecture amd64.
I want to monitor the network traffic of all the workers and the processes that workers spawn, for a prolonged period (one week or more). Is there a solution?
networking process monitoring
networking process monitoring
edited Mar 7 at 15:54
iBug
asked Oct 21 '18 at 5:45
iBugiBug
1,0181031
1,0181031
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Probably the easiest way is to put the job manager in a network namespace. All child processes will also be in that namespace. Connect up the namespace via veth or macvlan, measure traffic on that interface.
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).
– dirkt
Oct 27 '18 at 13:10
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476812%2fmonitor-network-traffic-of-a-process-and-its-entire-subprocesses-tree%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Probably the easiest way is to put the job manager in a network namespace. All child processes will also be in that namespace. Connect up the namespace via veth or macvlan, measure traffic on that interface.
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).
– dirkt
Oct 27 '18 at 13:10
add a comment |
Probably the easiest way is to put the job manager in a network namespace. All child processes will also be in that namespace. Connect up the namespace via veth or macvlan, measure traffic on that interface.
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).
– dirkt
Oct 27 '18 at 13:10
add a comment |
Probably the easiest way is to put the job manager in a network namespace. All child processes will also be in that namespace. Connect up the namespace via veth or macvlan, measure traffic on that interface.
Probably the easiest way is to put the job manager in a network namespace. All child processes will also be in that namespace. Connect up the namespace via veth or macvlan, measure traffic on that interface.
answered Oct 21 '18 at 7:11
dirktdirkt
17.4k31338
17.4k31338
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).
– dirkt
Oct 27 '18 at 13:10
add a comment |
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).
– dirkt
Oct 27 '18 at 13:10
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
Sounds like a good idea. I'll try this out later.
– iBug
Oct 21 '18 at 8:31
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
OK, I've set up a namespace following this blog. Now how do I monitor the interface?
– iBug
Oct 27 '18 at 13:04
Look at
/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).– dirkt
Oct 27 '18 at 13:10
Look at
/sys/class/net/$interface/statistics/
, or use one of the many software packages (google, there's at least several dozen).– dirkt
Oct 27 '18 at 13:10
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476812%2fmonitor-network-traffic-of-a-process-and-its-entire-subprocesses-tree%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown