# 429 Too Many Request when indexing

**URL:** https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234
**Category:** OpenSearch
**Created:** [July 10, 2024, 9:21pm UTC](https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234 "2024-07-10T21:21:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bagsmode](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/bagsmode/32/7480_2.png) [@bagsmode](https://forum.opensearch.org/u/bagsmode)
#### Post date: [July 10, 2024, 9:21pm UTC](https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234/1 "2024-07-10T21:21:43Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
“opensearch-project/opensearch-php”: “^2.2”

**Describe the issue** :  
Attempting to index 800,000 records, but the process is failing with exception 429 Too Many Requests. I’ve tried chunking the requests, adding sleeps, and even chunking into separate service calls, but they all fail at around 185-190,000 request with the 429. It’s making me wonder if there’s some throttling going on.

**Configuration** :

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

### Author: ![gaobinlong](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gaobinlong/32/5242_2.png) [@gaobinlong](https://forum.opensearch.org/u/gaobinlong)
#### Post date: [July 11, 2024, 3:14am UTC](https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234/2 "2024-07-11T03:14:49Z")

</div>

Could you show the complete error message? Does the error message show that the queue of the write thread\_pool is full?

---

<div class="post-metadata">

### Author: ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)
#### Post date: [July 11, 2024, 11:10am UTC](https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234/3 "2024-07-11T11:10:48Z")

</div>

Hi @bagsmode,

How are you indexing?

I do not believe there are any built-in throttling mechanisms (you could build that logic in your code/script).

Have you considered using `_bulk` API [Bulk - OpenSearch Documentation](https://opensearch.org/docs/latest/api-reference/document-apis/bulk/) ?

Is scaling out by adding more nodes to your cluster an option in your current infrastructure?

best,  
mj

---

<div class="post-metadata">

### Author: ![bagsmode](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/bagsmode/32/7480_2.png) [@bagsmode](https://forum.opensearch.org/u/bagsmode)
#### Post date: [July 11, 2024, 1:59pm UTC](https://forum.opensearch.org/t/429-too-many-request-when-indexing/20234/4 "2024-07-11T13:59:21Z")

</div>

I was trying to reproduce the error for the detail, but I had also reached out to our Cloud staff. They found we were only using a T3 Small, and have since upgraded to a Large. This seems to have cleaned up the issues.

I’ll take a look at the \_bulk as well.

Appreciate your help.
