github.com/iron-io/functions@v0.0.0-20180820112432-d59d7d1c40b2/docs/operating/production.md (about)

     1  # Running IronFunctions in Production
     2  
     3  The [QuickStart guide](/README.md#quickstart) is intended to quickly get started and kick the tires. To run in production and be ready to scale, you need
     4  to use more production ready components.
     5  
     6  * Put the IronFunctions API behind a load balancer and launch run several instances of them (the more the merrier).
     7  * Run a database that can scale.
     8  * Asynchronous functions requires a message queue (preferably one that scales).
     9  
    10  Here's a rough diagram of what a production deployment looks like:
    11  
    12  ![IronFunctions Architecture Diagram](../assets/architecture.png)
    13  
    14  ## Load Balancer
    15  
    16  Any load balancer will work, put every instance of IronFunctions that you run behind the load balancer.
    17  
    18  **Note**: We will work on a smart load balancer that can direct traffic in a smarter way. See [#151](https://github.com/iron-io/functions/issues/151).
    19  
    20  ## Database
    21  
    22  We've done our best to keep the database usage to a minimum. There are no writes during the request/response cycle which where most of the load will be.
    23  
    24  The database is pluggable and we currently support a few options that can be [found here](databases/README.md). We welcome pull requests for more!
    25  
    26  ## Message Queue
    27  
    28  The message queue is an important part of asynchronous functions, essentially buffering requests for processing when resources are available. The reliability and scale of the message queue will play an important part
    29  in how well IronFunctions runs, in particular if you use a lot of asynchronous function calls.
    30  
    31  The message queue is pluggable and we currently support a few options that can be [found here](mqs/README.md). We welcome pull requests for more!
    32  
    33  ## Logging, Metrics and Monitoring
    34  
    35  Logging is a particularly important part of IronFunctions. It not only emits logs, but metrics are also emitted to the logs. Ops teams can then decide how they want
    36  to use the logs and metrics without us prescribing a particular technology. For instance, you can [logspout-statsd](https://github.com/iron-io/logspout-statsd) to capture metrics
    37  from the logs and forward them to statsd.
    38  
    39  [More about Metrics](metrics.md)
    40  
    41  ## Scaling
    42  
    43  There are metrics emitted to the logs that can be used to notify you when to scale. The most important being the `wait_time` metrics for both the
    44  synchronous and asynchronous functions. If `wait_time` increases, you'll want to start more IronFunctions instances.
    45