How can I test my Jira Cloud integration handles the REST API rate limiting correctly?

I’m working on upgrading our jira integration in our own product so it can connect to a Cloud-based Jira tenant. I got the connection working, but as shown in multiple posts on here, Jira Cloud has API rate limiting on a tenant level. Problem is, I’m trying to trigger this rate limiting in our testing cloud environment, but it seems to be a much higher rate limit than I can feasibly reach with a single thread doing serial API requests to read issues or add comments to issues.

The only actions we do repetitively is reading half a dozen fields from issues one at a time based on commit messages, and adding comments to these issues once we’ve read all the information. we also have something that reads out server info, but that’s only to test the connection. In our own production environment with an on-premise jira, we have had times when we read out and created comments on over 200 issues.

I was able to add almost 1500 comments in about 10 minutes without getting 429 warnings. And weirdly enough, the X-RateLimit headers and retry-after headers that I’m supposed to use to monitor my usage do not seem to be added as HTTP headers to my REST API calls at all.

I’d normally try this on our local test JIRA server, but it’s a Jira Server, not a Jira Data Center install, so I can’t configure rate limiting at all.

How can I test whether my cloud integration handles rate limiting properly? As it stands I’m not even getting the headers that are informing me about the usage, so I’m not quite sure how to proceed.

2 Likes

Hi @NateKerkhofs,

I would suggest mocking the Jira API(s) you are calling so that you can return whatever responses you need whenever you like.

Regards,
Dugald

@NateKerkhofs The most specific information you can find out Jira Cloud rate limits is from this thread, and in particular @czawadka’s (Jira Cloud Scalability team) comments from back in Jan 2019: Are there rate limits for JIRA Cloud APIs?

At the end of his post, Cezary mentions that the team is working on per-consumer rate limiting. I can confirm that this is indeed the case. The developer relations team is engaged with the prod+eng team that is working on it, and when there’s more to share/discuss, we’ll do it here.

But, getting back to where we are today… if you’re making calls in series, and not in parallel, then you’re not likely to see 429s – even if you’re making hoards of calls in fast succession.

Rate limit testing on Jira cloud is not allowed, see Rate limiting

Do not perform rate limit testing against Atlassian cloud tenants because this will place load on Atlassian servers and may impact customers.

However, I would welcome some Jira API endpoint generating some of rate limit responses, see [ACJIRA-2254] As an app developer, I need to be able to validate my app's rate limit response handling - Ecosystem Jira (Still not implemented.)