FPM (FastCGI Process Manager) is an alternative to PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites. php - FPM is one of the most popular open source programming languages on the internet used for web development in platforms such as Magento, WordPress or Drupal.
Prerequisites
- Edit the file
/etc/nginx/sites-available/default
and uncomment the php command lines and place the appropriate socket path to php-fpm socket file as follows:location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php7.2-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; }
- Add the server status in default nginx file:
location ~ ^/(status|ping)$ { allow 127.0.0.1; include fastcgi_params; fastcgi_pass unix:/var/run/php7.2-fpm.sock; }
- For Virtual machines, install the Linux agent.
Configuring the credentials
Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml
phpfpm:
- name: phpfpm
user: <username>
pwd: <Password>
encoding-type: plain
labels:
key1: val1
key2: val2
Configuring the application
Virtual machine
Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml
- name: php-fpm
instance-checks:
service-check:
- php-fpm
process-check:
- php-fpm
port-check:
- 80
Docker environment
Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml
- name: php-fpm
container-checks:
image-check:
- nginx
port-check:
- 80
Kubernetes environment
Configure the application in config.yaml
- name: php-fpm
container-checks:
image-check:
- nginx
port-check:
- 80
Validate
Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.
Metrics
OpsRamp Metric | Metric Display Name | Unit | Description |
---|---|---|---|
php_fpm_accepted_conn | Accepted Conn | Total number of accepted connections | |
php_fpm_listen_queue | Listen Queue | Size of the socket queue of pending connections | |
php_fpm_max_listen_queue | Max Listen Queue | Maximum size of listen queue | |
php_fpm_listen_queue_len | Listen Queue Len | Total number of idle processes | |
php_fpm_active_processes | Active Processes | Total number of active processes | |
php_fpm_total_processes | Total Processes | Total number of processes | |
php_fpm_max_active_processes | Max Active Processes | Number of times the process limit has been reached | |
php_fpm_slow_requests | Slow Requests | Total number of slow requests |