CloudLinux OS Shared Pro

X-Ray

Description

Warning!

X-Ray is available out of the box for cPanel, Plesk, and DirectAdmin. For other control panels you should implement integration as described here

X-Ray is a tool developed for website performance monitoring and performance issues detection.

X-Ray can gather and visualize information about top N slowest system functions, external requests, software modules and database queries of the client’s website.

Installation

  1. Make sure you have CloudLinux OS Shared Pro subscription (only non-reseller accounts apply)

  2. Make sure you have installed LVE Manager version 6.2 or later. You can install or update it with the following commands:

    • installation
    # yum install lvemanager
    
    • update
    # yum update lvemanager
    
  3. X-Ray will be activated on all your servers during 4 hours. You will see the X-Ray tab in the LVE Manager UI.

  4. For instant activation, run the following command:

    # rhn_check
    

    If the rhn_check command is not found, run the following command:

    # yum install rhn-check rhn-setup
    
  5. Then install the alt-php-xray package

    • Via user interface

      • Go to the X-Ray tab.
      • Click Install to start installation.

    • Via SSH by running the following command:

    # yum install lvemanager alt-php-xray
    
  6. After installation, use the Start tracing button to create your first tracing task for a slow site.

How to manage X-Ray

X-Ray provides two options for monitoring domain requests speed: Tracing task and Continuous task.

Warning

To use Continuous task, update your LVE Manager and alt-PHP-X-Ray packages to versions lvemanager-6.2.9-1 and alt-php-xray-0.2-1 by running the following command:

yum update lvemanager alt-php-xray
  • Tracing task is a task created manually for a specific URL to collect server requests. The task will end either after a specified number of requests to the URL or after a specified time (maximum after two days). It is not possible here to automatically email a report but it is possible to export the report in PDF and send to a user.

  • Continuous task is a task that initiates a daily hourly tracing requests for a specified domain and email a monitoring report. Continuous task can't stop automatically, you need to stop it manually.

In fact, continuous task allows to automatically create a tracing task for each new day, with the ability to get a report for the past day.

Tracing tasks tab

The Tracing tasks tab contains a list of all tracing tasks created both manually and automatically via continuous tasks.

The Created column shows how a task was created – automatically (by continuous task) or manually.

Continuous tracing tab

Warning

To use Continuous task, update your LVE Manager and alt-PHP-X-Ray packages to versions lvemanager-6.2.9-1 and alt-php-xray-0.2-1 by running the following command:

yum update lvemanager alt-php-xray

The Continuous tracing tab contains a list of continuous tasks for which tracing tasks will be created automatically for a new day for a specific domain.

Managing tracing task

Creating a new tracing task

  1. Go to the X-Ray tab
  2. Click the Start tracing button to create a new task
  3. In the opened popup specify a website URL to trace
  4. Click the Run button
  5. Tracing will run in the default mode. In the default mode X-Ray traces the first 20 requests for a specified URL

  • URL should be a valid URL of the domain which exists on the current hosting server. The URL field supports wildcard matching. To learn more about wildcard matching, click How to use special characters.

  • Advanced settings allow you to set an IP address and tracing options: by time or by number of queries.

Advanced settings

  • Client’s IP: it is an IPv4 address of a machine to trace. For example, if you have a production website that processes requests from different IP addresses and you do not want to add these requests to the tracing task. So, you can set a specific IP address and X-Ray will analyze requests only from this specific IP address. Record for
  • Time period: how much time X-Ray collect the requests (2 days max)
  • Requests: the amount of requests that X-Ray will collect

After creating, the task appears in the list of tracing tasks.

Viewing tracing tasks list

Tasks created Manually are simply tracing tasks.

Tracing status

A tracing task can have the following statuses:

  • Running – tracing is in progress
  • Stopped – tracing was stopped by administrator
  • On hold – the same URL already exists in the lists. Task processing will not start automatically. Administrator should start it manually.
  • Completed – period of time is finished or number of requests is reached.

Collected requests for tracing task

Warning!

Collected requests are available in the UI for two weeks.

Click to open a list of collected requests.

Tracing tasks

The slowest request is highlighted.

  • Total displays how many requests were collected according to tasks requirements.
  • Pending displays how many of collected requests are not visible in the table yet.
  • Throttled displays the number of requests during the execution of which the LVE limits were exceeded.
  • Slow displays the number of requests lasting more than one second.

There are filters for the request types and the indicator of a filter used now.

If slow requests were not detected during the tracing task, the following is displayed. Here, you can also view all requests.

X-Ray collects the following data for each request:

  • Top issues – the slowest items of a request
  • Software modules/plugins by execution time (only for WordPress plugins)
  • Database queries by execution time
  • External requests by execution time
  • Other system functions by execution time

Software modules/plugins

The Software modules/plugins section displays the following data:

  • Software type – a type a module/plugin. For now, X-Ray can analyze only WordPress software
  • Software module – a name of the WordPress plugin
  • Duration – plugin execution time
  • Duration (%) – plugin execution time as a percentage of the total duration of the request

Database queries

The Database queries section displays the following data:

  • Query – the executed SQL-query
  • File – the file and the line of the executed query and backtrace
  • Software module – a WordPress plugin name from which the request was completed. If the request does not belong to any of the WordPress plugin, the name of the function that executed the given request is displayed
  • Calls – the number of identical SQL queries
  • Duration – execution time as a percentage of the total duration of a request and the function processing time (in brackets)

External requests

