<p>I'm looking at one of our .NET core apps, running on linux on docker/kubernetes.  I'm just a bit confused as to why we have so many child processes:</p>
<pre><code>root@task-executor-85c5557b77-xnrdr:/# pstree 1 -a
sh /start-alloy-engine.sh -x task-executor
  `-dotnet AlloyTaskExecutor.dll
      `-76*[{dotnet}]
</code></pre>
<pre><code>root@task-executor-85c5557b77-xnrdr:/# pstree 1 -a -p -g
sh,1,1 /start-alloy-engine.sh -x task-executor
  `-dotnet,535,1 AlloyTaskExecutor.dll
      |-{dotnet},536,1
      |-{dotnet},537,1
    ....

</code></pre>
<pre><code>htop...
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
  535 root       20   0 8144M  220M 53612 S 143.  5.6 53:12.41 dotnet AlloyTaskExecutor.dll
  955 root       20   0 8144M  220M 53612 S 37.2  5.6  0:03.81 dotnet AlloyTaskExecutor.dll
  941 root       20   0 8144M  220M 53612 R 37.2  5.6  0:21.58 dotnet AlloyTaskExecutor.dll
  614 root       20   0 8144M  220M 53612 S 27.2  5.6 10:32.30 dotnet AlloyTaskExecutor.dll
  599 root       20   0 8144M  220M 53612 S 17.9  5.6  6:53.90 dotnet AlloyTaskExecutor.dll
  655 root       20   0 8144M  220M 53612 S 12.0  5.6  3:02.22 dotnet AlloyTaskExecutor.dll
  649 root       20   0 8144M  220M 53612 S  6.6  5.6  3:05.03 dotnet AlloyTaskExecutor.dll
  660 root       20   0 8144M  220M 53612 S  5.3  5.6  3:02.42 dotnet AlloyTaskExecutor.dll
  946 root       20   0 8144M  220M 53612 S  0.0  5.6  0:13.86 dotnet AlloyTaskExecutor.dll
  960 root       20   0 8144M  220M 53612 S  0.0  5.6  0:02.78 dotnet AlloyTaskExecutor.dll
  541 root       20   0 8144M  220M 53612 S  0.0  5.6  0:00.47 dotnet AlloyTaskExecutor.dll
    1 root       20   0  2388   408   296 S  0.0  0.0  0:00.11 /bin/sh /start-alloy-engine.sh -x task-executor
  536 root       20   0 8144M  220M 53612 S  0.0  5.6  0:00.00 dotnet AlloyTaskExecutor.dll
  537 root       20   0 8144M  220M 53612 S  0.0  5.6  0:00.00 dotnet AlloyTaskExecutor.dll
....
</code></pre>
<p>There are a lot of <code>dotnet AlloyTaskExecutor.dll</code> processes that are all children of the one I created.  This is happening on all our apps when run on linux, not seeing it on windows.</p>
<p>I'm looking into resource usage of this app here, so it's a bit confusing.</p>
<h3>Is this some kind of way multitasking is done on .net core linux?</h3>
<p>I may want to do some profiling - which process do I even attach to? Just PID 535?</p>
<h3>Is it something we've done?</h3>
<p>We have no Process.Start in our codebase, so it may be a 3rd party lib doing this.</p>
<p>They are all trying to run our app with default args?  Is there a different way to change the entrypoint I'm not seeing here?</p>
<p>Any advice to find the culprit? I've thought of changing the process security to deny process spawning but I don't know how to do this on linux.</p>
<p>Edit: <code>ps aux</code> and <code>top</code> are only showing one process, not sure why that is either.</p>
<p>Edit: Are these forked processes maybe?  If it helps the app is running hangfire with a redis storage provider.</p>

Dave Higgins
<p>This was answered over on github: <a href="https://github.com/dotnet/runtime/discussions/45835#discussioncomment-178938" rel="nofollow noreferrer">https://github.com/dotnet/runtime/discussions/45835#discussioncomment-178938</a></p>
<p>TLDR: The line between processes and threads is slightly blurrier on linux - those other pids are actually threads.</p>
