Redis in Appwrite has high latency spikes – possible link to function timeouts
- 0
- Self Hosted
- Android
- Apple
- REST API
Hello,
We are running a self-hosted Appwrite 1.5.10 on Debian 12 Bookworm (Docker Compose). Redis is used exclusively as part of the Appwrite stack (Pub/Sub, queue, realtime). Our mobile app (iOS/Android) communicates with Appwrite through ~40 functions, which call an external API and return JSON or file data.
Problem
Using redis-cli LATENCY DOCTOR, we observe regular spikes in the fast-command category. Average ~7 ms, with peaks up to ~40 ms.
Spikes occur even under normal load, with Redis having sufficient CPU and RAM available.
We suspect these latency spikes may be causing timeouts in Appwrite functions.
Steps taken so far
Our Docker Compose configuration is otherwise unmodified, but we tested pinning Redis to a dedicated CPU core and increasing its process priority — no improvement.
Questions
- Is it expected in Appwrite that execution.responseBody is passed through Realtime/PubSub (Redis) in full size? Is there a way to limit this data (e.g., large JSONs or binary files)?
- Are there any recommended settings or tuning steps to reduce Redis latency in the context of Appwrite (Appwrite config, Redis tuning, or disabling certain internal events)?
- Could these fast-command spikes realistically lead to function timeouts?
Thank you for any guidance.
Best regards,
Latency doctor log: /data # redis-cli LATENCY DOCTOR Dave, I have observed latency spikes in this Redis instance. You don't mind talking about it, do you Dave?
- fast-command: 10 latency spikes (average 7ms, mean deviation 4ms, period 73.30 sec). Worst all time event 15ms.
I have a few advices for you:
- The system is slow to execute Redis code paths not containing system calls. This usually means the system does not provide Redis CPU time to run for long periods. You should try to:
- Lower the system load.
- Use a computer / VM just for Redis if you are running other software in the same system.
- Check if you have a "noisy neighbour" problem.
- Check with 'redis-cli --intrinsic-latency 100' what is the intrinsic latency in your system.
- Check if the problem is allocator-related by recompiling Redis with MALLOC=libc, if you are using Jemalloc. However this may create fragmentation problems.
Ist from max load. Normal is 0.5
Recommended threads
- THE COLUMNS STUCK ON PROCESSING HOW DO I...
I HAVE SELF HOSTED THE APPWRITE ON VPS
- Impossible to create project via CLI?
Is it possible to create a new project via the appwrite CLI ? I need to create a few projects for something I'm working on and because i don't want to do it man...
- Understanding S3 setup with appwrite
Hey, i'm planning to change the storage from local to S3, tho i have some questions to see before starting the migration. 1. Does all the `/storage/<storage_ty...