Child pages
  • WHM API 1 Functions - get_fpm_count_and_utilization
Skip to end of metadata
Go to start of metadata

Description

This function provides information that will help you to determine whether your server can handle the workload if you enable PHP-FPM for all domains. 


Warning:

We strongly recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with less than the required RAM, your server may experience severe performance issues.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_fpm_count_and_utilization?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_fpm_count_and_utilization?api.version=1
 Command Line
whmapi1 get_fpm_count_and_utilization 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "domains_to_be_enabled":3,
      "total_domains":3,
      "memory_needed":90000,
      "show_warning":1,
      "domains_using_fpm":0,
      "number_of_new_fpm_accounts_we_can_handle":-3
   },
   "metadata":{  
      "result":1,
      "command":"get_fpm_count_and_utilization",
      "version":1,
      "reason":"OK"
   }
}
 Output (XML)
<xml>
    <data>
        <domains_to_be_enabled>3</domains_to_be_enabled>
        <domains_using_fpm>0</domains_using_fpm>
        <memory_needed>90000</memory_needed>
        <number_of_new_fpm_accounts_we_can_handle>-3</number_of_new_fpm_accounts_we_can_handle>
        <show_warning>1</show_warning>
        <total_domains>3</total_domains>
    </data>
    <metadata>
        <command>get_fpm_count_and_utilization</command>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
    </metadata>
</xml>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible ValuesExample

domains_to_be_enabled

integer

The number of domains that you will enable with PHP-FPM when you run the /scripts/php_fpm_config_convert script.

A valid value.

2

domains_using_fpm

integer

The number of domains with PHP-FPM enabled.

A valid value. 20

number_of_new_fpm_accounts_we_can_handle

integer 

The approximate number of domains on which you can enable PHP-FPM without a server overload.

A valid value.8

show_warning

Boolean 

Whether you may overload your server when you convert all domains to PHP-FPM.

  • 1High risk of server overload when you enable PHP-FPM.
  • 0Low risk of server overload when you enable PHP-FPM.
0

total_domains

integer 

The total number of domains on the server.

A valid value.22
memory_neededinteger

The approximate number of megabytes of memory that your system will require to convert the remaining domains to PHP-FPM.

A valid value.90000