Route api creation of posts too many requests

We’re doing some testing with multiple users, doing topic queries, topic creations, and also adding replies to a topic. In the middle of the test, the post creation route started returning code 429, and it was no longer possible to respond to topics, but the other query routes, like, and the topic creation route, which are the same in this case, what changes is the attribute did not give 429.

Just to note, our personalized front calls our API, which in this API performs all the necessary actions in the discourse, we use it as an intermediary to process the information. Another point is that all tests are carried out with different users, using the functionality of adding the username to the route header. The only thing would be the IP itself because of the server that has the intermediate API

The question is, how can only the post creation part give the 429 problem, while all the others continued to work?

I would investigate in two directions: The number of requests to the API depends on your pace and number of sub-requests.
How do you handle rate limiting on your part?

Hmmm. If you get a 429 you should wait and repeat. I see no reason that your API has to fail in that case.

We use Discourse Saas, so I don’t know if it’s possible to configure the request limit per IP, could you tell me?

But the strange thing is that it gives 429, but the other routes continue to work even when I create a topic, which if you think about it is the same post creation route just by changing an attribute.
But who knows, it could be a matter of waiting too. Because we are doing a stress test, and some routes are called before creating a topic, after it is created we call the route to respond, causing error 429, when the test is repeated a few seconds must have already passed and the creation works, thus breaking the responding part that is always executed after creation.

It’s likely the 429 on post create is not coming from too many api requests since other requests are continuing to work, but coming from a site setting like rate_limit_create_post.

3 Likes