Optimizing Software Development
RSS icon Email icon Home icon
  • JMeter Script with Proxy Support

    Posted on October 3rd, 2005 levent.gurses 1 comment

    JMeter comes with several launch scripts:

    • jmeter.bat - GUI execution with proxy support:
      -H [proxy server hostname or ip address]
      -P [proxy server port]
      -u [username for proxy authentication - if required]
      -a [password for proxy authentication - if required]
    • jmeter-n.bat - background mode with no proxy support
    • jmeterw.bat - GUI mode using javaw with proxy support

    For some reason proxy is NOT supported in the unattended script, jmeter-n.bat . An easy way to add proxy support to jmeter-n.bat is to change the launch statement in the following way:

    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms256m -Xmx256m
    set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
    set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
    set TENURING=-XX:MaxTenuringThreshold=2
    set EVACUATION=-XX:MaxLiveObjectEvacuationRatio=20%
    set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
    set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m
    set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution
    set PROXY=-H my.proxy.server -P my.proxy.port
    set ARGS=%HEAP% %NEW% %SURVIVOR% %TENURING% %EVACUATION% %RMIGC% %PERM% %DEBUG%
     
    java %JVM_ARGS% %ARGS% -jar ApacheJMeter.jar %PROXY% %JMETER_CMD_LINE_ARGS%

    Notice that various launch options such as memory, garbage collection and debug mode can also be changed from this file.

    Bookmark at:
    StumbleUpon | Digg | Del.icio.us | Dzone | Newsvine | Spurl | Simpy | Furl | Reddit | Yahoo! MyWeb
    Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    • digg
    • del.icio.us
    • YahooMyWeb
    • Spurl
    • Furl
    • co.mments
    • blinkbits
    • BlinkList
    • blogmarks
    • connotea
    • De.lirio.us
    • Fark
    • feedmelinks
    • LinkaGoGo
    • Ma.gnolia
    • NewsVine
    • Netvouz
    • RawSugar
    • Reddit
    • scuttle
    • Shadows
    • Simpy
    • Smarking
    • TailRank
    • Wists
     

    One response to “JMeter Script with Proxy Support”

    1. […] I wrote a while ago that JMeter comes with several launch scripts for starting the testing tool in different environments and conditions. One of those scripts was jmeter-n.bat, designed for background execution. It was unusual that a proxy was not supported in the original version which prompted me to write one that does. […]

    Leave a reply