[fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

Bo Berglund bo.berglund at gmail.com
Sun Oct 17 11:49:09 CEST 2021


On Sun, 17 Oct 2021 00:43:51 +0200, Bo Berglund via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>timeout --signal=2 3s strace -f -c -p 488 -o tracelog2.log
>
>% time     seconds  usecs/call     calls    errors syscall
>------ ----------- ----------- --------- --------- ----------------
> 46.47    0.348353         414       841           nanosleep
> 27.67    0.207437       17286        12           _newselect
> 16.17    0.121220         211       572        77 futex

So 90.3 % of the time is spent in these 3 syscalls...

Does this mean that:
_newselect is running for 207 ms during the 3 second test time?
(Which is 17 ms per call)

And what is _newselect in the first place?

I assume nanosleep is some kind of Linux API call made by fpc when it invokes
sleep() in my code.

And futex????


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list