github.com/grafana/pyroscope@v1.18.0/docs/sources/reference-pyroscope-architecture/deployment-modes/index.md (about)

     1  ---
     2  title: "Pyroscope deployment modes"
     3  menuTitle: "Deployment modes"
     4  description: "You can deploy Pyroscope in either monolithic mode or microservices mode."
     5  weight: 20
     6  ---
     7  
     8  # Pyroscope deployment modes
     9  
    10  You can deploy Pyroscope in one of two modes:
    11  
    12  - Monolithic mode: In this mode all components run in a single process and is meant to be used when you _only need one pyroscope instance_ as multiple instances will not share information with each other
    13  - Microservices mode: In this mode in this mode as you scale out the number of instances, they will share a singular backend for storage and querying
    14  
    15  The deployment mode is determined by the `-target` parameter, which you can set via CLI flag or YAML configuration.
    16  
    17  ## Monolithic mode
    18  
    19  The monolithic mode runs all required components in a single process and is the default mode of operation, which you can set by specifying `-target=all`. Monolithic mode is the simplest way to deploy Pyroscope and is useful if you want to get started quickly or want to work with Pyroscope in a development environment. To see the list of components that run when `-target` is set to `all`, run Pyroscope with the `-modules` flag:
    20  
    21  ```bash
    22  ./pyroscope -modules
    23  ```
    24  
    25  [//]: # "Diagram source at https://docs.google.com/presentation/d/1C1fl0pH8wmKZe8gXo-VwmUuLvGiPmADfvey15FSkWpE/edit#slide=id.g11694eaa76e_0_0"
    26  
    27  ![Pyroscope's monolithic mode](monolithic-mode.svg)
    28  <!--
    29  Monolithic mode can be horizontally scaled out by deploying multiple Pyroscope binaries with `-target=all`. This approach provides high-availability and increased scale without the configuration complexity of the full [microservices deployment](#microservices-mode).
    30  
    31  [//]: # "Diagram source at https://docs.google.com/presentation/d/1C1fl0pH8wmKZe8gXo-VwmUuLvGiPmADfvey15FSkWpE/edit#slide=id.g11658e7e4c6_1_20"
    32  
    33  ![Pyroscope's horizontally scaled monolithic mode](scaled-monolithic-mode.svg)
    34   -->
    35  ## Microservices mode
    36  
    37  In microservices mode, components are deployed in distinct processes. Scaling is per component, which allows for greater flexibility in scaling and more granular failure domains. Microservices mode is the preferred method for a production deployment, but it is also the most complex.
    38  
    39  In microservices mode, each Pyroscope process is invoked with its `-target` parameter set to a specific Pyroscope component (for example, `-target=ingester` or `-target=distributor`). To get a working Pyroscope instance, you must deploy every required component. For more information about each of the Pyroscope components, refer to [Architecture](../).
    40  
    41  If you are interested in deploying Pyroscope in microservices mode, we recommend that you use [Kubernetes](https://kubernetes.io/).
    42  
    43  [//]: # "Diagram source at https://docs.google.com/presentation/d/1C1fl0pH8wmKZe8gXo-VwmUuLvGiPmADfvey15FSkWpE/edit#slide=id.g11658e7e4c6_1_53"
    44  
    45  ![Pyroscope's microservices mode](microservices-mode.svg)