Scripts for checking the hosting speed

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

Previous topic - Next topic

ElizabethParkerTopic starter

Bitrix has modules for benchmarking hosting, which shows the number of operations in the CPU, the speed of the HDD, measures MySQL for reading, writing, deleting.
Checks which php settings need to be changed for better performance.
Is there such a script so that it can be run on hosting?
  •  

friv10games

Well, there are no such people. There is https://code .google.com/p/byte-unixbench / , tests I/O, CPU, HDD, etc.
Like this

wget dl.getipaddr.net/speedtest.sh 2>/dev/null -O- | bash
you can test your channel.
There is also a benchmark from serverbear.com/about , but I didn't launch it, I can't say anything. The first two, imho, are enough for the eyes.

There are separate pieces of code and scripts for various kinds of tests. For example, newbielink:http://www.phpbench.com/ [nonactive].
If you Google, you can find similar tests to determine the performance of the file system.
From all these resources, you can quickly assemble the necessary benchmark for your goals with your hands.
  •  

pcoptimizer

Checking the page loading speed using Uptrend

Offers more than 35 geographical points for testing site speed. The report provided consists of two sections: a breakdown of the download process and a group of domains. The Domain Groups section contains unique information, as resources are classified according to various sources in it: proprietary, statistics, CDN, social, advertising.


so I'm looking for something similar, only with the launch through the browser:

<?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>";

?>
  •