The External requests section displays the following data:

  • URL – the URL of the executed request
  • File – the file and the line of the executed request and backtrace
  • Duration – execution time as a percentage of the total duration of a request and the function processing time (in brackets)

System functions

The System functions section displays the following data:

  • Function – the executed function
  • File – the file and the line of the executed request
  • Duration – execution time as a percentage of the total duration of a request and the function processing time (in brackets)

Stopping tracing task

Click to stop the tracing task.

The tracing task status will be changed to Stopped. Data will not be collected anymore but you can see already collected information or continue tracing later by clicking .

Deleting tracing task

Click to delete the tracing task.

Warning!

When you have deleted a tracing task, all collected data will be unavailable.

Managing continuous tasks

Creating a new continuous task

  1. Click the Create continuous tracing button

  1. Specify URL in the Domain field and email in the Email for reports field and click the Create button.

  1. You can see a new task in the Continuous tracing tab in the X-Ray UI.

  1. If you stop a continuous tracing task, a new task for the next 24 hours will not be created. The task for the current day will be finished at midnight and the report will be emailed.

  2. If you delete a continuous tracing task, the task for the current day will be finished at midnight and the report will be emailed.

Viewing continuous tasks list

You can find a list of continuous tracing tasks in the Continuous tracing tab.

You can find automatically created tasks in the Tracing tasks tab marked as Automatically in the Created column.

The statuses for automatically created tasks are the same as for tracing task.

To view detailed info about an automatically created task, click . You will get requests grouped by hour.

Click to a group to open a list of the requests.

The following data is collected for each request:

  • Software modules/plugins by execution time (only for WordPress plugins)
  • Database queries by execution time
  • External requests by execution time
  • Other system functions by execution time

Stopping automatic tracing task

Stopping automatic tracing task (a part of continuous tracing task) affects only the automatic tracing task for the current day. A new task for the next day will be created at the end of the day.

To stop the continuous tracing task completely, see Creating a new continuous task, paragraph 4.

Deleting automatic tracing task

Deleting automatic tracing task (a part of continuous tracing task) affects only the automatic tracing task for the current day. A new task for the next day will be created at the end of the day.

To delete the continuous tracing task completely, see Creating a new continuous task, paragraph 5.

Continuous task daily report

  1. Users get daily reports on their emails. An example of a report is shown below:

  2. Click the link in the email to show the detailed report:

  3. You can view requests grouped by hour:

  4. You can also view the detailed information about request:

End-user X-Ray plugin

Warning

To use the end-user X-Ray plugin, update your LVE Manager and X-Ray packages to the lvemanager-6.3.9-1 (or later) and alt-php-xray-0.3-1 (or later) by running the following command:

# yum update lvemanager alt-php-xray

How to enable/disable the end-user X-Ray plugin

You can hide or show the end-user X-Ray plugin icon by ticking or unticking the proper checkbox in the LVE Manager.

Go to LVE Manager → Options Tab → User interface settings.

Note

The X-Ray plugin icon in the end-user interface is hidden when the checkbox is ticked.

How to manage the end-user X-Ray plugin

The web interface of the end-user X-Ray plugin is almost the same as the X-Ray administrator interface.

But there are some differences and they are described further.

  • End-users can create tasks only for their domains from the drop-down list:
  • To specify URL or wildcard, end-users should use the input field next to the domain:

You can read about all other basic interface elements and managing tracing tasks in the Managing tracing task section.

Note

Tracing tasks created by an end-user will also be displayed in the administrator interface and administrators can manage the end-user's tasks the same way as they manage their own. At the same time, tasks created by the administrator or other end-users will not be displayed in the UI of the current user.

End-user X-Ray plugin limitations

  • The end-user X-Ray plugin does not support creating continuous tasks.

  • The end-user has a limit of tracing tasks running at a time. Before starting the next task, the end-user should wait for the completion of the previous ones or forcefully stop the running ones. Otherwise, the user will get the next error:

    Note

    The current limit is one tracing task per user.

  • The administrator and the end-user can’t run the tracing task for the same Domain/URL at the same time. Once, the administrator started a specific tracing task, the end-user will not be able to duplicate it. And the same is true for the administrators – they will just see the running task for the specific domain and see the notification that they're trying to create a tracing task with a duplicated URL.

  • If continuous tracing is enabled for the domain, the end-user will not be able to create a new task for this domain because the same rule works - it will be a duplicate of the existing tracing tasks. The next warning will appear:

    To solve this, the existing running tasks for the same Domain/URL should be stopped or completed. You can find more details about this in the FAQ.

  • If a user's tracing task was created for a domain which is using the FPM handler there's an additional limitation. To avoid frequent reloads of the particular FPM service, Start tracing , Stop tracing or Continue tracing action would be blocked in case if the latest reload of a corresponding FPM service was done less than 1 minute ago.
    If a user gets such an error message - it means that 1 reload in 1 minute for a particular FPM service has been already done. Just try performing the same operation once again in a while.

X-Ray automated throttling detection

Note

CPU throttling detection is available since alt-php-xray-0.3-2 and lvemanager-xray-0.5-2.

IO/IOPS throttling detection is available since alt-php-xray-0.3-7 and lvemanager-xray-0.7-1.

  • kmod-lve-2.0-23 (and later) for CloudLinux OS Shared 8 or CloudLinux OS Shared 7 hybrid
  • kernel-1.5-58 (and later) for CloudLinux OS Shared 7 or CloudLinux OS Shared 6 hybrid

are also required to utilize the feature of IO/IOPS throttling detection.

Warning

X-Ray automated throttling detection feature is not supported for CloudLinux OS Shared 6

