help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] The best way to monitor the number of concurrently runni


From: Aleksey Tsalolikhin
Subject: Re: [Help-bash] The best way to monitor the number of concurrently running processes forked by a main bash script ?
Date: Sat, 6 Apr 2019 03:57:24 -0700

Hi Peng,

I understand your concerns.

Can you modify the bash script that launches the processes, to log when
they are launched and when they complete?

What exactly are you trying to solve, do you have some concern about what
might happen if there are multiple concurrent processes?


Best,

Aleksey




On Tue, Apr 2, 2019 at 5:22 AM Peng Yu <address@hidden> wrote:

> ---------- Forwarded message ----------
> From: Peng Yu <address@hidden>
> Date: Tue, 2 Apr 2019 07:21:36 -0500
> > ps will show you *all* the concurrently running processes that meet the
> > selection criteria -- it gets the info straight from the kernel.
>
> If the system is heavily loaded and it takes a long time to finish
> running ps, will the earliest processes finished when `ps` finishes
> (in such case, ps does not so *concurrently" running processes)?
>
> > And "watch" will run "ps" every 2 seconds (or as often as you configure
> it
> > to, watch can take an argument).  If getting a snapshot every 2 seconds
> is
> > not good enough, can you modify the child processes themselves to log
> when
> > they start and exit? Would that accomplish your purpose better?
>
> It is not always possible. For example, the following thing will
> result in one processes.
>
> <(one_external_command)
>
> But this will result in two processes.
>
> <(some_log_code; one_external_command)
>
> Also, it is practically infeasible to modify a lot of code to profile
> the number of processes used. I think that this is better to be done
> at the bash language level.
>
> --
> Regards,
> Peng
>


-- 
Achieve real learning.  Email address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]