Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Updating the MySQL max connections setting


The MySQL database will start giving too many connection errors when all the available connections are in use by other clients. In this recipe, you will learn how to update the MySQL cartridge max connections setting.

Getting ready

To complete this recipe, you will need an application with a MySQL cartridge. Please refer to the Adding a MySQL cartridge to your application recipe of this chapter to learn how to install the MySQL cartridge.

How to do it…

Follow these steps to update the MySQL max connection setting:

  1. To set the maximum connections to 200, open a command-line terminal, and run the following command:

    $ rhc env-set OPENSHIFT_MYSQL_MAX_CONNECTIONS=200 --app myapp
    
  2. After setting the environment variable, you have to restart the MySQL cartridge for changes to take effect using the following command:

    $ rhc cartridge-restart mysql --app myapp
    

How it works…

The number of connections supported by the MySQL database is controlled by the max_connections...