Skip to content
Back

Self-hosted 1.9.0 — what's the canonical way for functions to call the Appwrite API on the same host

  • 0
  • Self Hosted
AlimFreight🇺🇦 🇨🇦
6 May, 2026, 22:08

Self-hosted 1.9.0 — canonical way for functions to call the API on the same host?

Setup: Go functions on self-hosted 1.9.0. Public domain via traefik, valid LE cert. APPWRITE_ENDPOINT=https://my.example.com/v1 (auto-injected APPWRITE_FUNCTION_API_ENDPOINT resolves to the same public value).

Problem: functions that fan out 5–6 parallel ListDocuments via errgroup hit 15 s OpenRuntimes gateway timeouts under burst. 4 calls finish in 10–60 ms, 1–2 hang. Error on the hung ones:

Get "https://my.example.com/v1/tablesdb/.../rows": context deadline exceeded (Client.Timeout exceeded while awaiting headers) Sequential single calls always succeed in tens of ms — so it's the public-hostname HTTP path under burst, not MariaDB.

Probe from inside the runtime container:

appwrite (container name) → DNS 10.0.0.26, TCP ok, but GET /v1/health returns the Console HTML SPA, not JSON appwrite-traefik, traefik → DNS fails (different network) public hostname → JSON, but throttles under burst (hairpin) Q: What's the supported way for a function to call /v1/* on the same host without hairpinning out via the public domain?

Is there an internal endpoint that serves /v1/* as JSON regardless of Host header? Or should I set APPWRITE_ENDPOINT=http://appwrite/v1 and override the SDK's Host header to _APP_DOMAIN? Any helper for that? Or attach runtimes to a network where appwrite-traefik is reachable, so I can use http://appwrite-traefik/v1? Or is the official guidance to avoid burst-parallel SDK calls inside a single function execution? I have full step traces + durations confirming it's the HTTP callback path, not the queries. Thanks 🙏

TL;DR
Developers using self-hosted 1.9.0 are having issues with API calls under burst causing timeouts. The problem is related to making calls to the public host name. To resolve this, developers can change APPWRITE_ENDPOINT to http://appwrite/v1 and override the SDK's Host header to _APP_DOMAIN. This will reduce hairpinning and improve performance for parallel calls.
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