sidebar hamburger menu

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.

Known limitations

X-Ray is not compatible with Opcahce JIT optimization. Once X-Ray tracing task is running for the site the Opcache JIT optimization will be disabled until tracing task completed.

Installation

Note

X-Ray Autotracing is installed and enabled by default on all new compatible servers.

  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.

X-Ray serverwide mode

With X-Ray v0.6-11 we introduced global X-Ray mode which enables tracing extension for all PHP versions on the servers. This mode allows your customers to override PHP versions in different folders and trace websites located in those folders.

In order to enable this mode, type the following command:

cloudlinux-xray-manager enable-serverwide-mode

In order to get back to default:

cloudlinux-xray-manager disable-serverwide-mode

Enable and disable commands do not stop or remove tracing tasks.

X-Ray phpinfo mode

With X-Ray v0.6-18 we introduced new X-Ray mode which gathers website php version using information from phpinfo. This mode allows your customers to override PHP versions

In order to use this mode, websites should be reachable through http or https.

In order to enable this mode, type the following command:

touch /opt/cloudlinux/flags/enabled-flags.d/xray-per-domain-php-version-mode.flag

In order to get back to default:

rm -f /opt/cloudlinux/flags/enabled-flags.d/xray-per-domain-php-version-mode.flag

How to manage X-Ray

X-Ray provides several options for monitoring domain requests speed: Manual Tracing task, X-Ray Autotracing and Continuous tracing.

  • Manual Tracing task is a task that you can create 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.

  • Autotracing task is a task that will be created automatically at the end of each day for slow URLs that were found during that day by the PHP Slow Site Analyzer (SSA). Need to be enabled separately, see How to enable X-Ray Autotracing.

  • Continuous tracing is a task that initiates 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:

X-Ray Autotracing

X-Ray Autotracing automatically creates tracing tasks for slow URLs that were found during a day by the PHP Slow Site Analyzer (SSA).

Warning

To use X-Ray Autotracing, update your alt-php-ssa and alt-php-xray packages to versions alt-php-ssa-0.2-1 and alt-php-xray-0.4-1 or higher by running the following command:

yum update alt-php-ssa alt-php-xray --enablerepo=cloudlinux-updates-testing

How to enable X-Ray Autotracing

To enable X-Ray Autotracing, run the following commands via SSH:

/usr/sbin/cloudlinux-ssa-manager enable-ssa
/usr/sbin/cloudlinux-autotracing enable --all

Check CLI documentation for a description of the /usr/sbin/cloudlinux-autotracing CLI utility.

Requirements

  • CloudLinux OS Shared Pro or CloudLinux OS Solo or CloudLinux OS Admin
  • alt-php-ssa > 0.2-1 version
  • alt-php-xray > 0.4-1 version
  • Enabled PHP SSA on the server

Autotracing Interface

A new tab for Autotracing tasks was added to the X-Ray UI:

Autotracing FAQ

Q: Why are the slow URLs in the Slow Site Analyzer report different from those on which the autotracing tasks were created?

A: Because the autotracing decision module uses rules and thresholds different from Slow Site Analyzer, which are configured by the CloudLinux team.

Q: How often autotracing tasks will be generated?

A: Once a day at the same time as a Slow Site Analyzer report.

X-Ray Smart Advice

Smart advice is a new feature of X-Ray that is designed to find and propose solutions to fix performance issues and speed up the performance of a sites.

Note

Smart Advice will work only for CloudLinux OS Shared Pro servers with cPanel Control Panel for now.

At the moment, Smart Advise is focused only on WordPress sites.

Warning

To use X-Ray Smart Advice, update your alt-php-ssa and alt-php-xray packages to versions alt-php-ssa-0.2-3 and alt-php-xray-0.5-1 or higher by running the following command:

yum update alt-php-ssa alt-php-xray lve-utils lvemanager --enablerepo=cloudlinux-updates-testing

How to enable X-Ray Smart Advice

Attention!

If you'd like to try Smart Advice and AccelerateWP you should participate in the Beta tester program. To become a beta tester, please send your request at our Beta program page with the signup form here. Once you submit the request, we will send you a confirmation email with program details and terms of use.

