X-Ray: PHP Performance Tracking
Updated last month
Dynamic websites built with content management systems experience bottlenecks somewhere along the way. WordPress, Drupal, Joomla, and Magento are classic examples of wonderful websites that are often slow. But we no longer have to investigate in depth to address the causes, because a new tool—part of CloudLinux OS Shared Pro—has come to solve them for us: PHP X-Ray.
A problem with a plugin, a slowdown in database queries, a conflict in a function, or an external call? X-Ray will reveal its source.
What is PHP X-Ray?
PHP X-Ray is a system that tracks what happens internally on a website (provided its server has CloudLinux OS Shared Pro). PHP X-Ray lets us analyze our website's resource usage and find the cause of high resource consumption.
PHP X-Ray was developed specifically to troubleshoot performance issues on PHP-based websites. Typical bottlenecks include:
Slow plugins
Slow database queries
Slow functions
Slow external calls
After starting a tracking session, we'll use our site as usual, giving PHP X-Ray enough scenarios to identify any problems. Once the site has been analyzed, we'll be able to view a report.
How do you use PHP X-Ray?
The first thing we need to do is go to the control panel for the site in question.
Typically, we'll enter cpanel.mysite.com, replacing mysite.com with our website's actual URL.
After logging in to cPanel, we'll look for the icon shown in the screenshot below in the "Software" app group.
The following screen will appear, where we simply need to click the green button.
Next, we'll select the domain from the drop-down menu.
Then we'll enter a "mask," which is a specific URL. To scan the entire site, simply enter an asterisk, as shown in the screenshot below.
Finally, click the RUN button.
After a brief loading animation, the page will refresh and we'll see something like this:
The seven columns show the following information: (1) The URL of the domain (and folder) being scanned. Since we entered an asterisk in the mask field, this will scan the entire site (unlike if we enter a folder, such as "blog"; in that case, only bottlenecks in that section will be checked). (2) The tracking status. (3) The client's IP address. (4) The number of samples collected so far (when the scan starts, this will logically be zero). (5) How long the scan takes to complete (30 days). (6) The date the bottleneck check was created. (7) Two buttons are shown. The eye icon lets us view problem reports on a separate screen, and the stop button lets us stop the check we created (after a confirmation message, in case we clicked it by mistake).
As problems are detected, they will appear in order, with the issue slowing down our site the most at the top.
For example, if an installed plugin is causing major slowdowns on our website, we can uninstall it and try another one that meets the same needs without putting our resources under strain.
Viewing reports from a completed scan
We can check what's happening at any time, as mentioned, by clicking the eye icon. We'll also use this same button once the tracking session is complete.
This will show us something like the screenshot below.
Of course, the steps we take to resolve the issues shown in the report will depend on the problem and on how familiar we are with our CMS, PHP, or how a server works. Generally, significant problems are caused by components, so we should test them (or simply uninstall something that isn't working properly, even if that brings the entire site down).
You can also watch a video about the procedure: