The Jakarta Project

About

Documentation

Community

11. Best Practices ベストプラクティス
11.1 Limit the Number of Threads スレッド数の限界値

Your hardware's capabilities will limit the number of threads you can effectively run with JMeter. It will also depend on how fast your server is (a faster server gives makes JMeter work harder since it returns request quicker). The more JMeter works, the less accurate its timing information will be. The more work JMeter does, the more each thread has to wait to get access to the CPU, the more inflated the timing information gets. If you need large-scale load testing, consider running JMeter remotely across multiple machines.

JMeterを有効に利用できるスレッド数の限界はハードウェアの能力に依存します。 サーバーの速さにもまた依存します (より早いサーバーはより早くレスポンスを返すためJMeterはよりハードに働かなければならない)。 JMeterがより多く動けば、そのタイミング情報の正確性は失われて行きます。 JMeterがより多く動けば、各スレッドがCPUにアクセスする待ち時間は長くなり、 得られるタイミング情報は水増しされてしまいます。 もしも大規模な負荷テストを行う必要がある場合は、 複数のマシンを使ってJMeterをリモートで実行する必要があります。

11.2 Where to Put the Cookie Manager クッキーマネージャを置く場所

See Building a Web Test for information.

Webテストプランの作成を参照してください。

11.3 Where to Put the Authorization Manager 認証マネージャを置く場所

See Building an Advanced Web Test for information.

より進んだWebテストプランの作成を参照してください。

11.4 Using the Proxy Server PROXYサーバーの使用

Refer to for details on setting up the proxy server. The most important thing to do is filter out all requests you aren't interested in. For instance, there's no point in recording image requests (JMeter can be instructed to download all images on a page - see ). These will just clutter your test plan. Most likely, there is an extension all your files share, such as .jsp, .asp, .php, .html or the like. These you should "include" by entering ".*\.jsp" as an "Include Pattern".

PROXYサーバーのセットアップについてはを参照してください。 ここで一番重要なことは、 あなたの興味のないものも含め全てのリクエストをフィルタしてしまうということです。 例えば、画像のリクエストは特に意味はありません (JMeterがページ上の全ての画像をダウンロードするようにできます−参照)。 これらはテストプランを乱雑にしてしまうだけです。 たいていはファイルには.jsp, .asp, .php, .htmlのような拡張がつけられていることと思います ".*\.jsp"のように入力することでこれらのファイルを"Include Pattern"として設定するべきでしょう。

Alternatively, you can exclude images by entering ".*\.gif" as an "Exclude Pattern". Depending on your application, this may or may not be a better way to go. You may also have to exclude stylesheets, javascript files, and other included files. Test out your settings to verify you are recording what you want, and then erase and start fresh.

逆に、"Exclude Pattern"として".*\.gif"等を入力することにより画像ファイルを除外することができます。 アプリケーションによってはそうしたほうが、あるいはそうしないほうがよいでしょう。 スタイルシートやJavascript、その他のファイルも除外しなければならないでしょう。 実行してみて、記録したものが望んでいるものと一致するかどうか確認し、 望まないものが含まれていればやり直してみましょう。

Although JMeter will record directly to the ThreadGroup if no Logical Controller is present, it's recommended that you add a so that all samples are recorded there. This conveniently packages all your samples under one controller, which can be given a name that describes the test case.

論理コントローラが無い場合にはスレッドグループに直接記録してしまいますが、 全てのサンプルを記録するためにを追加しておくことが推奨されています。 それによりひとつのコントローラーの配下に全てのサンプルを簡単にパッケージでき、 テストケースとして名前を与えることが容易です。

Now, go through the steps of a Test Case. If you have no pre-defined test cases, use JMeter to record your actions to define some test cases. Once you have finished a definite series of steps, save the entire test case in an appropriately named file. Then, wipe clean and start a new test case. By doing this, you can quickly record a large number of test case "rough drafts".

それでは、テストケースのステップを検討してみましょう。 もしも事前に定義したテストケースが無ければ、 JMeterがアクションを記録してテストケースを定義してくれます。 一連のステップを終えたら、その全ての動作を適当なファイル名で保存してください。 もう一度はじめから新しいケースをスタートさせます。 こうすることにより、たくさんのテストケースの"草稿"を簡単に作成できます。

One of the most useful features of the Proxy Server is that you can abstract out certain common elements from the recorded samples. By attaching an , with the "domain" property specified (eg jakarta.apache.org), to your , you can direct JMeter to:

プロキシーサーバーで最も有効な機能のひとつが、 記録されたサンプルから特定の共通な要素を抽出することができることです。 に"domain"プロパティ(例えば jakarta.apache.org) をセットしたを加えることで、 JMeterに

  1. Only record samples with matching "domain" fields under this Controller, and
  2. Remove the "domain" field from the recorded sample.
  1. このコントローラの"domain"フィールドにマッチするサンプルだけを記録させ、
  2. 記録されたサンプルから"domain"フィールドを削除させることができます

You can do the same with the "Path" field.

"Path"フィールドでも同様のことができます。


Copyright © 1999-2001, Apache Software Foundation