开源数据库性能测试工具benchmarkSQL初探

抽空小玩了一下这款很经典的开源数据库性能测试工具benchmarkSQL,在数据库性能测试方面,之前只是对TPC一系列的基准测试有些了解,还不曾触及到其他的测试工具。benchmarkSQL内嵌了tpc-c的测试脚本,所以其实是可以替代tpc-c来衡量数据库的OLTP处理能力的。工具的最大特点就是小并且灵活,配置简单。

工具可以在windows和linux两套平台上运行,可以配置多种数据库,目前在SourceForge上下载的基本上无须怎么改动配置文件就可以直接用来测试 EnterpriseDB、PostgreSQL、MySQL、Oracle、SQL Server了,今天小试的时候,用的是国产的数据库产品,在windows上测试的,改动起来非常的方便。

主要是要修改配置文件,以及拷贝你所使用的数据库的JDBC驱动程序到相应的文件夹里面就可以了。

下面是详细的步骤,方便需要的人看。

Instructions for building
-------------------------

Use of JDK 1.5 is recommended, build with "ant jar" from the command line of  the base directory or use your favorite IDE such as Netbeans or Eclipse. 


Instructions for running
------------------------
The below scripts all use relative paths, but, they depend on JAVA_HOME environment varibale being set so that the correct runtime can be found.
JDBC drivers and sample "?.properties" files are included to make it extremely easy for
you to test out the performance of EnterpriseDB, PostgreSQL, MySQL, Oracle, & SQL Server in your environment.


1. Go to the 'run/scripts' directory, edit the appropriate "??????.properties" file to point to the database instance you'd like to test.   Of course you'll substitute in the name of your appropriate config file in the command lines below.


2. Run the "sqlTableCreates" to create the base tables.

      -  runSQL EnterpriseDB.properties sqlTableCreates

   Note:  "sqlTableCreates" will truncate all the tables so you can start over clean.
          There is also a "sqlTableDrops" script if you need it.


3. Run the "loadData" command file to load all of the default data for a benchmark:


  A.) Approximately half a million rows in total will be loaded across 9 tables
      per Warehouse.  (The default is numWarehouses=1)  A decent test size of data
      totaling about 1 GB is 10 warehouses as follows:
        $ loadData EnterpriseDB.properties numWarehouses=10

  B.) Alternatively, you may choose to generate test out to CSV files that can be
      bulk loaded as follows:
        $ loadData EnterpriseDB.properties numWarehouses=10 fileLocation=c:/temp/

      These CSV files can be bulk loaded into EDB-Postgres via the following:
        $  runSQL EnterpriseDB.properties sqlTableCopies

      You may clean out the data in the tables without dropping them via:
        $  runSQL EnterpriseDB.properties sqlTableTruncates


4. Run the "runSQL" command file to execute the SQL script "sqlIndexCreates" to
   create the primary keys & other indexes on the tables.

      -  runSQL EnterpriseDB.properties sqlIndexCreates


5. Run the "runBenchmark" command file to execute the swing GUI application to
   test the database.  Don't forget to set the number of warehouses equal to the
   number you created in step 3

      -  runBenchmark EnterpriseDB.properties

 

你可能感兴趣的:(sql,数据库,server,command,PostgreSQL,Netbeans,测试工具)