docker run -p 8000:8000 rasa/duckling
> docker ps
IMAGE: rasa/duckling
COMMAND: "duckling-example-exe"
STATUS: Up 28 hours
> htop
I have literally 60 little processes in my container:
duckling-example.exe -p 8000 -no-access-log --no-error-log
Anyt thoughts why this is the case.
VIRT: 1.0T
CPU%: 0.0
MEM: 0.1
Command: duckling-example.exe -p 8000 -no-access-log --no-error-log
By default, htop
lists each thread of a process separately, while ps
doesn’t. To turn off the display of threads, press H
, or use the “Setup / Display options” menu, “Hide userland threads”. This puts the following line in your ~/.htoprc
or ~/.config/htop/htoprc
(you can alternatively put it there manually):
Just curious whats going on with all the threads in the container?
Thanks.
From @virtualroot:
I see ghc_worker
threads.
I think it has to do with GHC, the default compiler for Haskell; and how it handles concurrency.
PID TTY STAT TIME COMMAND
1 ? Ssl 0:00 duckling-example-exe -p 8000 --no-access-log --no-error-log
18 pts/0 Ss 0:00 /bin/bash
746 pts/0 R+ 0:00 ps x
root@36166220878a:/# ps -T -p 1
PID SPID TTY TIME CMD
1 1 ? 00:00:00 duckling-exampl
1 8 ? 00:00:00 ghc_worker
1 9 ? 00:00:00 ghc_worker
1 10 ? 00:00:00 ghc_worker
1 11 ? 00:00:00 ghc_worker
1 12 ? 00:00:00 ghc_worker
1 14 ? 00:00:00 ghc_worker
1 13 ? 00:00:00 ghc_worker
1 15 ? 00:00:00 ghc_worker
1 16 ? 00:00:00 ghc_worker
1 17 ? 00:00:00 ghc_worker
1 735 ? 00:00:00 ghc_worker
I would say it is natural to see it grow and shrink depending on the workload.Not something we want to do but it is possible to disable this feature by removing the -threaded
flag at compilation time from duckling.cabal.