Threads and processes

Hi,

My AppDaemon is set to 10 threads as recommended in the docs. Still I see around 40 active appdaemon processes. I always thought that one thread equals one process in this scenario but maybe I’m mistaken. Is this normal?
Running v3.0.2 and 2 apps.

in AD 3.0.2 you set 10 threads and all apps can use all threads.
AD decides which thread is used for the apps.
all other things from AD are done outside those 10 threads.

but i dont know in what way you look at the processes but i see only 1 AD process in my taskmanager.

Yes, regardless of the number of threads you have, you should only see 1 AppDaemon process.

1 Like

Thanks for the answers.
Looking at htop they all have unique PIDs and that makes me think its separate processes. My knowledge of Linux is not this deep but reading up on it a little bit here https://unix.stackexchange.com/questions/364660/are-threads-implemented-as-processes-on-linux
makes me unsure if the thread actually gets it’s own PID atfter all. But in that case I should see a maximum of 10, right?
I guess I need to investigate this further. I will post a screenshot when I get back home.

if you really look the right way at it you should see only 1.
but like i said, if you look at subprocesses you can see more then 10, because AD has its own processes besides the 10 thread apps.

Hi again,

So I had a better look at this. Ps aux only shows one PID 706 and htop shows around 40 PIDs. Using description PID is actually confusing here since they seems to be threads. Pressing H in htop hides user threads and then only 706 is there. Ok so it actually runs one process with 40 threads. I understands that the App thread settings only limits the threads used for apps and Appdaemon might create more for internal use but 40 seems to be a bit exaggerated.
Is this expected?

i have no idea, because i never checked that.

as long as AD is working as suspected i think you shouldnt worry about things like that.
do you know the amount of threads that are used by all other progams you use?
what is the “normal” amount for HA and how much are there in your device?

i can think of a lot of reasons why the amount is that high. maybe for dashboard, for example.
but i only start to think about that if there is a problem with it.