Requirements

  • CloudLinux OS Shared Pro or CloudLinux OS Solo
  • alt-php-xray > 0.5-1 version
  • lve-utils > 6.3.2-1 version
  • lvemanager > 7.6.1-1 version
  • cloudlinux-site-optimization-module > 0.1-1 version

We Recommend:

How X-Ray Smart Advice works

The main process of looking for advice is X-Ray tracing tasks. The best way for doing this is to enable X-Ray Autotracing. This will allow you to most effectively find Smart Advice for sites that have performance issues without your manual participation. You can find information on how to enable X-Ray Autotracing here. On the other hand, you can create tracing tasks manually or use continuous X-Ray but we suggest you use X-Ray Autotracing for this purpose.

Note

Advice will not be generated by old tracing tasks.

While the tracing task is running, X-Ray will look for places where advice can be applied. New advice will be displayed on the Smart Advice tab.

After the X-Ray finds advice you will see new advice in the Review status on the Smart Advice tab. Then you may use the Details button to see which URLs were found by X-Ray that will be speed up by that advice and use Quick Action to enable advice for a site.

Example of details:

After you apply the advice by using Quick Action, the status will change to the Applied.

If a long time has passed since the last time the advice was updated for a site, it will be moved to the Outdated status.

Note

New X-Ray task may update Outdated advice if X-Ray finds performance issues that may be fixed by that advice. Then the status of advice becomes Review.

If the process of applying advice fails you will see an error log with a detailed error, you may try to fix it manually and try again or contact our support team for help.

Example when an error appears during advice applying:

Smart Advice FAQ

Q: Why I can't see new advice on the Smart Advice tab?

A: For the generating of advice, it is necessary to run X-Ray tracing tasks, the best way to do it without manual interaction is to use X-Ray Autoracing. You can find more information on how to enable X-Ray Autotracing here.

Smart Advice CLI commands

CLI commands for managing feature advices

  • cl-smart-advice - for managing advices;

Starting from alt-php-xray-0.5-25 Smart Advice CLI utilities provide CLI versioning which is defined via --api-version option.

Note

It is highly recommended to specify CLI version explicitly via --api-version, otherwise CLI will rely on default settings, which cannot guarantee backward compatability.

cl-smart-advice --api-version <api_version> <command>

supported commands for --api-version=1:

  • list - shows list of all advices;
  • apply - applies specific advice;
  • rollback - rollbacks specific advice;

Advices list

--api-version=1

cl-smart-advice --api-version=<api_version> list

For each advice in the list the CLI command returns the following information:

  • metadata, which includes information about username, domain and website for which the advice is issued
  • advice information:
    • its identifier id (id, that should be used in apply and rollback commands)
    • its type (optimization feature identifier)
    • its status - current status: review or applied
    • module_name - name of optimization feature
    • is_premium - if advice is for optimization feature from AccelerateWP Premium suite
    • subscription - info about optimization suite subscription (only if advice requires subscription)
    • description and detailed_description - human-readable descriptions of advice
    • other internal informational fields
  • result - result of command: it may have success or error details

Successful output example of cl-smart-advice --api-version=1 list:

{
  "data": [
    {
      "created_at": "2023-04-11T07:33:48.191870+00:00",
      "updated_at": "2023-04-11T07:33:48.191870+00:00",
      "metadata": {
        "username": "user16",
        "domain": "user16.com",
        "website": "/wordpress"
      },
      "advice": {
        "id": 23484,
        "type": "OBJECT_CACHE",
        "status": "review",
        "description": "Turn on Object Caching",
        "is_premium": true,
        "module_name": "object_cache",
        "subscription": {
          "status": "no",
          "upgrade_url": null
        },
        "total_stages": 0,
        "completed_stages": 0,
        "detailed_description": "To improve site performance, enable the Object Caching We recommend applying the advice if you see it frequen
tly for the most valuable URLs of your site."
      }
    },
    {
      "created_at": "2023-04-11T07:33:48.297784+00:00",
      "updated_at": "2023-04-11T08:51:42.362117+00:00",
      "metadata": {
        "username": "user16",
        "domain": "user16.com",
        "website": "/wordpress"
      },
      "advice": {
        "id": 23485,
        "type": "SITE_OPTIMIZATION",
        "status": "applied",
        "description": "Turn on AccelerateWP feature",
        "is_premium": false,
        "module_name": "accelerate_wp",
        "total_stages": 0,
        "completed_stages": 0,
        "detailed_description": "To improve site performance, enable the AccelerateWP optimization feature. We recommend applying the advice if you see it frequently for the most valuable URLs of your site."
      }
    }
  ],
  "result": "success",
  "timestamp": 1681203110
}

