Test hardware description:
The test uses my machine. The configuration is as follows:
CPU: C433
Memory: 128 MB
Hard disk: Cool 2 generation 20G
Test Software description:
Windows nt server4, sp5, apache 1.3.12, php3.0.15, php4rc1, mysql 3.22.29, and oracle 8.0.5 are used in WIN32.
In linux, bluepoint linux1.0, apache 1.3.12, php4rc1, and mysql 3.22.32 are used.
Test Code description:
A simple table is used. mysql and oracle use the same table structure and have only three Fields. The structure is as follows:
Mysql table structure:
Create table board (
Board_id smallint (6) not null auto_increment,
Board_name char (16) not null,
Board_manager char (20 ),
Primary key (board_id)
);
Oracle structure:
Create table PHP_ORACLE. "BOARD"
("BOARD_ID" FLOAT,
"BOARD_NAME" CHAR (16) not null,
"BOARD_MANAGER" CHAR (20 ));
We only tested the INSERT operation time. For select, no tests were conducted.
In win32, only PHP3 can connect to the oracle Database. Therefore, only the performance of connecting oracle with PHP3 is tested. Phase
After the official version of PHP4 is released, the speed of connecting oracle with PHP4 should be improved.
In LINUX, I only tested the performance of mysql because I didn't install oracle. It is said that in LINUX, oracle
The performance is good, but cannot be tested.
In addition, we put all the code used for database connection and oracle to analyze SQL statements out of the statistical code.
Therefore, the test only takes time to execute SQL operations.
Programs used to test mysql:
<? Php
$ Dblink = mysql_connect ("localhost", "root", "shh123 ");
Mysql_select_db ("bbs ");
$ Counter = 1;
Set_time_limit (300 );
$ Query = "insert into board (board_name, board_manager) values ('test', 'test ')";
$ Begin_time = time ();
For ($ I = 1; $ I <= 10000; $ I ){
Mysql_db_query ("bbs", $ query );
$ Counter;
}
$ End_time = time ();
Mysql_close ($ dblink );
Echo "test db speed... <br> ";
Echo "begin time:". $ begin_time. "<BR> ";
Echo "<BR> end time:". $ end_time. "<BR> ";