alexsilva / supervisor

Supervisor process control system for Windows
http://supervisord.org
Other
118 stars 26 forks source link

When there are multiple threads in the program, the log will be blocked and the program will be too laggy #50

Open wssf812 opened 1 year ago

wssf812 commented 1 year ago

Q:When there are multiple threads or coroutine in the program, the log will be blocked and the program will be too laggy?

The specific problem is that the log printing time of a module is very long, and all threads feel that it is too laggy. What is the reason for this, how should it be resolved, and are there specific parameters to modify? log example: module one:time 120s module two:time 240s Similar to this, it actually takes a few seconds, and then it will be blocked for a long time

alexsilva commented 1 year ago

On Windows, the behavior of the supervisor is a little different because the APIs are different. It operates in a non-blocking single loop and the only way found so far to control the speed at which this loop works is with the option

delaysecs option

alexsilva commented 1 year ago

I haven't stopped to research a better solution, but without a main loop sleep it will make the cpu run at 100%. On Unix systems this is somewhat resolved with socket.select

Time sleep

wssf812 commented 1 year ago

On Windows, the behavior of the supervisor is a little different because the APIs are different. It operates in a non-blocking single loop and the only way found so far to control the speed at which this loop works is with the option

delaysecs option

Thank you for your reply. I'll give it a try