その他の知識 Tiberoの性能をテストするためのロードランナーの使用方法 2014. 04. 10.
目次 1. ロードランナーの紹介... 3 1.1. ロードランナーの概要... 3 1.2. ロードランナーの構成... 3 1.3. ロードランナーの環境構成... 4 2. ロードランナーの使用例... 6 2.1. 使用例 (Native-Protocol Driver)... 6 2
Tibero の性能をテストするためのロードランナーの使用方法 1. ロードランナーの紹介 1.1. ロードランナーの概要 Web プログラムを作成した後 最大の同時接続者数をテストしたら チューニングが必要な場合が多いです このようなとき 数十名の人を集めて同時にクリックしながらテストを行う場合もありますが テストは短時間で終わる作業ではなく 環境設定を修正してから 作業を再開するのも簡単なことではありません ロードランナーは このようなテスト作業を一人で または複数のパソコンで簡単に行える性能テスト ツールです このツールのほか JMETER などがあります 1.2. ロードランナーの構成 LoadRunner Controller - 負荷テスト シナリオの作成とシステム負荷の生成および実行の制御 LoadRunner VUGen - 仮想ユーザーのテスト スクリプトの自動生成およびデバッグ LoadRunner Analysis - 負荷テストの結果の自動集計および性能評価指標の自動算出 3
1.3. ロードランナーの環境構成 Java Vuser の使用時の環境構成の設定 (LoadRunner VUGen) - Run-time Settings にて Java の環境設定 (classpath,java VM) を設定します Classpath の設定 - Classpath にて LoadRunner 下位フォルダーの classes フォルダーのパスを追加します 4
Classpath に jdbc パスを追加します Java VM にて JDK(JAVA_HOME) パスを追加します 5
2. ロードランナーの使用例 2.1. 使用例 (Native-Protocol Driver) 1) JDBC を利用してロードランナーを実行した後 Tibero TAC の可用性テストを行います - スクリプトの作成 (LoadRunner VUGen) シナリオの作成 (LoadRunner Controller) 実行および結果の分析 (LoadRunner Analysis) 2) スクリプトを作成します - LoadRunner VUGen を実行 ファイル New script and solution カテゴリ Vugen single Protocol にて Java Vuser を選択した後 スクリプトを作成します import lrapi.lr; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import java.sql.*; public class Actions { private Connection connection; public int init() throws Throwable { // Initialize DB connection return 0; }//end of init public int action() throws Throwable { String FORMATTED_MESSAGE = null; Statement stmt = null; ResultSet rs = null; connection = null; try { lr.start_transaction("test_tx"); Class.forName("com.tmax.tibero.jdbc.TbDriver").newInstance(); String url = "jdbc:tibero:thin:@(description=(failover=on)(address_list=(address=(host=192.168.51.171)(port=56629))(address=(host=1 92.168.51.172)(port=58629)))(DATABASE_NAME=TAC))"; stmt = connection.createstatement(); rs = stmt.executequery("select count(*) cnt from test_tac"); while (rs.next()) { FORMATTED_MESSAGE = rs.getstring("cnt"); //lr.message(formatted_message); } lr.end_transaction("test_tx",lr.pass); 6
} catch(exception ex) { ex.printstacktrace(); lr.end_transaction("test_tx",lr.fail); } finally { try{rs.close(); rs=null;} catch(exception ex){} try{stmt.close(); stmt=null;} catch(exception ex){} try{connection.close();connection = null;} catch(exception ex){} } return 0; }//end of action } public int end() throws Throwable { // connection = null; return 0; }//end of end シナリオの作成 (LoadRunner Controller) - LoadRunner Controller を実行 New scenario Goal-Oriented Scenario ( ロードランナーのコントローラーが指定した goals をベースにしてシナリオを構成 ) スクリプトを追加した後 OK ボタンをクリック 7
一方のノードの接続を切断してからフェイルオーバー テストを行います Transaction Per Second - 単位時間あたりの処理件数のグラフ - 一方のノードの接続を切断するとグラフが下降し その後 再び正常な状態を維持します - ネットワークの状況および接続の状況に応じて グラフの均一度が異なります ( テスト中に JDBC を利用して再接続する場合 TPS 数値が 20 倍以上の差が発生します ) 8
実行および結果の分析 (LoadRunner Analysis) 9
Copyright 2014 TmaxData Co., Ltd. All Rights Reserved. Trademarks Tibero RDBMS is a registered trademark of TmaxData Co., Ltd. Other products, titles or services may be registered trademarks of their respective companies. Contact Information TmaxData can be contacted at the following addresses to arrange for a consulting team to visit your company and discuss your options. Korea TmaxData Co., Ltd 5, Hwangsaeul-ro 329beon-gil, Bundang-gu, Seongnam-si, Gyeonggi-do. South Korea Tel: +82-31-779-7113 Fax: +82-31-779-7119 Email: info@tmax.co.kr Web (Korean): http://www.tmaxdata.com Technical Support: http://technet.tmaxsoft.com USA TmaxSoft, Inc. 560 Sylvan Avenue Englewood Cliffs, NJ 07632. U.S.A Tel: +1-201-567-8266 Fax: +1-201-567-7339 Email: info@tmaxsoft.com Web (English): http://www.tmaxsoft.com Russia Tmax Russia L.L.C. Grand Setun Plaza, No A204 Gorbunova st.2, Moscow, 121596 Tel: +7(495)970-01-35 Email: info.rus@tmaxsoft.com Web (Russian): http://ru.tmaxsoft.com Singapore Tmax Singapore Pte. Ltd. 430 Lorong 6, Toa Payoh #10-02, OrangeTee Building. Singapore 319402 Tel: +65-6259-7223 Email: info.sg@tmaxsoft.com United Kingdom TmaxSoft UK Ltd. Surrey House, Suite 221, 34 Eden Street, Kingston-Upon- Thames, KT1 1ER United Kingdom Tel: + 44-(0)20-8481-3776 Email: info.uk@tmaxsoft.com Web (English): http:/www.tmaxsoft.com Japan TmaxSoft Japan Co., Ltd. 5F Sanko Bldg, 3-12-16 Mita, Minato-Ku, Tokyo, 108-0073 Japan Tel: +81-3-5765-2550 Fax: +81-3-5765-2567 Email: info.jp@tmaxsoft.com Web (Japanese): http://www.tmaxsoft.co.jp China TmaxSoft China Co., Ltd. Beijing Silver Tower, RM 1508, 2 North Rd Dong San Huan, Chaoyang District, Beijing, China, 100027. China Tel: +86-10-6410-6145~8 Fax: +86-10-6410-6144 Email: info.cn@tmaxsoft.com Web (Chinese): http://www.tmaxsoft.com.cn Brazil TmaxSoft Brazil Avenida Copacabana, 177-3 andar 18 do Forte Empresarial, Alphaville - Barueri, Sao Paulo, SP-Brasil CEP 06472-001 Email: contato.brasil@tmaxsoft.com TN-TRDV-D0410101 10