Search code examples
phpinstanceibm-cloud

Max number of maxclients en serverlimit on IBM Bluemix php instance


I have a php instance in IBM Bluemix. Now I had problems with multiple connections to the php instance. I increase the maxclients en serverlimit both to 256.

My questions is, what is the maximum number of maxcliensts en serverlimits for a IBM bluemix PHP instance.


Solution

  • There isn't a predefined limit on Bluemix runtimes, it usually depends from the buildpack configuration: according to the buildpack used you can set this kind of parameters through custom configuration files for PHP (php.ini), APACHE (httpd.conf and so on), nginx (nginx[...].conf) where you could set all the parameters you wish to modify from the default values provided by the buildpack you are using

    Using the standard php buildpack available from cloudFoundry you can follow the instructions you find here

    https://github.com/cloudfoundry/php-buildpack/blob/master/docs/config.md

    to edit a lot of configuration values

    • For APACHE settings (if you use APACHE) you could provide your custom conf (one or more) to integrate default values
    • For nginx settings (if you use nginx) you could provide your custom conf (one or more) to integrate default values like Apache
    • For PHP settings you could provide your custom php.ini: it should be put in .bp-config/php/[php version]/php.ini

    The default values are under php-buildpack/defaults where you can find all the default settings

    In your specific case, wishing to edit your max connections accepted you have to edit the following values:

    • if you use Apache, in the httpd/extra/httpd-mpm.conf file you have to add the MaxClients parameter (default to 256 for Apache) in mpm_worker_module
    • if you use nginx the parameter to edit should be worker_connections in nginx/nginx-workers.conf

    So basically you could take these default files, edit according to your need, put the file in your config directory .bp-config/apache/extra/ for Apache .bp-config/nginx/ for nginx and push it along with your application

    Ps.: to set your HTTPD to APACHE or nginx you have to set it through .bp-config/options.json setting the value of WEB_SERVER to Apache or nginx

    Anyway on the buildpack documentation linked above you have all the configuration options you could set through your custom configuration files and how to add these.