simonsimcity / phpspeed Goto Github PK
View Code? Open in Web Editor NEWScript to check the speed of your php-server
Home Page: http://www.phpspeed.com/
Script to check the speed of your php-server
Home Page: http://www.phpspeed.com/
PHPspeed v1.0 BETA http://www.phpspeed.com MANUAL SETUP INSTRUCTIONS -------------------------------------------------------------------------------- 1) Create a new MySQL DB (you might call it phpspeed) 2) Import the included phpspeed.sql file to create the tables 3) Copy the config_db.tpl.php file to config_db.php and update the database connection data 4) You will need to remove the INSTALL folder and all contents 5) CHMOD the 'test3' folder to 777 for the read/write test 6) Load the index.php file to start benchmarking -------------------------------------------------------------------------------- WEB BASED INSTALLATION -------------------------------------------------------------------------------- 1) Upload the entire phpspeed folder to a web accessible folder on your server 2) Navigate to the folder through a web browser (ex.. http://www.yoursite.com/phpspeed/) 3) Follow the install instructions provided 4) Delete the install folder 5) CHMOD the 'test3' folder to 777 for the read/write test 6) Load the index.php file to start benchmarking -------------------------------------------------------------------------------- Notes from the author: -------------------------------------------------------------------------------- You have downloaded our BETA offering of PHPspeed. While we have tested on our servers extensively, it is impossible to predict how the script will act on different configurations. Please proceed with caution and report any bugs to us using the BUG TRACKER at http://www.phpspeed.com. -------------------------------------------------------------------------------- For any questions or installation problems, please visit http://www.phpspeed.com . That's it! Enjoy this script.
Warning: file(/proc/cpuinfo) [function.file]: failed to open stream: No such file or directory
/proc/cpuinfo isn't there on FreeBSD, but I'm guessing this isn't strictly needed for the tests to run either.
diff -ruN htdocs.old//inc/functions.server.php htdocs/inc/functions.server.php
--- htdocs.old//inc/functions.server.php 2011-09-12 23:53:06.286286059 +0200
+++ htdocs/inc/functions.server.php 2011-09-12 23:53:17.675286141 +0200
@@ -94,4 +94,20 @@
$cac_mem = ($cache_mem/1024);
$sha_mem = ($shared_mem/1024);
+function buffer_flush(){
+
+ echo str_pad('', 512);
+ echo '<!-- -->';
+
+ if(ob_get_length()){
+
+ @ob_flush();
+ @flush();
+ @ob_end_flush();
+
+ }
+
+ @ob_start();
+}
+
?>
diff -ruN htdocs.old//runtests2.php htdocs/runtests2.php
--- htdocs.old//runtests2.php 2011-09-12 23:11:03.000000000 +0200
+++ htdocs/runtests2.php 2011-09-12 23:53:47.967287208 +0200
@@ -93,7 +93,6 @@
ignore_user_abort(TRUE);
error_reporting(E_ALL);
set_time_limit(0);
-ob_implicit_flush(1);
define('CSV_SEP', ',');
define('CSV_NL', "\n");
@@ -146,7 +145,7 @@
$GLOBAL_TEST_FUNC = $func;
echo "<b>" . sprintf('%34s', $func) . "</b> ... \t";
- flush();
+ buffer_flush();
list($usec, $sec) = explode(' ', microtime());
$GLOBAL_TEST_START_TIME = $usec + $sec;
}
@@ -197,7 +196,7 @@
}
$test_name = $matches[1];
include_once($tests_dir . '/' . $entry);
- flush();
+ buffer_flush();
if (!function_exists($test_name . '_enabled')) {
echo 'INVALID !' . "\n";
continue;
diff -ruN htdocs.old//runtests3.php htdocs/runtests3.php
--- htdocs.old//runtests3.php 2011-09-12 23:11:03.000000000 +0200
+++ htdocs/runtests3.php 2011-09-12 23:53:57.786291156 +0200
@@ -93,7 +93,6 @@
ignore_user_abort(TRUE);
error_reporting(E_ALL);
set_time_limit(0);
-ob_implicit_flush(1);
define('CSV_SEP', ',');
define('CSV_NL', "\n");
@@ -143,7 +142,7 @@
$GLOBAL_TEST_FUNC = $func;
echo "<b>" . sprintf('%34s', $func) . "</b> ... \t";
- flush();
+ buffer_flush();
list($usec, $sec) = explode(' ', microtime());
$GLOBAL_TEST_START_TIME = $usec + $sec;
}
@@ -194,7 +193,7 @@
}
$test_name = $matches[1];
include_once($tests_dir . '/' . $entry);
- flush();
+ buffer_flush();
if (!function_exists($test_name . '_enabled')) {
echo 'INVALID !' . "\n";
continue;
diff -ruN htdocs.old//runtests4.php htdocs/runtests4.php
--- htdocs.old//runtests4.php 2011-09-12 23:11:03.000000000 +0200
+++ htdocs/runtests4.php 2011-09-12 23:54:08.037286038 +0200
@@ -93,7 +93,6 @@
ignore_user_abort(TRUE);
error_reporting(E_ALL);
set_time_limit(0);
-ob_implicit_flush(1);
define('CSV_SEP', ',');
define('CSV_NL', "\n");
@@ -145,7 +144,7 @@
$GLOBAL_TEST_FUNC = $func;
echo "<b>" . sprintf('%34s', $func) . "</b> ... \t";
- flush();
+ buffer_flush();
list($usec, $sec) = explode(' ', microtime());
$GLOBAL_TEST_START_TIME = $usec + $sec;
}
@@ -196,7 +195,7 @@
}
$test_name = $matches[1];
include_once($tests_dir . '/' . $entry);
- flush();
+ buffer_flush();
if (!function_exists($test_name . '_enabled')) {
echo 'INVALID !' . "\n";
continue;
diff -ruN htdocs.old//runtests5.php htdocs/runtests5.php
--- htdocs.old//runtests5.php 2011-09-12 23:11:03.000000000 +0200
+++ htdocs/runtests5.php 2011-09-12 23:54:18.256286470 +0200
@@ -93,7 +93,6 @@
ignore_user_abort(TRUE);
error_reporting(E_ALL);
set_time_limit(0);
-ob_implicit_flush(1);
define('CSV_SEP', ',');
define('CSV_NL', "\n");
@@ -145,7 +144,7 @@
$GLOBAL_TEST_FUNC = $func;
echo "<b>" . sprintf('%34s', $func) . "</b> ... \t";
- flush();
+ buffer_flush();
list($usec, $sec) = explode(' ', microtime());
$GLOBAL_TEST_START_TIME = $usec + $sec;
}
@@ -196,7 +195,7 @@
}
$test_name = $matches[1];
include_once($tests_dir . '/' . $entry);
- flush();
+ buffer_flush();
if (!function_exists($test_name . '_enabled')) {
echo 'INVALID !' . "\n";
continue;
diff -ruN htdocs.old//runtests.php htdocs/runtests.php
--- htdocs.old//runtests.php 2011-09-12 23:11:03.000000000 +0200
+++ htdocs/runtests.php 2011-09-12 23:51:25.456285603 +0200
@@ -89,7 +89,6 @@
ignore_user_abort(TRUE);
error_reporting(E_ALL);
set_time_limit(0);
-ob_implicit_flush(1);
define('CSV_SEP', ',');
define('CSV_NL', "\n");
@@ -146,7 +145,7 @@
$GLOBAL_TEST_FUNC = $func;
echo "<b>" . sprintf('%34s', $func) . "</b> ... \t";
- flush();
+ buffer_flush();
list($usec, $sec) = explode(' ', microtime());
$GLOBAL_TEST_START_TIME = $usec + $sec;
}
@@ -197,7 +196,7 @@
}
$test_name = $matches[1];
include_once($tests_dir . '/' . $entry);
- flush();
+ buffer_flush();
if (!function_exists($test_name . '_enabled')) {
echo 'INVALID !' . "\n";
continue;
egrep is deprecated in php 5.3, if you compare 5.2 and 5.3 the test is not equal
I get very very poor results with using phpspeed with a Percona Mysql.
The DB is configured fine but I thing the tests are not made for Percona at all
--- inc/functions.server.php.old 2011-09-12 23:11:03.000000000 +0200
+++ inc/functions.server.php 2011-09-12 23:29:49.246286609 +0200
@@ -23,8 +23,10 @@
//Display CPU information
$cpuinfo = file("/proc/cpuinfo");
+$total_cpu=0;
for ($i = 0; $i < count($cpuinfo); $i++) {
list($item, $data) = split(":", $cpuinfo[$i], 2);
if (trim($cpuinfo[$i]) != "") {
list($item, $data) = explode(":", $cpuinfo[$i], 2);
$item = chop($item);
$data = chop($data);
if ($item == "processor") {
}
list($item, $data) = split(":", $meminfo[$i], 2);
list($item, $data) = explode(":", $meminfo[$i], 2);
$item = chop($item);
$data = chop($data);
if ($item == "MemTotal") { $total_mem =$data; }
if ($item == "Shmem") {$shared_mem = $data; }
It's getting more-and-more a need to update the library phpSysInfo.
This package is using phpSysInfo v1.5 and the current version is 3.0.18
http://phpsysinfo.sourceforge.net/
Please check if it's possible to flush the MySQL query cache before running the tests. Otherwise you'll get faster values the second time without changing anything - just using the cache.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.