-
Notifications
You must be signed in to change notification settings - Fork 596
[perf] Add thread pool execution to data processing #3379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改一下日志
@@ -50,6 +53,7 @@ def __init__( | |||
enable_logprob=False, | |||
workers=1, | |||
tool_parser=None, | |||
data_processor_max_workers=5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么设置为5
@@ -123,7 +135,7 @@ def add_requests(self, task): | |||
Returns: | |||
None | |||
""" | |||
|
|||
api_server_logger.info(f"add_requests:{task} in [thread.{threading.current_thread().name}]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成debug 吧
This PR introduces a thread pool to improve the execution of data processing tasks. The main changes include:
Adding a configurable thread pool to handle concurrent data processing.
Updating relevant functions to submit tasks to the thread pool.
Ensuring proper shutdown and resource management for threads.
Benefits:
Improved performance for large-scale data processing.
Better utilization of system resources.
Easier scalability for future enhancements.
Testing:
Verified data processing completes successfully with multiple threads.
Confirmed no resource leaks or deadlocks during execution.