Skip to content
Back

Usage of the new Client() and dealing with high traffic load.

  • 0
  • Self Hosted
  • Databases
  • Web
Hybes
16 Apr, 2026, 13:10

Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out -

To put in perspective of how the app works, we have a Nuxt Application with Nitro endpoints that handle majority of the Appwrite lookups, it has a shared singleton client, that gets used across database lookups, but yet we still saw a lot of timeout issues, and overloading on to the Appwrite side of things, causing our lookups to fail, even though we lightly cache certain routes for users.

Is there something I'm missing for handling mass amounts of traffic, and are there perhaps some recommended steps to take to get this working as best we can.

We saw things like:

  • cause: ConnectTimeoutError: Connect Timeout Error
  • ConnectTimeoutError","stack":"ConnectTimeoutError: Connect Timeout Error\n at onConnectTimeout (/app/.output/server/node_modules/node-fetch-native-with-agent/dist/shared/node-fetch-native-with-agent.df7e6bd6.cjs:1:43536)\n at /app/.output/server/node_modules/node-fetch-native-with-agent/dist/shared/node-fetch-native-with-agent.df7e6bd6.cjs:1:42805\n at Immediate._onImmediate (/app/.output/server/node_modules/node-fetch-native-with-agent/dist/shared/node-fetch-native-with-agent.df7e6bd6.cjs:1:43220)\n at process.processImmediate (node:internal/timers:504:21)
  • a multitude of fetch errors/failed etc.

Our Appwrite is running on a well spec’d bare metal server, and we have Cloudflare infront of it.

But when a mere 100 users all hit the app at the same time for an event going live at a certain time, we saw all these issues come in and bottleneck the app.

Any suggestions, ideas, etc are all welcome!

TL;DR
Developers are experiencing timeout issues and overloading when handling mass amounts of traffic in a Nuxt Application with Nitro endpoints. The shared singleton client seems to be causing bottlenecks. Some errors observed include ConnectTimeoutError. Recommendations: implement better handling for high traffic load, consider optimizing database lookups, and ensure caching mechanisms are effective.
Ibaraki Douji
16 Apr, 2026, 14:25

there can be multiple things :

  • your server can't handle that many websocket (not likely if your server is big enough and/or running on a cluster)
  • appwrite services are maybe overloaded (container limits, or maybe a default configuration that is too low for that many users)
  • the database could have too many connections opened (and then possibly fails to open the websocket)

Could you check the appwrite containers (API, Realtime and maybe the Workers) to see if any have error logs inside them, if yes paste them here.

  • in case it's the database not allowing the connection, with maria you can increase the max_connections to like 1000
  • in case it's the appwrite service itself you could maybe try to duplicate the container (they are stateless microservices so they can be replicated, in my setup i have 2 API, 2 Realtime, 2 Console, and some workers are also replicated, just in case on of my node is down)
Hybes
16 Apr, 2026, 14:42

mmm ok running multiple coule be interesting - it all runs through docker compose, so we could look in to that - max_connections is another interesting point. ill scan the logs and see where we're at

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more