Open paveldvorak5 opened 3 weeks ago
Hi. Looks like just sockets checking. Is it Linux?
Same for me, using macOS 12.3.
Hi. Looks like just sockets checking. Is it Linux?
yes, it it What socket are we talking about? Maybe it's too often?
What socket are we talking about? Maybe it's too often?
Socket accepts: https://github.com/buggregator/trap/blob/17f299e2e93c3492c75537f2c6f6be565737903e/src/Socket/Server.php#L85
And socket select https://github.com/buggregator/trap/blob/17f299e2e93c3492c75537f2c6f6be565737903e/src/Socket/Client.php#L80
It happens every tick.
I don't experience such issues on Windows, probably because the time for usleep() on Windows cannot be less than 10ms. Linux ticks at a smaller interval (50 microseconds).
Yes, that's it. I "solved" the issue but changing the interval. Can setting a low interval break things?
The higher this value, the slower the content will be delivered to the browser, and it directly affects TTFB. What value are you using? I think it can be used for socket polling, while delivering content at the minimum interval.
I changed it to 5000. I use it for local dev so the delay does not matter. Maybe put the value to config?
Could you check 1000 and 500? I think 1ms is comfortable value for developer and CPU :)
As expected, the usage went up from 1% to 4%. When changed to 10000, the app seems to work fine, only it takes 30 s to start the port 8000.
I will release a patch with #140. It includes personal throttling for polling each socket. I would appreciate any feedback here about it.
Hello, trap --ui use a lot of cpu even if it's doing nothing. Here's the cause, it's checking something every 50ns but I don't know which resource is not available. Running with -vvv does not help.
strace log