I am using AWS Elasticsearch service. On dev environment there is t3.small instance. I have approx 15 000 records that I want to index as a bulk. What I do is splitting this amount on chunks of 250 items each (or lower than 10 MiB). And run _bulk request with refresh="wait_for" option, one by one, and waiting until request is finished before sending the next one. At some point, approximately on 25 iteration, the request is immediately fails with message
429 Too Many Requests /_bulk
Just in case, if chunk size will be 500 this will fail on 25/2 request (around 12)
It doesn't tell anything more. Just only this, I cannot understand why this happens if there is no anything else that could send bulk requests in parallel with me. I checked that the data size is lesser than 10MB.
What I already have
- I send each request consistently, awaiting the previous one
- Bulk request size is lesser than 10MiB
- Each bulk request contains no more than 250 records in it (+ 250 to indicate that this is indexing)
- I am using refresh="wait_for"
- And even have 2 seconds delay before sending a new request (which I strongly want to remove)
- Adding new instances or increasing storage space doesn't help at all
What could be the reason of having that error? How can I be guaranteed that my request will not be failed if I send everything consistently? Is there any additional option I can pass to be sure that bulk request is completely finished?