The X-Ray automated throttling detection system checks if the account exceeds LVE limits by CPU or by IO/IOPS during the HTTP request execution. Requests with exceeded LVE limits are indicated in both X-Ray Administrator and X-Ray User plugins.

If CPU limiting was detected for a particular request, it is indicated in the X-Ray UI that the system itself has slowed down the request processing due to CPU throttling and this is apparently not a performance issue in the PHP code.

If limiting by IO and IOPS in total was detected for a particular request, it is indicated in the X-Ray UI in the same manner, except for the cause of slowing down the request -- IO throttling.

The case of both limiting for the request is also possible.

Requests with exceeded LVE limits are also marked in the request detailed view.

Requests with exceeded LVE limits are marked in the PDF report as well.

X-Ray client

X-Ray client is a PHP extension named xray.so. It analyzes the processing time of the entire request and its parts and then sends the data to the X-Ray agent.

List of supported PHP versions

The list of currently supported PHP versions:

ALT PHP: EA PHP: Plesk PHP DirectAdmin PHP Other panels PHP
  • alt-php54
  • alt-php55
  • alt-php56
  • alt-php70
  • alt-php71
  • alt-php72
  • alt-php73
  • alt-php74
  • ea-php54
  • ea-php55
  • ea-php56
  • ea-php70
  • ea-php71
  • ea-php72
  • ea-php73
  • ea-php74
  • php54
  • php55
  • php56
  • php70
  • php71
  • php72
  • php73
  • php74
  • php54
  • php55
  • php56
  • php70
  • php71
  • php72
  • php73
  • php74
  • 54
  • 55
  • 56
  • 70
  • 71
  • 72
  • 73
  • 74

Warning!

php-zts and custom PHPs, rolled in selector, are not supported

Functions that X-Ray client can hook

Database queries

  • Functions from the MySQL extension:
    • mysql_query
    • mysql_db_query
    • mysql_unbuffered_query
  • Functions from the MySQLi extension:
    • mysqli_query
    • mysqli::query
    • mysqli_multi_query
    • mysqli::multi_query
    • mysqli_real_query
    • mysqli::real_query
  • Functions from the PDO extension:
    • PDO::exec
    • PDO::query
    • PDOStatement::execute

External requests

System PHP functions

It may be any PHP system function which can be related to a PHP engine or other PHP extension, for example fopen() or json_encode(). A list of these functions can be found here.

Configuration Options

xray.enabled

Syntax: xray.enabled=On/Off

Default: On

Changeable: PHP_INI_SYSTEM

Description: Enable or disable X-Ray extension from php.ini


xray.database_queries

Syntax: xray.database_queries=[number]

Default: 20

Changeable: PHP_INI_SYSTEM

Description: The number of the slowest SQL queries which will be sent to the X-Ray agent. The min value is 0 and the max value is 100. If the variable value is more, the default value will be used.


xray.external_requests

Syntax: xray.external_requests=[number]

Default: 20

Changeable: PHP_INI_SYSTEM

Description: The number of the slowest external requests (the curl_exec function) which will be sent to the X-Ray agent. The min value is 0 and the max value is 100. If the variable value is more, the default value will be used.


xray.system_functions

Syntax: xray.system_functions=[number]

Default: 20

Changeable: PHP_INI_SYSTEM

Description: The number of the slowest system functions which will be sent to the X-Ray agent. The min value is 0 and the max value is 100. If the variable value is more, the default value will be used.


xray.backtrace_depth

Syntax: xray.backtrace_depth=[number]

Default: 10

Changeable: PHP_INI_SYSTEM

Description: The backtrace depth to the main() function which will be sent to the X-Ray agent. The min value is 0 and the max value is 20. If the variable value is more, the default value will be used.


xray.processor

Syntax: xray.processor=[processor_name]

Default: xray

Changeable: PHP_INI_SYSTEM

Description: Tells the X-Ray client which processor to use. The new processors may be added in the future. The default processor is xray which means to send data to the X-Ray agent.


xray.tasks

Syntax: xray.tasks=host:uri:ip:id

Default: no value

Changeable: PHP_INI_SYSTEM

Description: The current tracing tasks for the given PHP request. This directive is added automatically by the X-Ray manager when creating a task. It is not allowed to edit manually, as X-Ray may stop working.


xray.to_file

Syntax: xray.to_file=On/Off

Default: Off

Changeable: PHP_INI_SYSTEM

Description: Only for debug purposes. Writes to a file data which is sent to the processor.


xray.debug

Syntax: xray.debug=On/Off

Default: Off

Changeable: PHP_INI_SYSTEM

Description: Only for debug purposes. Enables debug output during request processing. In the On mode can slow down the domain.


xray.debug_file

Syntax: xray.debug_file=[path_to_file]

Default: /tmp/xray-debug.log

Changeable: PHP_INI_SYSTEM

Description: Only for debug purposes. Specifies a file for logging debug information.

X-Ray agent

This is a service that receives data from the X-Ray client and sends it to the remote storage.

Managing X-Ray service

The X-Ray agent is managed by the service utility.

  • To start the X-Ray agent, run the following command:

    # service xray-agent start
    
  • To stop the X-Ray agent, run the following command:

    # service xray-agent stop
    
  • To restart the X-Ray agent, run the following command:

    # service xray-agent restart
    

FAQ

Does X-Ray affect website performance?

X-Ray affects website performance. Our tests show 5-10 % overhead from a website loading time with X-Ray tracing enabled. X-Ray allows you to find website performance issues and should not be enabled permanently. If your website is very slow, you can enable X-Ray to find the cause and then disable it.

