Hello,
I’m trying to understand how fly-proxy handles HTTP request bodies before they reach an application, particularly buffering for retries or replays.
Could someone from Fly clarify the current behavior?
-
Is the request-body buffer held exclusively in process memory, or can any body content reach disk, temporary files, swap, or other persistent or semi-persistent storage on Fly-operated infrastructure, including between the edge proxy and the host running my Machine?
-
What is the current buffer limit? When a request exceeds it, is the remaining body streamed without retention, or is any portion spooled elsewhere? Does exceeding the limit disable retries or replays for that request?
-
How long is buffered body data retained, and what causes it to be released, including after a retry, disconnect, failed request, or proxy crash or restart?
-
Can request-body content appear in platform logs, traces, error pages, metrics, crash dumps, or diagnostic captures? If so, under what circumstances?
-
Is this behavior documented publicly? How are changes to it communicated?
This is about fly-proxy and the HTTP ingress path, not application-side storage. I’m asking about general platform behavior, so no access to an account, application, or database is needed.
A written explanation from Fly staff, with links to relevant documentation and any qualifications or exceptions, would be appreciated. Please distinguish confirmed current behavior from assumptions or behavior that is not guaranteed.
Thank you.
Hi, it might be easier to help if instead of asking for these details you’d share what you’re seeing: what are you trying to accomplish, what are you expecting to happen, and what is happening instead.
In any case:
The Fly proxy buffers request bodies in memory, so it can retry. The hop next to your Machine streams the body without buffering it. The Fly proxy is a process, so its memory may conceivably be paged to swap by the OS (but then performance would tank so in practice our configuration is such that the proxy isn’t swapped out), and a core dump might be generated on process crashes, for debugging.
Proxy will buffer up to 10 MB so it can retry the request. A larger body can’t be retried. Anything over the 10MB buffer size is just streamed through. Replays only work with requests of up to 1MB, though.
The buffer is freed when the request finishes, fails or disconnects, or when the proxy restarts.
Body content is not logged anywhere, only sizes and timings.
Only a few of these behaviors are publicly documented because they are implementation details and might change (but: back to my original request: if you need these details, I’d like to know why -what are you seeing that makes you suspect the Proxy’s buffering could be causing it? Are you planning on designing a solution that relies on these specific behaviors? pro tip: don’t, it might change at any point, with the possible exception of the 1MB replay limit). Retries and replays, including the 1MB replay limit, are covered in https://fly.io/docs/networking/dynamic-request-routing/. The 10MB retry buffer is described under error code PA01 (https://fly.io/docs/monitoring/error-codes/#pa01-replay-retry-buffer-exceeded).
Cheers!
Thanks, this is really helpful.
To answer your question: we run a small intake app on Fly (app wm-bk-intake) where people upload personal financial documents. We are not designing around proxy buffering. We just need to describe accurately, in our privacy and retention notes, whether upload bytes could ever persist outside our own Machine. We would not rely on any undocumented behavior.
Three narrow follow-ups, if you can:
- Core dumps: if fly-proxy crashes and writes a core dump, could it contain request body bytes? If so, where is it stored, roughly how long is it kept, and who can access it?
- Swap: do the proxy hosts have swap enabled at all (yes or no), as opposed to “conceivably”?
- Is there any layer in front of fly-proxy (edge or TLS termination) that buffers request bodies differently, or is the in-memory behavior you described the whole path to our Machine?
Also, is there any security or data-handling page or document we can cite for this, since you noted these details can change?
Thank you.