Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFAF1D85C for ; Fri, 20 Jul 2012 15:52:02 +0000 (UTC) Received: (qmail 77536 invoked by uid 500); 20 Jul 2012 15:52:02 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 77508 invoked by uid 500); 20 Jul 2012 15:52:02 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 77496 invoked by uid 99); 20 Jul 2012 15:52:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 15:52:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vb0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 15:51:55 +0000 Received: by vbbfq11 with SMTP id fq11so3421692vbb.2 for ; Fri, 20 Jul 2012 08:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=o4/Y7aJJmUHojIQ/CMqKyw2eh2yMcp0TlAFuqdpPsu0=; b=YaBtc/YxN9X/Tc3Ih/i6QArSydAdsH62eo+q5+xj88CEysiNlYRGKbJi+/tsOW3opc GN0Hq2Rb79+CyFRzmFPP4vmYuokURlU2pPLGwlJ1/5ZNGMznI/xsrGbyobk1tszfap/+ ZVhg4jtJm8XJH/hi+IC4LNSDoA5kfkA+H8COEvKDLVFHx2ExCkDPkTqY1UbtXTfIrrUD F0EVTmrvD0bAI2fquYSu+dPMU4Cf/Kjf+PUO/mnnoFCNXbuXUQfQRz01fYroGAmWWLmd rTQrPXwGzLabi6fIZoqIR5X4vvxF0sLDfEImePmvITHlQOYigwYYYrusXFFqJAXEjHmz mG+g== MIME-Version: 1.0 Received: by 10.220.220.201 with SMTP id hz9mr4864967vcb.30.1342799493329; Fri, 20 Jul 2012 08:51:33 -0700 (PDT) Received: by 10.58.135.229 with HTTP; Fri, 20 Jul 2012 08:51:33 -0700 (PDT) In-Reply-To: References: <007201cd6506$0fe57ec0$2fb07c40$@gmail.com> Date: Fri, 20 Jul 2012 16:51:33 +0100 Message-ID: Subject: Re: Bad Throughput with Preprocessor From: sebb To: JMeter Users List Content-Type: text/plain; charset=ISO-8859-1 On 20 July 2012 16:08, unjc email wrote: > Sebb, thanks for your suggestion. I am using a Beanshell function > defined in the init script, and the performance is much better when > the samplers make the function call during the run. > > Test Plan (Run thread groups consecutively) Probably better to use a setUp Thread Group for the setup phase ... >> Counter >> CSV Data Set #1 >> CSV Data Set #2 >> Thread Group #1 >>> Debug Sampler >>>> Beanshell PreProcessor (Some logic to calculate some values and put them in PROPS) Why not use a BeanShell Sampler instead of Debug+PP? >> Thread Group #2 >>> HTTP Request (${__BeanShell(generatePath("${filename}"))} ) > > However, I noticeStandardJMeterEngine makes a "test" call of the > BeanShell function before starting the thread groups and loading CSV > data sources. Because there is a property value prepared in the first > thread group for the HTTP sampler in the second thread group, the > "Integer.parseInt" would fail if the BeanShell function is called > before the property value is even defined in the first thread group. > Anyone has experienced that? Is there a way to ensure csv data > sources and property values are ready before a thread group starts? Using the setUp group might help here. > > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: > Listeners will be started after enabling running version > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: To > revert to the earlier behaviour, define > jmeterengine.startlistenerslater=false > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: > Running the test! > 2012/07/20 14:30:57 INFO - jmeter.functions.BeanShell: > CNT = null | REQFILE = ${filename} | RVALUE = null > 2012/07/20 14:30:57 ERROR - jmeter.util.BeanShellInterpreter: Error > invoking bsh method: eval Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt > 2012/07/20 14:30:57 WARN - jmeter.functions.BeanShell: Error running > BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh > method: eval Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt > at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:192) > at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:198) > at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:103) > at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:141) > at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:116) > at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:90) > at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.testStarted(HTTPSamplerBase.java:1322) > at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:224) > at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:349) > at java.lang.Thread.run(Unknown Source) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:171) > ... 9 more > Caused by: Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt : at Line: 91 : in file: > BeanShellFunction.bshrc : Integer .parseInt ( props .get ( "rvalue" ) > ) > > Called from method: generatePath : at Line: 1 : in file: inline > evaluation of: ``generatePath("${filename}");'' : generatePath ( > "${filename}" ) > Target exception: java.lang.NumberFormatException: null > > at bsh.BSHMethodInvocation.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHVariableDeclarator.eval(Unknown Source) > at bsh.BSHTypedVariableDeclaration.eval(Unknown Source) > at bsh.BSHBlock.evalBlock(Unknown Source) > at bsh.BSHBlock.eval(Unknown Source) > at bsh.BshMethod.invokeImpl(Unknown Source) > at bsh.BshMethod.invoke(Unknown Source) > at bsh.BshMethod.invoke(Unknown Source) > at bsh.Name.invokeLocalMethod(Unknown Source) > at bsh.Name.invokeMethod(Unknown Source) > at bsh.BSHMethodInvocation.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > ... 14 more > > 2012/07/20 14:30:57 INFO - jmeter.gui.util.JMeterMenuBar: > setRunning(true,*local*) > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: > Starting 1 threads for group Thread Group. > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: Test > will stop abruptly on error > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: > jmeterthread.startearlier=true (see jmeter.properties) > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Running > PostProcessors in forward order > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: > Waiting for thread group: Thread Group to finish before starting next > group > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 1-1 > 2012/07/20 14:30:58 INFO - jmeter.services.FileServer: Stored: reqs.csv > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Thread > finished: Thread Group 1-1 > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: Ending > thread Thread Group 1-1 > 2012/07/20 14:30:59 INFO - jmeter.engine.StandardJMeterEngine: > Starting 5 threads for group Thread Group. > 2012/07/20 14:30:59 INFO - jmeter.engine.StandardJMeterEngine: Thread > will continue on error > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-1 > 2012/07/20 14:30:59 INFO - jmeter.functions.BeanShell: > CNT = 1 | REQFILE = ${filename} | RVALUE = 2 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-2 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-3 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-4 > > > > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: > Listeners will be started after enabling running version > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: To > revert to the earlier behaviour, define > jmeterengine.startlistenerslater=false > 2012/07/20 14:30:57 INFO - jmeter.engine.StandardJMeterEngine: > Running the test! > 2012/07/20 14:30:57 INFO - jmeter.functions.BeanShell: > CNT = 1 | REQFILE = ${filename} | RVALUE = null > 2012/07/20 14:30:57 ERROR - jmeter.util.BeanShellInterpreter: Error > invoking bsh method: eval Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt > 2012/07/20 14:30:57 WARN - jmeter.functions.BeanShell: Error running > BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh > method: eval Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt > at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:192) > at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:198) > at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:103) > at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:141) > at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:116) > at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:90) > at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.testStarted(HTTPSamplerBase.java:1322) > at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:224) > at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:349) > at java.lang.Thread.run(Unknown Source) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:171) > ... 9 more > Caused by: Sourced file: inline evaluation of: > ``generatePath("${filename}");'' : Typed variable declaration : Method > Invocation Integer.parseInt : at Line: 91 : in file: > BeanShellFunction.bshrc : Integer .parseInt ( props .get ( "rvalue" ) > ) > > Called from method: generatePath : at Line: 1 : in file: inline > evaluation of: ``generatePath("${filename}");'' : generatePath ( > "${filename}" ) > Target exception: java.lang.NumberFormatException: null > > at bsh.BSHMethodInvocation.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHVariableDeclarator.eval(Unknown Source) > at bsh.BSHTypedVariableDeclaration.eval(Unknown Source) > at bsh.BSHBlock.evalBlock(Unknown Source) > at bsh.BSHBlock.eval(Unknown Source) > at bsh.BshMethod.invokeImpl(Unknown Source) > at bsh.BshMethod.invoke(Unknown Source) > at bsh.BshMethod.invoke(Unknown Source) > at bsh.Name.invokeLocalMethod(Unknown Source) > at bsh.Name.invokeMethod(Unknown Source) > at bsh.BSHMethodInvocation.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.BSHPrimaryExpression.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > ... 14 more > > 2012/07/20 14:30:57 INFO - jmeter.gui.util.JMeterMenuBar: > setRunning(true,*local*) > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: > Starting 1 threads for group Thread Group. > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: Test > will stop abruptly on error > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: > jmeterthread.startearlier=true (see jmeter.properties) > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Running > PostProcessors in forward order > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: > Waiting for thread group: Thread Group to finish before starting next > group > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 1-1 > 2012/07/20 14:30:58 INFO - jmeter.services.FileServer: Stored: reqs.csv > 2012/07/20 14:30:58 INFO - jmeter.threads.JMeterThread: Thread > finished: Thread Group 1-1 > 2012/07/20 14:30:58 INFO - jmeter.engine.StandardJMeterEngine: Ending > thread Thread Group 1-1 > 2012/07/20 14:30:59 INFO - jmeter.engine.StandardJMeterEngine: > Starting 5 threads for group Thread Group. > 2012/07/20 14:30:59 INFO - jmeter.engine.StandardJMeterEngine: Thread > will continue on error > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-1 > 2012/07/20 14:30:59 INFO - jmeter.functions.BeanShell: > CNT = 1 | REQFILE = ${filename} | RVALUE = 2 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-2 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-3 > 2012/07/20 14:30:59 INFO - jmeter.threads.JMeterThread: Thread > started: Thread Group 2-4 > ... > > > > Thanks, > Jacky > > On Wed, Jul 18, 2012 at 4:21 PM, sebb wrote: >> On 18 July 2012 19:17, Anthony Johnson wrote: >>> Hey Jacky, >>> If you are using the Beanshell Pre-processor and doing the 200 >>> threads that you noted in another thread... you may be hitting a CPU >>> bottleneck on your machine. >>> >>> Some options that might help: >>> >>> Set Reset Interpretor to False (so that the beanshell instance can be re-used. >>> Use less threads >>> Use a faster machine or execute your test on more than 1 machine via >>> Remote Testing. >> >> It may help to use the BeanShell init script to define suitable >> methods, as that only has to be parsed once. >> >>> Hope this helps, >>> >>> Anthony >>> >>> On Wed, Jul 18, 2012 at 2:07 PM, unjc email wrote: >>>> I need to use a preprocessor that allows script. I know >>>> user-parameter is okay but I can't put logic in it. >>>> >>>> >>>> On Wed, Jul 18, 2012 at 12:54 PM, Robin D. Wilson wrote: >>>>> Does it matter which preprocessor you use? I use the User Parameters preprocessor (a lot), and I haven't noticed this. >>>>> >>>>> -- >>>>> Robin D. Wilson >>>>> Sr. Director of Web Development >>>>> KingsIsle Entertainment, Inc. >>>>> VOICE: 512-777-1861 >>>>> www.KingsIsle.com >>>>> >>>>> >>>>> -----Original Message----- >>>>> From: unjc email [mailto:unjc.email@gmail.com] >>>>> Sent: Wednesday, July 18, 2012 11:09 AM >>>>> To: JMeter Users List >>>>> Subject: Bad Throughput with Preprocessor >>>>> >>>>> Hello all, >>>>> >>>>> I want to test with dynamic-generated Url. I found there is a huge >>>>> drop in throughput when I use preprocessor (even an empty >>>>> preprocessor) for the HTTP sampler. The difference is as much as ten >>>>> times in my test. Do any of you have any suggestion what to use if I >>>>> have to implement some logics for the sampler? Any advice will be >>>>> greatly appreciated. >>>>> >>>>> >>>>> >>>>> Thanks, >>>>> Jacky >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >>>>> For additional commands, e-mail: user-help@jmeter.apache.org >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >>>>> For additional commands, e-mail: user-help@jmeter.apache.org >>>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >>>> For additional commands, e-mail: user-help@jmeter.apache.org >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >>> For additional commands, e-mail: user-help@jmeter.apache.org >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >> For additional commands, e-mail: user-help@jmeter.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > For additional commands, e-mail: user-help@jmeter.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org For additional commands, e-mail: user-help@jmeter.apache.org