X-Ray: PHP performance tracking
Updated last month
Dynamic websites built with content management systems suffer from bottlenecks somewhere along the way. WordPress, Drupal, Joomla, and Magento are classic examples of wonderful, and often slow, websites. But we will no longer have to investigate extensively to resolve 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, slow 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 computer system for internally tracking what happens on a website, provided that its server has CloudLinux OS Shared Pro. PHP X-Ray allows us to analyze our website's resource usage and find the cause of high resource consumption.
PHP X-Ray was developed specifically to solve performance problems on PHP-based websites. Typical bottlenecks include:
Slow plugins
Slow database queries
Slow functions
Slow external calls
After starting a trace, we will visit our website normally, giving PHP X-Ray enough scenarios to identify the problems. Once the site has been analyzed, we will be able to view a report.
How is PHP X-Ray used?
The first thing we need to do is access the control panel for the website in question.
Typically, we will enter cpanel.mysite.com, replacing mysite.com with the actual URL of our website.
After logging in to cPanel, we will look for the icon shown in the screenshot below, within the "Software" app group.
The following screen will appear, where we only need to click the green button.
Next, we will select the domain from the drop-down menu.
Then we will enter a "mask," that is, a specific URL. If we want to scan the entire site, we only need to enter an asterisk, as shown in the screenshot below.
Finally, click the RUN button.
After a short loading animation, the page will refresh and we will see something similar to the following:
The seven columns show us the following information: (1) The URL of the domain and folder where the scan is running. Since we entered an asterisk in the mask section, this will result in an analysis of the entire site, unlike entering a folder, such as "blog"; in that case, only bottlenecks in that section will be checked. (2) The tracing status. (3) The client's IP address. (4) The number of samples collected during the elapsed time; when the scan begins, this will logically be zero. (5) The time it takes for the analysis to be completed—30 days. (6) The date when the bottleneck check was created. (7) Two buttons are shown. The eye icon lets us check problem reports on a separate screen, while the stop button lets us stop the check that was created, after a confirmation message in case we clicked it by mistake.
As problems are detected, they will appear ordered with the conflict that slows down our site the most at the top.
For example, if an installed plugin turns out to be the cause of our website's major slowdowns, we can uninstall it and try another one that meets the same needs without putting our resources at risk.
View reports from the completed analysis
At any time, we can see what is happening, as mentioned above, by clicking the eye icon. We will also use this same button once the trace is complete.
This way, we will see something similar to the screenshot below.
Of course, depending on the problem and on how familiar we are with our CMS, PHP, or how a server works, we will resolve the items shown in the report. Generally, significant problems are found in components, so we will need to perform tests in this regard—or simply uninstall something that is malfunctioning, bringing the entire site down.
In parallel, we can watch a video about the procedure: