Dynamic deadpool poll time for faster exit detection on linux#148
Dynamic deadpool poll time for faster exit detection on linux#148avrecko wants to merge 1 commit into
Conversation
…e rapidly. Maybe should update the readme as well? Also removed field cleanlyExitedBeforeProcess that is not set by anyone. Looks like it is a left over from previous versions.
|
Let's wait with this a bit. Need to investigate some more as seeing weird delays in detecting the exit status on the virtual machine but not real. Hm... |
|
I've looked why sometimes echo foo took a few ms to complete and sometimes the full poll interval. If I taskset the test program to the same CPU it always takes full poll interval. Here is perf sched timehist the problem is this it looks like the following is happening: echo foo closed the streams but gets preempted before exits, aside: this is why I want to have a different name for the threads, ProcessQueue0 is very generic in the report. NuProcessPoller would be more obvious. |
|
Did a test: Using NuProcess in a loop to do 1000 calls to echo foo, using 1 executor, pinned to 1 cpu core. The case I looked with perf sched. without any code changes the non-blocking blocking Java Standard Library ProcessBuilder took ~3.6 seconds to complete 1000 calls. changing the code for non-blocking with dynamic poll time took around 5.5 seconds to complete. While not as fast as the blocking code, but not too bad. |
Noticed on Linux that sometimes it takes the full
DEADPOOL_POLL_INTERVALfor the exit to be detected.I think it might make sense to check for exit a lot sooner than
DEADPOOL_POLL_INTERVALwhen detecting a close of a stream.