diff --git a/docs/toolhive/guides-vmcp/scaling-and-performance.mdx b/docs/toolhive/guides-vmcp/scaling-and-performance.mdx index 886dcae1..a9c4cd51 100644 --- a/docs/toolhive/guides-vmcp/scaling-and-performance.mdx +++ b/docs/toolhive/guides-vmcp/scaling-and-performance.mdx @@ -65,10 +65,18 @@ However, **stateful backends** make horizontal scaling difficult: - **Stateful backends** (Playwright browser sessions, database connections, file system operations) require requests to be routed to the same vMCP instance that established the session -- Requires session affinity configuration (which may not work reliably through - proxies) - Session resumption may not work reliably for stateful backends +The `VirtualMCPServer` CRD includes a `sessionAffinity` field that controls how +the Kubernetes Service routes repeated client connections. By default, it uses +`ClientIP` affinity, which routes connections from the same client IP to the +same pod. You can configure this using the `sessionAffinity` field: + +```yaml +spec: + sessionAffinity: ClientIP # default +``` + For stateful backends, vertical scaling or dedicated vMCP instances per team/use case are recommended instead of horizontal scaling.