Skip to content

docs(postserveaction): document remote mode for long-lived post-serve…#1219

Open
scovl wants to merge 1 commit intoSpectoLabs:masterfrom
scovl:docs/postserveaction-remote-mode
Open

docs(postserveaction): document remote mode for long-lived post-serve…#1219
scovl wants to merge 1 commit intoSpectoLabs:masterfrom
scovl:docs/postserveaction-remote-mode

Conversation

@scovl
Copy link
Copy Markdown
Contributor

@scovl scovl commented Apr 9, 2026

Add documentation for the remote execution mode of post-serve actions, explaining when and why to use it instead of the local (subprocess-per-request) mode.

The existing docs mentioned that a remote host could be configured, but provided no explanation of the trade-offs, no step-by-step setup guide, and no examples. This left users like @arseniycloud discovering the limitation only after hitting OOMKilled in production under load.

Validation

The documented behaviour was validated end-to-end using Docker Compose before merging:

  • Started a container configured with -post-serve-action "remote-test http://action-server:8765 0" and a simulation JSON where the response references postServeAction: "remote-test"
  • Started a minimal Python HTTP server as a separate container (action-server)
  • Confirmed via the admin API (GET /api/v2/hoverfly/post-serve-action) that the remote action was registered correctly
  • Sent a request through the proxy — Hoverfly returned the simulated response (200 OK) and the action server logged the received payload
  • Hoverfly logs confirmed: Remote post serve action invoked successfully

No subprocess was spawned the action server process stayed alive and handled the call via a single HTTP POST, as documented.

Closes #1188

… actions

Add sections explaining the difference between local (subprocess per request)
and remote (long-lived HTTP server) execution modes, including:
- When to use each mode and why local does not scale under high load
- Step-by-step guide: writing the server, payload format, configuring
  Hoverfly via flag and hoverctl, verifying registration via admin API
- Minimal Python server example with inline comments
- Docker Compose example with service hostname

Closes SpectoLabs#1188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Have a way to launch a long-lived postaction process into middleware

1 participant