Once a month my app has a ton of usage and I always run into the Too many requests 429 error.
I am trying to optimize the queues and jobs to manage that, but as the platform is getting more and more users, I am not able to optimize it and running that in enough time.
I have seen I could use the dev api key, to bypass that limit.
Is that a good practice? Or what other options do I have?
Thanks
Summary
The user is experiencing rate limit errors on backend calls even though rate limits are supposed to apply to specific IPs or users. They are using API keys for server-side authentication and have ruled out JWT authentication. Possible causes are an issue with the API key implementation or hitting service abuse/concurrency limits. The solution suggested is to add a local queue broker like Redis/BullMQ or Bee-Queue to cap the concurrent execution rate. They are also advised to share a demo app to help identify the problem. The max RPS limit depends on the endpoint. The specific function causing rate limits is a membership renewal function making multiple collection updates and inserts.
martins4
Rank 2: Process
May 13, 2026, 10:11
/**
Pace an Appwrite SDK call through the global token bucket. Retries on 429
with exponential backoff + jitter, respecting Retry-After / `X-RateLimit-
Reset` when present. Any non-429 error is rethrown immediately.
Usage:
const doc = await withAppwriteCall(() =>
tablesDB.getRow({ databaseId, tableId, rowId })
)
Wrap at the REPO boundary, not at every call site — see the repo files for
Rate limits should apply to specific IPs or users. I dont think spike of users active should cause rate limits.
Curious, do you use SSR capabilities without API key or session secret? Doing that might introduce global rate limit that you might be hitting.
As for dev keys, I would not recommend to use them on production, bad actor could use such dev key to harm your project.
martins4
Rank 2: Process
May 14, 2026, 09:26
Checking it rn
martins4
Rank 2: Process
May 14, 2026, 16:37
I have checked the codebase and not sure if i am using SSR capabilities
martins4
Rank 2: Process
May 14, 2026, 16:40
I mean we are using API KEY for sure on the server side.
And we call that using the cron, with a valid key.
.setKey(env.APPWRITE_API_KEY), and every Appwrite SDK call goes through that wrapped handle. Per-user JWT calls in verifyJwt.ts:15 use .setJWT(jwt), which is also a valid auth path (per-user bucket).
martins4
Rank 2: Process
May 14, 2026, 16:49
This being said, it should be impossible for me to be getting 429 errors in the cron runs from the server. I am using concurrent jobs, might that have anything to do?
Interesting indeed, can you share exact error message you are getting, and a piece of code that causes it? Alternatively, could you make a tiny demo app with just this concept?
I ask because once I can reproduce it, should be easily solvable
martins4
Rank 2: Process
May 15, 2026, 07:51
Yes, I am on it
martins4
Rank 2: Process
May 15, 2026, 07:53
Once I hit the rate limit this was the errors I was getting
martins4
Rank 2: Process
May 15, 2026, 07:54
I guess the piece of code can not be shared because it is an entire queue/jobs structure working on 4000 pieces of data that needed to be treated, that treatment is absolute core for our platform