测试步骤 本章节会介绍通过测试工具测试性能的详细步骤。 请根据实际信息,替换数据库、连接IP与用户密码。 1. 导入数据。 (1)使用mysql命令登录数据库,并创建测试数据库 “loadtest” 。 psql h p5432 "dbnamepostgres userroot password" <数据库。 sysbenchtest/usr/local/share/sysbench/tests/include/oltplegacy/oltp.luadbdriverpgsql pgsqldbloadtest pgsqluserrootpgsqlpasswordpgsqlport5432 pgsqlhostoltptablescount64 oltptablesize10000000 numthreads20 prepare 2. 压测数据。 sysbenchtest/usr/local/share/sysbench/tests/include/oltplegacy/oltp.luadbdriverpgsql pgsqldbloadtest pgsqluserrootpgsqlpasswordpgsqlport5432 pgsqlhostoltptablescount64oltptablesize10000000 maxtime3600 maxrequests0numthreads64 reportinterval3 forcedshutdown1 run 3. 清理数据。 sysbenchtest/usr/local/share/sysbench/tests/include/oltplegacy/oltp.luadbdriverpgsql pgsqldbloadtest pgsqluserrootpgsqlpasswordpgsqlport5432 pgsqlhostoltptablescount64 oltptablesize10000000 maxtime3600 maxrequests0 numthreads200 cleanup