# Twelve-Factor WordPress App #8: Concurrency

Factor #8: [Concurrency](https://12factor.net/concurrency)

## Scale out via the process model

> Any computer program, once run, is represented by one or more processes. Web apps have taken a variety of process-execution forms. For example, PHP processes run as child processes of Apache, started on demand as needed by request volume.
> 
> In the twelve-factor app, processes are a first class citizen.
> 
> For example, HTTP requests may be handled by a web process, and long-running background tasks handled by a worker process.

This isn't anything too new for WordPress sites. As quoted above, both Apache and Nginx already have a method of scaling up needed processes.

## In Practice

Of course it's not that simple.

> Twelve-factor app processes should never daemonize or write PID files. Instead, rely on the operating system’s process manager (such as Upstart, a distributed process manager on a cloud platform, or a tool like Foreman in development) to manage output streams, respond to crashed processes, and handle user-initiated restarts and shutdowns.

If we consider PHP-FPM as an app process, we shouldn't daemonize it or write a PID file which is the standard setup.

So how do you manage your PHP-FPM processes? Use an init system like [systemd](https://systemd.io/) or [Upstart](https://web.archive.org/web/20230311195124/https://upstart.ubuntu.com/).

Read this article on [running processes](http://dustin.sallings.org/2010/02/28/running-processes.html) for more background on why you *run* programs instead of *starting* (daemonizing) them.

#### [Turning a WordPress site into a Twelve-Factor App](/twelve-factor-wordpress/)

1. [Codebase](/twelve-factor-01-codebase/)
2. [Dependencies](/twelve-factor-02-dependencies/)
3. [Config](/twelve-factor-03-config/)
4. [Backing Services](/twelve-factor-04-backing-services/)
5. [Build, release, run](/twelve-factor-05-build-release-run/)
6. [Processes](/twelve-factor-06-processes/)
7. [Port binding](/twelve-factor-07-port-binding/)
8. **[Concurrency](/twelve-factor-08-concurrency/)**
9. [Disposability](/twelve-factor-09-disposability/)
10. [Dev/prod parity](/twelve-factor-10-dev-prod-parity/)
11. [Logs](/twelve-factor-11-logs/)
12. [Admin processes](/twelve-factor-12-admin-processes/)

Want to turn your WordPress site into a Twelve-factor App? [**Bedrock**](/bedrock/) is a modern WordPress stack to help you get started with the best tools and practices.