Scripts for checking webhosting speed

Started by ElizabethParker, Dec 07, 2022, 09:19 AM

Previous topic - Next topic

ElizabethParkerTopic starter

One of the modules provided by Bitrix allows for benchmarking hosting. This module indicates the number of operations taking place in the CPU, the speed at which the HDD operates, as well as MySQL performance in regards to reading, writing, and deleting data.

In addition, this module checks which PHP settings may need to be altered in order to optimize performance.

The question remains: Is there a script available that can be easily run on hosting?
  •  

friv10games

There are no individuals like that. However, there is a tool at https://code.google.com/p/byte-unixbench/ that can carry out tests on I/O, CPU, HDD, and more. Another tool is available at serverbear.com/about, but I haven't utilized it myself and cannot provide any feedback. In my view, the former two tools should suffice.

Various code snippets and scripts exist for different types of examinations. For example, if you're looking to test PHP performance, you can find some resources at http://www.phpbench.com/. You could also search for comparable tests that evaluate file system performance. You can compile a suitable benchmark using all these resources quickly and efficiently.

wget dl.getipaddr.net/speedtest.sh 2>/dev/null -O- | bash
  •  

pcoptimizer

Uptrend provides more than 35 geographical locations for testing site speed. The speed report delivered is made up of two sections: a breakdown of the download process and a group of domains. The Domain Groups section classifies resources according to various sources: proprietary, statistics, CDN, social, advertising. I'm seeking something analogous, but accessed through a browser.

Here we have a PHP script that measures the execution time of certain operations. It creates a table, writes to a file, and inserts some data into a database.

<?php

$iteration
='1000';

$drb="drop table test_table";

$crb="CREATE TABLE `test_table` (

  `id` int(10) unsigned NOT NULL auto_increment,

  `num` int(10) unsigned NOT NULL default '0',

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1"
;





function 
db_connect()

{

   
$result = @mysql_pconnect("localhost""username""password");

   if (!
$result)

      return 
false;

   if (!@
mysql_select_db("database"))

      return 
false;

   return 
$result;

}



function 
getmicrotime()

{

    list(
$usec$sec) = explode(" "microtime());

    return ((float)
$usec + (float)$sec);

}



$time_start getmicrotime();



for (
$i=0$i $iteration*1000$i++) {



}



$time_end getmicrotime();

$time $time_end $time_start;



echo 
"&#209;&#247;&#232;&#242;&#224;&#235; &#238;&#226;&#229;&#246; &#228;&#238; $iteration*1000: $time<br>";

$time_start getmicrotime();

$handle=fopen('text.txt',"w");

for (
$i=0$i $iteration*100$i++) {



fwrite($handle,$i);



}

fclose($handle);

$time_end getmicrotime();

$time $time_end $time_start;



echo 
"&#207;&#232;&#241;&#224;&#235; &#244;&#224;&#233;&#235;&#251;*100: $time<br>";



if (
db_connect())

{

     
mysql_query($drb);

       if (!
mysql_query($crb)) echo "&#237;&#229; &#241;&#238;&#231;&#228;&#224;&#229;&#242;&#241;&#255;<br>";

    
$time_start getmicrotime();

    for(
$i=0$i<$iteration$i++)

    {

        
$var=rand(100000,999999);

        
$ibq="insert into test_table values (NULL,".$var.")";

        
mysql_query($ibq);

    }

    
$time_end getmicrotime();

    
$time $time_end $time_start;



    echo 
"&#202;&#238;&#226;&#251;&#240;&#255;&#235; &#225;&#224;&#231;&#243; $time<br>";

}else echo 
"problem mysql<br>";

?>
  •  

Pyrotech

Yes, there are scripts available that can be easily run on hosting to benchmark performance. One popular script is called Apache Bench (ab), which is a command-line tool for benchmarking HTTP servers. Another option is Siege, which is a multi-threaded HTTP stress testing and benchmarking utility. Both of these scripts can be easily installed and run on most hosting environments.

here are a few more scripts and tools you can use to check web hosting speed:

1. GTmetrix: This online tool measures the performance of your website by analyzing page speed and other factors. It provides detailed reports with recommendations for optimizing your site.

2. Pingdom Tools: Pingdom offers a website speed test that shows the load time and performance of your website from different locations worldwide. It also provides insights and suggestions for improvement.

3. WebPageTest: This tool allows you to measure and analyze the performance of your webpage, including load time, waterfall charts, and various performance metrics. You can choose from multiple test locations and view detailed results.

4. Google PageSpeed Insights: With this tool, you can assess the performance of your website on both desktop and mobile devices. It provides suggestions for improving speed and user experience.

5. YSlow: This browser extension helps you analyze web page performance based on Yahoo's rules for high-performance websites. It provides recommendations for improving speed, caching, and other factors.

These tools can help you assess various aspects of your web hosting speed and identify areas for optimization.
  •