Skip to content

Optimize ZMQ receive operations to reduce idle CPU usage#1731

Closed
zyearw1024 wants to merge 1 commit intosgl-project:mainfrom
zyearw1024:fix/reduce-idle-cpu-usage-zmq-recv
Closed

Optimize ZMQ receive operations to reduce idle CPU usage#1731
zyearw1024 wants to merge 1 commit intosgl-project:mainfrom
zyearw1024:fix/reduce-idle-cpu-usage-zmq-recv

Conversation

@zyearw1024
Copy link
Copy Markdown

@zyearw1024 zyearw1024 commented Oct 20, 2024

  • Set a 100ms timeout for ZMQ receive operations in scheduler and data_parallel_controller
  • Replace non-blocking receive with blocking receive with timeout
  • Handle ZMQ.Again exception to break the receive loop when no messages are available
  • Add example script demonstrating CPU usage improvement with optimized ZMQ client

Fixes #1730

- Set a 100ms timeout for ZMQ receive operations in scheduler and data_parallel_controller
- Replace non-blocking receive with blocking receive with timeout
- Handle ZMQ.Again exception to break the receive loop when no messages are available
- Add example script demonstrating CPU usage improvement with optimized ZMQ client
@zhyncs
Copy link
Copy Markdown
Collaborator

zhyncs commented Oct 20, 2024

Thank you for your PR. However, we would like to keep the original implementation, and we are currently working on refactoring to eliminate CPU overhead. Therefore, this PR will not be accepted for the time being.

@Gierry
Copy link
Copy Markdown

Gierry commented Jul 25, 2025

Thank you for your PR. However, we would like to keep the original implementation, and we are currently working on refactoring to eliminate CPU overhead. Therefore, this PR will not be accepted for the time being.

May I ask if there are plans to resolve this issue? It is already July 25, 2025. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 100% CPU Usage When Idle in sglang

3 participants