diff --git a/contrib/pgbench/README.pgbench b/contrib/pgbench/README.pgbench index 7fc683cef035027f6d3b1fe5d4f47ea2e95c82f6..ef040c094d7663c2adfea9020897eb802319cab6 100644 --- a/contrib/pgbench/README.pgbench +++ b/contrib/pgbench/README.pgbench @@ -1,4 +1,4 @@ -$PostgreSQL: pgsql/contrib/pgbench/README.pgbench,v 1.16 2007/04/06 08:49:44 ishii Exp $ +$PostgreSQL: pgsql/contrib/pgbench/README.pgbench,v 1.17 2007/04/06 09:16:15 ishii Exp $ pgbench README @@ -96,10 +96,14 @@ o options default is 1. NOTE: scaling factor should be at least as large as the largest number of clients you intend to test; else you'll mostly be measuring update contention. + Regular (not initializing) runs using one of the + built-in tests will detect scale based on the number of + branches in the database. For custom (-f) runs it can + be manually specified with this parameter. -D varname=value - Define a variable. It can be refereed to by a script - provided by using -f option. Multile -D options are allowed. + Define a variable. It can be refered to by a script + provided by using -f option. Multiple -D options are allowed. -U login Specify db user's login name if it is different from @@ -141,9 +145,22 @@ o options with the name "pgbench_log.xxx", where xxx is the PID of the pgbench process. The format of the log is: - client_id transaction_no time + client_id transaction_no time file_no time-epoch time-us - where time is measured in microseconds. + where time is measured in microseconds, , the file_no is + which test file was used (useful when multiple were + specified with -f), and time-epoch/time-us are a + UNIX epoch format timestamp followed by an offset + in microseconds (suitable for creating a ISO 8601 + timestamp with a fraction of a second) of when + the transaction completed. + + Here are example outputs: + + 0 199 2241 0 1175850568 995598 + 0 200 2465 0 1175850568 998079 + 0 201 2513 0 1175850569 608 + 0 202 2038 0 1175850569 2663 -d debug option. @@ -165,6 +182,8 @@ o What is the "transaction" actually performed in pgbench? (7) end; +If you specify -N, (4) and (5) aren't included in the transaction. + o -f option This supports for reading transaction script from a specified diff --git a/contrib/pgbench/README.pgbench_jis b/contrib/pgbench/README.pgbench_jis index 5afa9324367249fc1ec1ba1999048082e5571f02..e06587a879145eb7cddd24020734c99ef77d557a 100644 --- a/contrib/pgbench/README.pgbench_jis +++ b/contrib/pgbench/README.pgbench_jis @@ -1,4 +1,4 @@ -$PostgreSQL: pgsql/contrib/pgbench/README.pgbench_jis,v 1.17 2007/04/06 08:49:44 ishii Exp $ +$PostgreSQL: pgsql/contrib/pgbench/README.pgbench_jis,v 1.18 2007/04/06 09:16:16 ishii Exp $ pgbench README @@ -76,6 +76,13 @@ pgbench にはいろいろなオプションがあります. デフォルトのスケーリングファクターは 1 です. -f オプションで指定したファイルからスケーリングファク ターを参照するには scale という変数名を使用します. + 注意: スケーリングファクターは少なくとも -c で指定される同時接 + 続ユーザ数と同じかそれよりも大きくしてください.でないと, + pgbenchの結果はUPDATEの競合に大きく影響されてしまいます. + 組込みのベンチマークパターンでは,brachesの数(=brachesテーブル + の行数)が自動的にスケーリングファクターに設定されます. + カスタムクエリ(-fオプション使用)では,スケーリングファクターは + 自動設定されません. -D varname=value @@ -130,10 +137,24 @@ pgbench にはいろいろなオプションがあります. カレントディレクトリ以下のpgbench_log.xxxというファイ ルです.ファイルのフォーマットは, - クライアントID トランザクション番号 時間 + クライアントID トランザクション番号 時間 ファイル番号 Unixタイム(秒) オフセット となっています.時間はマイクロ秒単位です. + ファイル番号はテストに使われたファイルの番号です(-fオプション + を複数指定したときに有用です). + + 「Unixタイム(秒) オフセット」は,トランザクションが完了したと + きのUNIXエポックタイムとマイクロ秒単位のオフセットです(ISO + 8601タイムスタンプと秒の中の端数). + + ログの出力例を示します. + + 0 199 2241 0 1175850568 995598 + 0 200 2465 0 1175850568 998079 + 0 201 2513 0 1175850569 608 + 0 202 2038 0 1175850569 2663 + -d デバッグオプション.様々な情報が表示されます. ■データベースの初期化 @@ -198,6 +219,8 @@ pgbench では,以下のシーケンスを全部完了して1トランザクションと数えて����┠�緕篁�����オプションを使用すると,(4)(5)は実行されません. + ■入力ファイルのフォーマット -f オプションを指定してトランザクションに含まれる SQL コマンドの内容を diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 369b7669f121e7bc66614a12609f9db28cdea4f6..2ffd24b25b907d2242e9331a18b8f070724fcd8d 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.63 2007/04/06 08:49:44 ishii Exp $ + * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.64 2007/04/06 09:16:16 ishii Exp $ * * pgbench: a simple benchmark program for PostgreSQL * written by Tatsuo Ishii @@ -469,7 +469,8 @@ top: diff = (int) (now.tv_sec - st->txn_begin.tv_sec) * 1000000.0 + (int) (now.tv_usec - st->txn_begin.tv_usec); - fprintf(LOGFILE, "%d %d %.0f\n", st->id, st->cnt, diff); + fprintf(LOGFILE, "%d %d %.0f %d %ld %ld\n", + st->id, st->cnt, diff, st->use_file, now.tv_sec,now.tv_usec); } if (commands[st->state]->type == SQL_COMMAND)