---
title: "Run two copies of the app in staging · Agent Wranglers"
url: https://agentwranglers.se/playbook/scaling/stateless-app-servers/two-copies-in-staging
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Run two copies of the app in staging

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Stateless app servers](https://agentwranglers.se/playbook/scaling/stateless-app-servers.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- ID: SCL-6
- Level: Recommended
- Chapter: [Stateless app servers](https://agentwranglers.se/playbook/scaling/stateless-app-servers)
- Rule: Run at least two copies of the app behind the load balancer in staging, with no sticky sessions. State hidden in one process then fails in tests, not in production.
- Applies when: The project runs its own servers, virtual machines or containers.
- How: [Keep no state inside the app process](https://agentwranglers.se/playbook/scaling/stateless-app-servers/stateless-processes) lists what belongs outside. With one copy, a session in memory or a file on local disk works by accident. With two copies and round robin, every second request misses it. Run the end-to-end tests against this setup on every deploy to staging.
- Check: Staging runs 2 or more copies of the app. The end-to-end suite passes with the load balancer set to round robin and session affinity off.

## Sources

- [The Twelve-Factor App, Processes](https://12factor.net/processes)

## Related rules

- [Keep no state inside the app process](https://agentwranglers.se/playbook/scaling/stateless-app-servers/stateless-processes) in Scaling

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/scaling/stateless-app-servers/two-copies-in-staging">Agent Wranglers scaling playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Pinning each visitor to one server](https://agentwranglers.se/playbook/scaling/stateless-app-servers/no-sticky-sessions)
- [Stateless app servers](https://agentwranglers.se/playbook/scaling/stateless-app-servers)
