{"id":47211,"date":"2022-05-17T16:37:58","date_gmt":"2022-05-17T13:37:58","guid":{"rendered":"https:\/\/tuthost.ua\/faq\/how-to-use-php-x-ray\/"},"modified":"2024-07-19T21:55:27","modified_gmt":"2024-07-19T18:55:27","slug":"php-x-ray","status":"publish","type":"ht_kb","link":"https:\/\/tuthost.ua\/en\/faq\/php-x-ray\/","title":{"rendered":"How to use PHP X-Ray"},"content":{"rendered":"\n<p><strong>X-Ray<\/strong> is a tool designed to monitor website performance and detect performance issues.<\/p>\n\n<p><strong>X-Ray<\/strong> can collect and display information about slow scripts, external queries and website database queries.<\/p>\n\n<p>To switch to X-Ray, log in to the DirectAdmin hosting control panel and click the X-Ray tab.<\/p>\n\n<p><strong>X-Ray<\/strong> provides a manual option for monitoring requests to the site:<\/p>\n\n<p>A manual trace task is a task that can be created for a specific URL to collect queries. The task will finish either after the specified number of requests to the URL, or after a specified amount of time (two days at most).<\/p>\n\n<p>It is also possible to export the report in PDF format.<\/p>\n\n<p>The Trace Tasks tab contains a list of all tracing tasks created manually.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-1024x456.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"456\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-1024x456.png\" alt=\"\" class=\"wp-image-47178\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-1024x456.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-300x134.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-150x67.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-768x342.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-125x56.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-75x33.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2-1536x684.png 1536w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image2.png 1815w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>Managing the trace task<\/strong><\/p>\n\n<ol class=\"wp-block-list\"><li>Click the Start tracing button to create a new task.<\/li><li>In the pop-up window that opens, specify the URL of the website to track.<\/li><li>Press the Run button.<\/li><li>Traceroute will work in default mode, tracing the first 20 requests to the specified URL.<\/li><\/ol>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11.png\"><img loading=\"lazy\" decoding=\"async\" width=\"432\" height=\"472\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11.png\" alt=\"\" class=\"wp-image-47181\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11.png 432w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11-275x300.png 275w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11-137x150.png 137w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11-114x125.png 114w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image11-69x75.png 69w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/a><\/figure>\n<p><strong>Default settings:<\/strong><\/p>\n\n<p>The URL must be a valid URL for the domain that exists on the current server.  <\/p>\n\n<p>Advanced settings allow you to set the IP address and tracking parameters: by time or by number of requests.<\/p>\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"374\" height=\"512\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9.png\" alt=\"\" class=\"wp-image-47184\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9.png 374w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9-219x300.png 219w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9-110x150.png 110w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9-91x125.png 91w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image9-55x75.png 55w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/a><\/figure>\n<p><strong>Advanced settings:<\/strong><\/p>\n\n<ul class=\"wp-block-list\"><li>Client IP: This is the IPv4 address of the traceroute client.  <\/li><\/ul>\n<p>For example, if you have a working website that handles requests from different IP addresses and you don&#8217;t want to add those requests to the tracking task. Thus, you can specify a specific IP address and X-Ray will analyze requests only from that specific IP address.  <\/p>\n\n<ul class=\"wp-block-list\"><li>Time period recording: how long X-Ray collects requests (maximum 2 days)  <\/li><li>Queries: the number of queries that X-Ray will collect.  <\/li><\/ul>\n<p>Once created, the task will appear in the task list.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-1024x147.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"147\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-1024x147.png\" alt=\"\" class=\"wp-image-47187\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-1024x147.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-300x43.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-150x22.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-768x111.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-125x18.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6-75x11.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image6.png 1132w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-1024x398.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"398\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-1024x398.png\" alt=\"\" class=\"wp-image-47190\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-1024x398.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-300x116.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-150x58.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-768x298.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-125x49.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3-75x29.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image3.png 1141w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>Task Statuses:<\/strong><\/p>\n\n<ul class=\"wp-block-list\"><li>Running &#8211; tracing is running.<\/li><li>Stopped &#8211; tracing is stopped manually.<\/li><li>On hold &#8211; this URL already exists in the list. Task processing will not start automatically. You have to run it manually.<\/li><li>Completed &#8211; the period of time completed or the number of requests reached.<\/li><\/ul>\n<p><strong>Collected information on the task:<\/strong><\/p>\n\n<p>Press the eye button to view the collected information.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-1024x443.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"443\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-1024x443.png\" alt=\"\" class=\"wp-image-47193\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-1024x443.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-300x130.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-150x65.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-768x332.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-125x54.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10-75x32.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image10.png 1140w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p>Slow requests will be highlighted.<\/p>\n\n<ul class=\"wp-block-list\"><li><strong>Total &#8211; <\/strong> shows how many queries were collected according to the task.<\/li><li><strong>Pending<\/strong> &#8211; shows how many of the collected queries are not yet displayed in the table.<\/li><li><strong>Throttled &#8211; <\/strong> displays the number of requests that exceeded LVE limits.<\/li><li><strong>Slow &#8211; <\/strong> displays the number of requests longer than one second.<\/li><\/ul>\n<p>If slow requests were not detected during the trace, the following is displayed. Here you can also see all the requests.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-1024x393.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"393\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-1024x393.png\" alt=\"\" class=\"wp-image-47196\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-1024x393.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-300x115.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-150x58.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-768x295.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-125x48.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4-75x29.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image4.png 1107w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p>X-Ray collects the following data for each query:<\/p>\n\n<ul class=\"wp-block-list\"><li><strong>Top issues<\/strong> &#8211; the slowest query items<\/li><li><strong>Software modules\/plugins<\/strong> &#8211; modules and plugins by runtime (only for WordPress)<\/li><li><strong>Database queries<\/strong> &#8211; database queries by execution time<\/li><li><strong>External requests<\/strong> &#8211; requests to external resources by execution time<\/li><li><strong>Other system<\/strong> functions &#8211; system functions by execution time<\/li><\/ul>\n<h4 class=\"wp-block-heading\">Software modules\/plugins &#8211; modules and plugins<\/h4>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-1024x169.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"169\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-1024x169.png\" alt=\"\" class=\"wp-image-47199\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-1024x169.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-300x49.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-150x25.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-768x127.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-125x21.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5-75x12.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image5.png 1122w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>Database queries &#8211; database queries<\/strong><\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-1024x440.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"440\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-1024x440.png\" alt=\"\" class=\"wp-image-47202\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-1024x440.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-300x129.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-150x64.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-768x330.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-125x54.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7-75x32.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image7.png 1107w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>External requests &#8211; external requests<\/strong><\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-1024x152.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"152\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-1024x152.png\" alt=\"\" class=\"wp-image-47205\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-1024x152.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-300x45.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-150x22.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-768x114.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-125x19.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8-75x11.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image8.png 1119w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>System functions &#8211; system functions<\/strong><\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-1024x409.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-1024x409.png\" alt=\"\" class=\"wp-image-47208\" title=\"\" srcset=\"https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-1024x409.png 1024w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-300x120.png 300w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-150x60.png 150w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-768x307.png 768w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-125x50.png 125w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1-75x30.png 75w, https:\/\/tuthost.ua\/wp-content\/uploads\/2022\/05\/image1.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p><strong>How can I use PHP X-ray to speed up my Wordpress site and find the cause of slowness?<\/strong><\/p>\n\n<ul class=\"wp-block-list\"><li>Specify the URL of the slow site.  <\/li><li>Visit a slow site and do something like leave a comment to make a POST request. This will allow PHP X-Ray to gather information about site performance.<\/li><li>Go back to the tracing task. You will see the slowest queries at the top of the list.<\/li><li>Take a look at the information page that shows performance problems. For example, if one of the WordPress plugins uses a lot of resources, you will see this in the table.<\/li><li>Disable the plugin through the WordPress admin interface.<\/li><li>Go to the site again and make a few more requests. The site should load faster than before. There should be no performance issues on the details page.<\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>X-Ray is a tool designed to monitor website performance and detect performance issues. X-Ray can collect and display information about slow scripts, external queries and website database queries. To switch to X-Ray, log in to the DirectAdmin hosting control panel and click the X-Ray tab. X-Ray provides a manual option for monitoring requests to the&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","ghostkit_customizer_options":"","ghostkit_custom_css":"","ghostkit_custom_js_head":"","ghostkit_custom_js_foot":"","ghostkit_typography":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"ht-kb-category":[10694,10669],"ht-kb-tag":[],"class_list":["post-47211","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-control-panel-directadmin","ht_kb_category-hosting-en"],"taxonomy_info":{"ht_kb_category":[{"value":10694,"label":"Control Panel - Directadmin"},{"value":10669,"label":"Hosting"}]},"featured_image_src_large":[],"author_info":{"display_name":"Denys Semeniuk","author_link":"https:\/\/tuthost.ua\/en\/author\/semden\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/47211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/comments?post=47211"}],"version-history":[{"count":2,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/47211\/revisions"}],"predecessor-version":[{"id":58407,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/47211\/revisions\/58407"}],"wp:attachment":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/media?parent=47211"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-category?post=47211"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=47211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}