I have several websites, mostly clones, all of them using the same API Key. I'm hitting rate limits, and I don't really know why. I though that this could be the reason.
Would making new API keys reduce the rate limit errors for each website?
Usually accessing using an API key doesn't suffer from rate limits. https://appwrite.io/docs/rate-limits
What endpoint you're trying to reach, As I remember that at least one also had rate limits even for API.
/account
endpoints.
What is the full error you're getting?
Shouldn't be
here are some of them (from docker logs)
[Error] Timestamp: 2023-04-28T06:49:17+00:00
[Error] Method: POST
[Error] URL: /v1/account/sessions/anonymous
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Rate limit for the current endpoint has been exceeded. Please try again after some time.
[Error] File: /usr/src/code/app/controllers/shared/api.php
[Error] Line: 127
[Error] Timestamp: 2023-04-28T08:33:49+00:00
[Error] Method: POST
[Error] URL: /v1/account/recovery
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Rate limit for the current endpoint has been exceeded. Please try again after some time.
[Error] File: /usr/src/code/app/controllers/shared/api.php
[Error] Line: 127
Here's the JSON response from the second error above:
{
"message":"Rate limit for the current endpoint has been exceeded. Please try again after some time.",
"code":429,
"type":"general_rate_limit_exceeded",
"version":"1.0.2"
}
sorry for not replying earlier, i made the post right before going to bed
What version of Appwrite you're using?
1.0.2
Maybe in this version setting the user as App (API) user dos not work with API keys. so first what I would do
- Backup everything. yml, .env, database and volumes.
- Upgrading to
1.1.0
and run migration - Upgrading to
1.2.0
and run migration - Upgrading to
1.3.2
and run migration
Notice that the upgrade should be from one minor to minor
Backup scripts
- https://gist.github.com/Meldiron/47b5851663668102a676aff43c6341f7
- https://gist.github.com/stnguyen90/fee636ff652b8ecbf761935b2aa254fb
Upgrade instructions
scary undertaking given that it is in production, but i'll give it a try i guess
thanks
Yes, it is
That's way it's important to backup everything, then you'll be able to go back in a snap of a finger,
Not really 🫰 but real quick 😉 I will also probably go on a time I have the least amount of users / requests.
BTW is all of your Appwrite is in one server within docker-compose.yml?
Are you using the node SDK? How are you using an API key? what's the tech stack for your app?
yes? I just followed the installation steps on the documentation
I'm using these 2, one for the backend and one for the front: https://www.npmjs.com/package/node-appwrite https://www.npmjs.com/package/appwrite
// Server side only code
export const appwrite = new Client()
.setKey(process.env.APPWRITE_API_KEY!)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID!)
.setEndpoint(ENDPOINT);
// When I need to do something in the backend on behalf of the user
function getAppwriteClient(jwt: string): Client {
return new Client()
.setKey(process.env.APPWRITE_API_KEY!)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID!)
.setEndpoint(ENDPOINT)
.setJWT(jwt);
}
Using Nextjs with TypeScript
Ah i see. Kk. In this case, those requests on behalf of the user are subject to rate limits
Recommended threads
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...