LoginSignup
1
0

More than 5 years have passed since last update.

JMeterを使ってでかい(large)ファイルを下載しよう

Last updated at Posted at 2017-07-27

俺です。

解決したい課題

JMeterで ファイル 下載 したい。

背景

ある日JMeterを使ってHTTPリクエストでファイルをGETしたくなり、
HTTP Samplerで試していたところ、HTTP SamplerではJVM HeapにGETしたファイルを溜め込んでしまいます。
実行スレッド数を上昇させるとFull GC地獄に陥ることがわかったので、回避策を考えました。
というか@h-imaoka先生に聞いてなんかねーか教えてもらいました。

解決方法

HTTP Request SamplerではなくBeanShell Samplerを使います。
以下curlを使った一例です。

          <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="fairu gesai" enabled="true">
            <stringProp name="BeanShellSampler.query">exec(&quot;/usr/bin/curl -sS -o /dev/null &quot; + vars.get(&quot;URL${count}&quot;)); </stringProp>
            <stringProp name="BeanShellSampler.filename"></stringProp>
            <stringProp name="BeanShellSampler.parameters"></stringProp>
            <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp>
          </BeanShellSampler>

注意点

  • JMeterで発行したスレッド数分curlコマンドがバックグラウンドで起動されます。同時スレッド数を高める時はlimitsの修正など忘れないようにしましょう。
  • 転送料金に注意しましょう。

よいJMeterライフを!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0