romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
435 stars 49 forks source link

fix: a better fix to sleeping fibers starvation #300

Closed romange closed 2 months ago

romange commented 2 months ago

Before we used a counter which allowed inner loops to shortcut and rarely reach ProcessSleepFibers call in high I/O situations.

Now, we also call ProcessSleepFibers when we process I/O completions that provides a good balance between responsiveness and the maintenance cost of checking for starvation.

Results:

Before I could observe delays reaching 2seconds between Heartbeat runs that where scheduled to run every 10ms (on highly loaded server in debug mode).

After: the delays have not crossed 40ms under the same conditions.

romange commented 2 months ago

Fixed the Waker code that did not work well on macos and also fixed accept server test