What should I do if I see the warning "Task is duplicated by URL"?

This warning means that you already have a task to trace this URL in the list of your tracing tasks. If you see this warning, a new task can be created only with the On hold status and you will be able to run it only when the previous task with the same URL will be completed.

Note that the URL field supports wildcard matching and you can have a case when X-Ray is tracing the URL=domain.com/* and you are trying to create a new task with URL=domain.com/xray.php. In this case, you will see that warning because the * URLs array includes xray.php.

I started a tracing task and made requests to URL but did not see any results in the UI. What should I do?

  1. X-Ray may not send data if a site uses a caching plugin, as the caching plugin is outputting HTML, thus there are no PHP scripts to examine. We encountered such issues with sites that use LSCache and WP Super Cache plugins. Check that your site does not use caching plugins. If so, disable it while tracing a site to get information from X-Ray. Moreover, it can also be because of caching on server side, for example NGINX Cache. Or when using CDN because requests are processed from another host. In such cases, during tracing, caching must also be disabled.

  2. If you set a client’s IP when creating the tracing task, check that your requests come to the server with this IP via phpinfo (since there may be NAT between your local machine and the server).

  3. Check that xray extension is enabled for the domain. To do so, go to the phpinfo() page and make a request. In the phpinfo output try to find the following section:

If you cannot see that section, try to restart PHP processes for that user (the simplest way is to restart Apache) and check that you can see the xray extension.

  1. If you can see the xray extension in the phpinfo, check that X-Ray agent service is running with the service xray-agent status command. If it is not running, start it with the service xray-agent start command.

  2. If, after checking the previous items, the issue persists, contact our support team.

What to do if X-Ray is not found in the phpinfo() page?

If you managed to create a tracing task, this means that the xray.ini file was created in a system. Therefore, there may be two reasons why it did not appear in the phpinfo page of the domain.

  1. PHP process wasn't reloaded after adding the xray.ini. To solve this, you should restart the Apache or fpm service for the domain on which the tracing was started. At the moment, this is done automatically by the X-Ray manager after creating the task.

  2. Your domain uses a PHP version different from the one which was detected by the X-Ray manager. To solve this, check the scan dir for additional ini files for your domain.

    Then check the ini_location that was passed to the X-Ray manager by running the following command:

    # cat /usr/share/alt-php-xray/manager.log | grep ini_location
    

    Find your tracing task in the output and check that the xray.ini exists in this directory, also check that the ini path is the same in the phpinfo page output and in the ini_location directive for your tracing task. If they are the same, you should reload your PHP. If they are different that means that the X-Ray manager could not correctly determine the PHP version your domain uses. In this case, contact our support team at https://cloudlinux.zendesk.com/hc/requests/new.

I use LiteSpeed, X-Ray is enabled and it is shown in the phpinfo() page but does not collect data when sending requests to a site. What to do?

Check for the CacheLookup on option in the htaccess file for your domain. If the option is there, LiteSpeed processes requests bypassing the PHP X-Ray extension. In this case, to get tracing information, you should remove the CacheLookup on option.

What is the proper format for the URL?

All of the examples below are correct:

  • http://domain.com
  • http://domain.com/
  • https://domain.com
  • https://domain.com/

You can use any of them with a prefix www. and it is also correct.

What packages are required for X-Ray?

Required packages:

  • lvemanager >= 6.2.10-1
  • alt-php-xray >= 0.2-1

Centralized Monitoring

Description

Centralized Monitoring is a tool that allows hosting administrators to monitor load for all their servers and users.

Centralized Monitoring allows you to:

  • View system metrics for all clients’ end servers
  • View the LVE statistics per user for all clients’ end servers

Installation

Note

Make sure that cm.cloudlinux.com is available on your end server.

  1. Make sure you have a CloudLinux OS Shared Pro subscription.
  2. Make sure you have installed the lve-utils package version 4.2.21-2 or later. You can install or update it with the following commands:
    • installation
    yum install lve-utils
    
    • update
    yum update lve-utils
    
  3. Log in to the https://cm.cloudlinux.com/ using CLN credentials (if you are already logged in via CLN, authorization via CM is not necessary, it uses SSO).
  4. Activate statistics collection on all your servers via the Centralized Monitoring UI (https://cm.cloudlinux.com) or via the CLN UI https://cln.cloudlinux.com/console/cloudlinux/centralized-monitoring.
  5. Within 5 hours from the activation, statistics collection and sending to the central server will be set up automatically: all required packages and components will be installed. For new, just registered servers, statistics collection and sending will be set up automatically within 5 hours.
  6. Make sure you have activated statistics collection (see paragraph 4) otherwise you will not be able to set up your servers. For instant set up of a registered server after statistics collection was enabled, run the following commands for all servers:
    # rhn_check	
    # /usr/share/cloudlinux/cl_plus/manage_clplus enable
    
    Note: If the rhn_check command is not found, run the following command:
    # yum install/update rhn-check rhn-setup
    
  7. After 5 hours (or after the manual setup), check that statistics for all registered servers is collected via https://cm.cloudlinux.com/#/servers. And check that user statistics on the servers is collected via https://cm.cloudlinux.com/#/users.

    Note

    User statistics will be available only for users that were loaded starting from connecting the server to the Centralized Monitoring.

Centralized Monitoring: mode without session expired

Users can monitor server’s or user’s load for a long time using the mode without session expired.

To turn on the mode without session expired, follow the next steps:

  1. Log in to the cln.cloudlinux.com via your account

  2. Open the cm.cloudlinux.com in a new browser tab/window (please, use the same browser as in step 1)

  3. Use the toggle to turn on/off 10 min auto logout

Your session in the cln.cloudlinux.com will expire in 10 min. But your session in the cm.cloudlinux.com will not expire while your browser tab remains open.

Centralized Monitoring user interface

You can access Centralized Monitoring in your CLN account. Click C-Monitoring in the left menu.

Servers

This page contains the list of all clients’ end servers. The server appears in the list after finishing Installation. By default, there is a descending sort by CPU usage.

The following values are available for each server:

  • Load Avg 15m – average system load for the last 15 min
  • CPU Usage – CPU usage for the last 15 min (the number of cores can be found in the hint)
  • Memory Usage – free available memory, the second value is the total memory for the last 15 min
  • IO read/write – disk read bytes/disk written bytes for the last 15 min

Note

The values are calculated using a 15 min time period but the metric state is updated automatically every minute by default or you can choose from one of the predefined periods.

  • Idle state – there were no statistics for the server for the last minute.
  • N/A state – there were no statistics for the server for the last 30 days. This can happen if a new server was added but statistics sending was not configured.

There is no pagination on the All servers page and all columns can be sorted by absolute value. Use the search tool to operate with the data.

Servers details

To get the detailed statistics for the server via charts, click a desired server line in the table. All charts are auto-refreshed and there is an ability to select the period for metrics data to be updated for the chart.

Note

We store the metrics data for one month only.

Charts for server metrics

Disk space usage

Open file descriptor/Context switches

System load 1m , 5m, 15m

CPU usage (total, system, user, iowait, steal)

Network traffic usage

Disk space usage

Memory usage (total, used, available)

Time spent doing I/Os

Disk IOps Completed

Disk read/write data

Disk read/write time

Apache connections (number)/Number of requests per minute/Max connections

Note

In the current version, we collect these metrics for the cPanel end servers only. We are planning to add other panels support soon.

Note

In the current version, we collect these metrics only for Apache (NOT for LiteSpeed, Nginx, etc.). The charts will be empty for LiteSpeed, Nginx, etc..

MySQL queries

The most loaded server users for the last minute

We calculate the user’s load by LVE statistics that we collect on the end server. The idle state for the user means that the LVE statistics were not collected for the last minute for some reason.

In each cell there are current usage/limit values for the basic LVE limits:

  • CPU Usage
  • Entry Processes
  • Physical Memory Usage
  • IOPS
  • IO Usage
  • Number of Processes
  • MySQL CPU
  • MySQL IO

In the hint, there is a number of faults for each limit. The values in the columns are underlined (it is red if load-to-limit ratio >=90% and it is yellow if load-to-limit ratio >= 50%). For the current implementation, the only sort by the load-to-limit ratio is available. By default, there is a descending sort by the CPU usage column.

When sorting by a column, the lines with the load-to-limit ratio >=90% for this column will have the red background color, and lines with the load-to-limit ratio >=50% for this column will have the yellow background color.

Note

The users with unlimited resources (∞) will be at the bottom of the table.

Users

This page contains all users for the all server of the client and their LVE statistics for the last minute. You can select the number of users on this page and search by user’s data.

The description of this page is the same as The most loaded server users for the last minute of the top 5 loaded users.

User’s metrics data can be sorted by the load-to-limit ratio and by the absolute value.

The absolute value is used to analyse the load produced by unlimited users.

The value of the load-to-limit ratio is convenient to use in the analysis of how many resources the users consume and whether they need to change the limits.

The values like this means that the resource is unlimited and 500.2 MB is the current usage of it.

Metrics data of Idle users is not used in the sorting, so such users always will be at the end of the list. The sorting can be done for only one metric.

Charts for Users metrics

Note

We store the metrics data for one month only.

On the user details page, the admin can find the charts for all LVE limits.

Alert Manager

Alert Manager allows you to create a server or user alert for selected metrics and email the triggered events.

Alert Manager page

The Alert Manager page contains a table with the following:

  • Alert name - a unique alert name
  • Tracking metric - a name of a server/user metric which will trigger the alert notification
  • # of servers - number of servers on which the metric will be tracked
    • click to view a list of servers host names
  • # of users - number of users for which the metric will be tracked
    • click to view a list of users names
  • Value - a condition for the alert rule which will be applied to the tracking metrics
  • Email - email to send the triggered events notifications
  • Type - a type of the alert rule
  • # of triggered events - the number of events from the time, when alert rule was created
    • the event is still firing
  • Time of the last trigger - the time of last triggered event, it is the time in your browser time zone
  • Actions - click to edit and to delete the alert rule

Color Codes

  • Red color means that the event with the condition "more than" is still firing.
  • Green color means that the event with the condition "less than" is still firing.

Creating an alert

To create a new alert, click the Create alert button.

Next, fill out the opened popup.

  • Name of alert - a unique alert name
  • Alert type - an admin can create a user or a server alert. What is the difference between them?
  • Select user/server - admin will see such dropdown depending on a case of alert creating
  • Notify me - the condition of the alert trigger
  • Duration - how much time the condition should be actual to trigger the notification
  • Notify me on email - the email to send notifications

Editing an alert

An admin can edit any field in the Alert except the Alert type.

Difference between the server alert and the user alert

The server alert is used to track the state of the whole server, it does not track user state on the server. The server alert tracks the next list of metrics:

  1. Context switches
  2. System load (1m)
  3. System load (5m)
  4. System load (15m)
  5. CPU Basic (total)
  6. CPU Basic (system)
  7. CPU Basic (user)
  8. CPU Basic (iowait)
  9. CPU Basic (steal)
  10. Network Traffic Basic (eht0_receive)
  11. Network Traffic Basic (eht0_transmit)
  12. Network Traffic Basic (ehtN_receive)
  13. Network Traffic Basic (ehtN_transmit)
  14. Disk Space Used Basic (mountpoint: <0>)
  15. Disk Space Used Basic (mountpoint: <1>)
  16. Disk Space Used Basic (mountpoint: <N>)
  17. Memory Basic (available)
  18. Memory Basic (used)
  19. Time spent Doing I/Os
  20. Disk IOps Writes Completed
  21. Disk IOps Reads Completed
  22. Disk Read Data
  23. Disk Write Data
  24. Disk Read Time
  25. Disk Write Time
  26. Apache connections
  27. Number of requests per minute
  28. MySQL queries
  29. Hardware Temperature (chip<0>)
  30. Hardware Temperature (sensor<0>)
  31. Hardware Temperature (chip<N>)
  32. Hardware Temperature (sensor<N>)
  33. Open File Description

During creating a server alert an admin should select the type of metrics as the first step. The list of servers will be collected according to the availability of these metrics on the server.

For example, for now, we do not collect Apache metrics for non-cPanel servers, so you will get only cPanel servers as a list of servers for these metrics.

We're planning to implement support for other panels/web servers in the next releases.

Small limitation

We collect the server list according to having their statistics in our database (this behavior will be changed in the next releases).

For example, if server state is N/A or idle more than 24 hours, it will not be visible in the list for the alert.

The user alert tracks the next list of LVE metrics:

  1. CPU Usage (current usage)
  2. CPU Usage (faults)
  3. Entry Processes (current usage)
  4. Entry Processes (faults)
  5. Physical Memory Usage (current usage)
  6. Physical Memory Usage (faults)
  7. IOPS (current usage)
  8. IOPS (faults)
  9. IO Usage (current usage)
  10. IO Usage (faults)
  11. Number of Processes (current usage)
  12. Number of Processes (faults)
  13. MySQL CPU (current usage)
  14. MySQL CPU (faults)
  15. MySQL IO (current usage)

Small limitation

We collect the server list according to having their statistics in our database (this behavior will be changed in the next releases).

For example, if the user state is N/A or idle more than 24 hours, it will not be visible in the list for the alert.

Cases of alert creating

  • Creating a server alert for the selected metrics for one server
  • Creating a server alert for the selected metrics for all servers (the default value)

In this two cases, you will not see the dropdown for selecting users because the metrics will track the server state.

  • Creating a user alert for one user, so admin can select a server and a user.
  • Creating a user alert for all users on several servers/all servers (in this case admin can't select users - all users will be selected automatically)

What is the Firing state of the alert?

This is the state of an alert that has been active for longer than the configured threshold duration.

Alert notifications

  • Alert name - the link to the alert page
  • Firing target - the link to the server details page

FAQ

How can I disable collecting and sending statistics on a client’s server?

Run this command:

/usr/share/cloudlinux/cl_plus/manage_clplus disable

Where can I view all my servers load?

You can find all your servers load in your CM personal account here: https://cm.cloudlinux.com/#/servers or in your CLN personal account here: https://cln.cloudlinux.com/console/cloudlinux/centralized-monitoring.

Where can I view all my users load?

You can find all your users load in your CM personal account here: https://cm.cloudlinux.com/#/users or in your CLN personal account here: https://cln.cloudlinux.com/console/cloudlinux/centralized-monitoring

Where can I view a server load details for a period?

Click the desired server in the server list in the UI.

Where can I view a user load details for the period?

Click the desired user in the user list in the UI.

How long are statistics stored in the central database?

30 days.

How can I change the charts period on the details page?

Choose the desired period in the upper right corner or select it directly on the chart.

I don’t understand how to read the user load chart.

The user load chart contains three lines:

  • limit
  • current load
  • count of faults

Limit and current load are drawing regarding the left vertical axis, the count of faults is drawing regarding the right vertical axis. You can focus on a particular line by clicking a required legend.

Troubleshooting

I can't see a server statistics

  1. Check that your server is registered by key or by IP license of the CloudLinux+ account, i.e., it should be seen in the list of servers in your CLN account here: https://cln.cloudlinux.com/console/auth/login
  2. Check that the following required packages are installed on the end server:
  • cl-end-server-tools >= 1.0.7-1
  • cl-node-exporter >= 1.1.0-2
  • rhn-client-tools
    • CloudLinux OS Shared 6 >= 1.1.15-3.el6.cloudlinux.26
    • CloudLinux OS Shared 7 >= 2.0.2-31.el7.clouldinux
    • CloudLinux OS Shared 8 >= 2.8.16-14.module_el8.1.0+6074+9dc6073e.cloudlinux.2
  • lve-stats >= 3.0.7-2
  • lve-utils >= 4.2.21-2
  • alt-python27-cllib >= 2.1.13-1
  • lvemanager >= 6.2.10-1
  1. Check that service collecting and sending statistics is running:
service cl_plus_sender status
  1. Check that log of the cl_plus_sender service doesn't contain errors:
/var/log/clplus_sender.log

Where can I view the events log on the client's server?

You can view the events log on the client's server here:

/var/log/clplus_sender.log

Can I get monitoring metrics from LiteSpeed, Nginx or other (Not Apache) web server?

Starting from end-server-tools-1.0.7, it supports collecting and sending statistics from the Apache and LiteSpeed web servers.

LiteSpeed is supported on cPanel and DirectAdmin control panels.

Each minute the statistics collection daemon checks which web server is started. If LiteSpeed is started, the daemon will collect data from it, otherwise, it checks if Apache is started.

When the daemon detects that the server is changed, it writes the following line into the statistics collection daemon log /var/log/clplus_sender.log:

2020-10-09 17:25:31,462: (CL+_sender_daemon) [INFO] Apache/Litespeed collector: Using Apache

or

2020-10-09 18:13:03,897: (CL+_sender_daemon) [INFO] Apache/Litespeed collector: Using Litespeed

If the daemon can't detect either Apache or LiteSpeed, it writes to the log the following:

2020-10-09 17:33:38,399: (CL+_sender_daemon) [INFO] Apache/Litespeed collector: Apache or Litespeed stopped or absent, collector will not work

The statistics collection daemon reacts to the server changing automatically, no need to restart it.

Warning

Please note that the daemon checks the server type once in a minute, so the data sent on a minute of switching can be unreliable.

Logging data sent to pushgateway to the statistics collection daemon log

Starting from cl-end-server-tools v.1.0.6-1, the statistics collection daemon allows to log data sent to pushgateway to its log /var/log/clplus_sender.log.

To start logging, run the following command:

touch /var/lve/cmt_debug_logging

To stop logging, run the following command:

rm -f /var/lve/cmt_debug_logging

You don't need to restart the daemon after starting/stopping logging. The presence of a control file is evaluated "on the fly".

Warning

Use this logging with caution because when it is enabled, the size of the daemon log /var/log/clplus_sender.log will increase each minute minimum on 3-4 KB. The actual increase size depends on the number of active users' processes on a server.

Known issues

  • MySQL Governor statistics in some cases is collected incorrectly
  • Sorting by MySQL Governor statistics ignores idle users
  • Sorting from the search result set does not work
  • Sorting by ratio for unlimited users works incorrectly

WP Optimization Suite

In the current beta release the Object Cache Module is available for the WordPress optimization suite.

An administrator has CloudLinux Manager -> WP Optimization Suite tab to manage modules that will be available for enabling on websites.

Warning!

  • This is a beta release. By default WP Optimization suite is disabled in the current release. See How to enable WP Optimization suite.
  • Please turn on the Object Cache module if you are sure! Turning it ON can really increase performance, but in a limited scope of cases!
  • All operations which destroy LVE will clean the Object Cache! Such operations include operations with CageFS, but do not include operations with setting LVE limits.

How to enable WP Optimization suite

To enable WP Optimization suite, please do via SSH:

touch /var/lve/enable-wpos.flag

Requirements

  • CloudLinux OS Shared Pro (6,7,8)
  • cPanel
  • WordPress version 3.7 and higher
  • Required any (ea-, alt-) php 5.6+ version with loaded redis extension
  • PHP handlers: php-fpm or php-lsapi (Apache)
  • Apache only (LiteSpeed is not supported yet, coming soon)

How to install WP Optimization Suite

Starting from lve-utils-6.2.1-3 and lvemanager-7.5.6-1 packages, WP Optimization Suit is available for CloudLinux OS Shared Pro

To install, run the following command:

yum install lvemanager lve-utils --enablerepo=cloudlinux-updates-testing

To update, run the following command:

yum update lvemanager lve-utils --enablerepo=cloudlinux-updates-testing 

Administrator interface

Go to the CloudLinux Manager -> WP Optimization Suite

The “Users” tab consists of the following:

  • an information panel about WordPress websites on the server (total amount across all existing users) and the number of users allowed using object the Cache Module
  • a list of current server users to Allow\Deny using the Object Cache Module for particular use

Just added users will appear in the list during 10 min after adding. If you want to get an actual list of users, use the Rescan button.

The Allow option will make all necessary changes to configuration so the end-user can start working with the WP Optimization suite successfully. To make WP Optimization suite icon visible in the user’s UI, please open the Settings tab and turn ON Show WPOS plugin icon to the end-users.

Warning!

End-users should enable the module in their interface for the particular website.

The Deny option (means “suspend feature usage”) will make all necessary changes to configuration so all enabled WP caching plugins will be turned off.

Warning!

All users custom configurations will be saved, so they can be used in case the admin allows working with the module.

Rescanning users websites helps to get the actual information about the amount of WordPress websites for each particular user.

Filters

  • Users with WordPress sites only will show the list of users which already have WordPress sites
  • Users with Object Cache enabled only will show the list of users with the Object Cache Module allowed by the admin (it is not a website with configured Object Cache Module by user)

In the second tab you can turn ON/OFF the visualization of the WP Optimization Suit icon in the end-user interface.

WP Optimization suite log files

The WP Optimization suite log files are located in:

  • /var/log/clwpos/main.log
  • /var/log/clwpos/daemon.log

Troubleshooting

Configuring Redis extension for installed php versions

Enabling the Object Cache module for a specific WordPress website requires a presence and loaded Redis extension for the PHP version chosen for the website. The Redis extension is configured for all installed and supported ea-php and alt-php versions automatically, right after system administrator allows WP Optimization suite for at least one end-user.

Users will not be able to turn on the Object Cache module until Redis extension configuration is not completed. Corresponding incompatibility warning will be displayed in user`s plugin:

To ensure PHP extension is configured correctly, do the following.

For ea-php

Check Redis extension package is installed by running the following command:

rpm -q ea-phpXY-php-redis

Example:

rpm -q ea-php74-php-redis

Check Redis ini is present by running the following command:

ls /opt/cpanel/ea-phpXY/root/etc/php.d/ | grep 50-redis

Make sure Redis module is loaded under user by running the following command:

su -c "php -m | grep redis" <username>

Automatic Redis configurations for ea-php is triggered by cron once a day: /etc/cron.d/clwpos_redis_extension_installer.

You can run utility for Redis configuration manually:

/usr/sbin/enable_redis_for_ea_php

All errors must be present in stdout or in the main log: /var/log/clwpos/main.log.

For alt-php

Redis will be configured for a specific alt-php version automatically, only if redis.so is present on the server.

ls /opt/alt/phpXY/usr/lib64/php/modules | grep redis.so

If the Redis module is present for php, but end-user is still facing incompatibility issue, re-check the following:

  • make sure the Redis module is loaded under user:

    su -c "php -m | grep redis" <username>
    
  • check required extensions are enabled in php.ini:

    cat /opt/alt/phpXY/etc/php.ini | grep redis.so
    cat /opt/alt/phpXY/etc/php.ini | grep json.so
    cat /opt/alt/phpXY/etc/php.ini | grep igbinary.so
    

If the Redis module is not present, it is needed to install the alt-phpXY-pecl-ext package manually and run the Redis configuration script: /usr/share/cloudlinux/wpos/enable_redis_for_alt_php.py.

All errors must be present in stdout or in main log: /var/log/clwpos/main.log.

Allowing module for end-users

Object Cache module is allowed:

But the plugin is still unavailable for end-user:

There could be several reasons.

  1. Ensure object cache is really allowed in configs:

    id - u <username> # user uid
    cat /var/clwpos/uids/<uid>/modules_allowed.json
    

    Check config as user:

    su -c "cat /var/clwpos/uids/<uid>/modules_allowed.json" <username>
    

    If module is enabled, the file must contain the following:

    {"version": "1","modules": {"object_cache": true}}
    

    If file is not accessible under user and user is in CageFS, try to re-check CageFS mount points:

    cat /etc/cagefs/cagefs.mp | grep var/clwpos/uids
    */var/clwpos/uids
    

    If there is no such mount point, try to fix it manually:

    echo '*/var/clwpos/uids' >> /etc/cagefs/cagefs.mp && cagefsctl --remount-all
    
  2. Error happened during clwpos-user get command execution:

    Run manually the clwpos-user get command under corresponding user and check logs:

    su -c “clwpos-user get” <username>
    cat /home/<username>/.clwpos/main.log
    

