-
Notifications
You must be signed in to change notification settings - Fork 143
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
add rate limiting for offline batch jobs, set default bulk size to 500 #3116
Conversation
plugin/src/main/java/org/opensearch/ml/action/batch/TransportBatchIngestionAction.java
Outdated
Show resolved
Hide resolved
ml-algorithms/src/main/java/org/opensearch/ml/engine/ingest/OpenAIDataIngestion.java
Show resolved
Hide resolved
plugin/src/main/java/org/opensearch/ml/task/MLPredictTaskRunner.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Xun Zhang <xunzh@amazon.com>
Signed-off-by: Xun Zhang <xunzh@amazon.com>
.intSetting("plugins.ml_commons.max_batch_ingestion_tasks", 10, 0, 500, Setting.Property.NodeScope, Setting.Property.Dynamic); | ||
|
||
public static final Setting<Integer> ML_COMMONS_BATCH_INGESTION_BULK_SIZE = Setting | ||
.intSetting("plugins.ml_commons.batch_ingestion_bulk_size", 500, 100, 100000, Setting.Property.NodeScope, Setting.Property.Dynamic); |
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.
We should add these new settings to netty/jetty layers on AOS 2.17
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.
good callout. They will be handled separately when this is backported into the AOS branch.
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.
Do we allow users to set a negative number?
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.
No the minimum values are 0 actually as defined in the setting.
#3116) * add rate limiting for offline batch jobs, set default bulk size to 500 Signed-off-by: Xun Zhang <xunzh@amazon.com> * update error code to 429 for rate limiting and update logs Signed-off-by: Xun Zhang <xunzh@amazon.com> --------- Signed-off-by: Xun Zhang <xunzh@amazon.com> (cherry picked from commit 9a4166e)
#3116) (#3121) * add rate limiting for offline batch jobs, set default bulk size to 500 Signed-off-by: Xun Zhang <xunzh@amazon.com> * update error code to 429 for rate limiting and update logs Signed-off-by: Xun Zhang <xunzh@amazon.com> --------- Signed-off-by: Xun Zhang <xunzh@amazon.com> (cherry picked from commit 9a4166e) Co-authored-by: Xun Zhang <xunzh@amazon.com>
opensearch-project#3116) * add rate limiting for offline batch jobs, set default bulk size to 500 Signed-off-by: Xun Zhang <xunzh@amazon.com> * update error code to 429 for rate limiting and update logs Signed-off-by: Xun Zhang <xunzh@amazon.com> --------- Signed-off-by: Xun Zhang <xunzh@amazon.com>
Description
Add rate limiting to offline batch inference and ingestion. Set the default bulk size for batch ingestion to 500(optimal value from benchmark). If the batch job tasks exceeds the limits defined in the settings, ml_limit_exceeded exception will be thrown.
Update settings for rate limits
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.