Failed output example of cl-smart-advice --api-version=1 list:

{"result": "Malformed API response"}

Apply advice

--api-version=1

cl-smart-advice --api-version=<api_version> apply --advice_id=<id_of_advice> [ --accept_license_terms ] [ --ignore-errors ]

--accept_license_terms - accept license terms on applying CDN type advice; --ignore-errors - ignore WordPress site web-checks after enabling optimization features;

advice_id from cl-smart-advice --api-version=<api_version> list output

Successful output example of cl-smart-advice --api-version=1 apply --advice_id=12345:

{
    "feature": {
        "enabled": true
    },
    "result": "success",
    "timestamp": 1690806590.0494235
}
  • feature: status of optimization to be applied via advice
    • enabled: true or false value meaning feature is enabled or not
  • result: result of command: it may have success or error details

Failed output example of cl-smart-advice --api-version=1 apply --advice_id=12345:

{"result": "Malformed API response"}

Rollback advice

--api-version=1

cl-smart-advice --api-version=<api_version> rollback --advice_id=<id_of_advice>

advice_id from cl-smart-advice --api-version=<api_version> list output

Successful output example of cl-smart-advice --api-version=1 rollback --advice_id=12345:

{
    "feature": {
        "enabled": false,
        "visible": true
    },
    "result": "success",
    "timestamp": 1690806844.9735684
}

  • feature: status of optimization to be applied via advice
    • enabled: true or false value meaning feature is enabled or not
    • visible: true or false value meaning feature is visible or not
  • result: result of command: it may have success or error details

Failed output example of cl-smart-advice --api-version=1 rollback --advice_id=12345:

{"result": "Malformed API response"}

Advanced performance analytics

By enabling this feature, X-Ray will add JavaScript profiling code to each WordPress site during the tracing process. This will allow X-Ray to provide highly detailed insights into each website’s performance (greatly enhancing the quality and accuracy of SmartAdvice). The performance metrics that will be collected include TTFB (Time To First Byte), Total Blocking Time, First Contentful Paint, and more. The profiling code does not collect any user or visitor data nor sensitive data of any kind. The sole purpose of this profiling code is to gather performance-related metrics to better optimize the website.

How to enable/disable via UI

You can manage the setting in several interfaces:

X-Ray settings:

AccelerateWP settings:

How to enable/disable via CLI

cloudlinux-xray-manager advanced-metrics --enable
cloudlinux-xray-manager advanced-metrics --disable

How it works

To start advanced performance monitoring, you can enable tracing tasks that involve adding a JavaScript snippet to the bottom of your WordPress page. This snippet facilitates performance monitoring and allows X-Ray to gather valuable insights.

Once tracing tasks are enabled, the JavaScript snippet will periodically send POST requests to our secure analytics service.

These requests capture anonymous data about page load time and resources.

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 PHPDirectAdmin PHPOther panels PHP
  • alt-php54
  • alt-php55
  • alt-php56
  • alt-php70
  • alt-php71
  • alt-php72
  • alt-php73
  • alt-php74
  • alt-php80
  • alt-php81
  • alt-php82
  • alt-php83
  • ea-php54
  • ea-php55
  • ea-php56
  • ea-php70
  • ea-php71
  • ea-php72
  • ea-php73
  • ea-php74
  • ea-php80
  • ea-php81
  • ea-php82
  • php54
  • php55
  • php56
  • php70
  • php71
  • php72
  • php73
  • php74
  • php80
  • php81
  • php82
  • php83
  • php54
  • php55
  • php56
  • php70
  • php71
  • php72
  • php73
  • php74
  • php80
  • php81
  • php82
  • php83
  • 54
  • 55
  • 56
  • 70
  • 71
  • 72
  • 73
  • 74
  • 80
  • 81
  • 82
  • 83

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.

My customers override php versions in different folders and X-Ray does not trace those websites, what should I do?

You should turn on the X-Ray serverwide mode or the X-Ray phpinfo mode.

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