Also, right after allowing module for user, ensure the WPOS icon displaying is turned on as well:

It allows to show WP Optimization suite for all users:

Check the hideWPOSApp setting is set to false

 cloudlinux-config get --json
…..
 "hideWPOSApp": false
…..

Setting is stored in the /usr/share/l.v.e-manager/lvemanager-config.json.

Websites report in the Users tab

The main Users tab shows all control panel users information.

This report is updated automatically by cron: /etc/cron.d/clwpos_req_cron.

The actual report is stored here: /var/clwpos/admin/scan_cache.json.

If the last scan time is too old (more than 1-2 days), check the logs: /var/log/clwpos/main.log and /var/log/messages.

General PHP issues

Both administrator and end-user may face some common PHP errors that are not related to WP Optimization suite. They could be caused by broken PHP binaries, missed PHP files, etc and may affect WP Optimization suite.

For example, the error with loading library:

/opt/cpanel/ea-php70/root/usr/bin/php: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory

To check that this issue is caused by PHP, call any PHP command, e.g:

/opt/cpanel/ea-php70/root/usr/bin/php -i

And make sure that installed ea-php70 packages are not broken via rpm -V <package_name>. Reinstall broken packages if found.

Monitoring user's Redises

Redis process is started for each user after Object Cache has been enabled for at least one WordPress website. Also it is killed after object cache has been disabled for all sites. Look through the processes list to check Redis status for user:

 ps aux | grep redis
