peachpie
peachpie copied to clipboard
CPU high usage (Socket)
Hi !
I have problem of high CPU usage with:
while ($clientSocket = @stream_socket_accept($this->serverSocket, 0)) 46% of the cpu usage
PS: No high cpu usage with stream_socket_accept($this->serverSocket, 0.1))
Hi,
Do you use the latest PeachPie 1.0.12
or a previous version?
(this has been recently updated by https://github.com/peachpiecompiler/peachpie/pull/1029)
Thanks
Yes 1.0.12
weird; it basically does not do anything if parameter is 0
;
isn't it called in a loop in your code or something?
when set to 0,you may need an eventlloop engine for performance,you just register an event to the loop.Because now the accept dot not wait in a block.There is a stream_select function you can use