username     107845  0.1  0.1 216712  4708 ?        Sl   07:15   0:00 /opt/alt/redis/bin/redis-server unixsocket:/home/<username>/.clwpos/redis.sock

Additionally, there is the daemon to manage user`s Redises: clwpos_monitoring. It checks Redises each 5 minutes, starts or kills the “garbage” Redises if needed.

Try to look at service status: service clwpos_monitoring status and main daemon log: /var/log/clwpos/daemon.log.

Uninstalling

To uninstall WP Optimization suite, please execute the following command:

/usr/bin/clwpos-erase

Execute this command before both: complete lve-utils package uninstallation and for downgrading the system to the version that does not support WP Optimization suite.

FAQ

With which panel can I use the CloudLinux Shared Pro WP Optimization suite?

In the current release only with cPanel. In the next releases it will be available for DirectAdmin.

How will it help my customers?

In the current version, the WP Optimization suite automatically configures the Object Cache module per website. In the next releases we will add modules to help automatically increase performance for the WordPress websites.

How to set up a php-fpm handler for the domain?

Since the php-fpm handler is required to use WP Optimization suite, you may need to configure it manually.

  1. Ensure the php-fpm package for the current PHP version is installed or install it.

    • manual installation:
    yum -y install ea-phpXY-php-fpm
    

    XY - is you PHP version, for instance ea-php74-php-fpm

    • via MultiPHP Manager:

  2. Enable php-fpm handler for domain via MultiPHP Manager:

How to install php-lsapi for the domain?

Please use the documentation.