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 D8AC110F42 for ; Thu, 27 Jun 2013 09:30:48 +0000 (UTC) Received: (qmail 17319 invoked by uid 500); 27 Jun 2013 09:30:48 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 16902 invoked by uid 500); 27 Jun 2013 09:30:41 -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 16887 invoked by uid 99); 27 Jun 2013 09:30:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 09:30:39 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ntmatter@gmail.com designates 209.85.216.179 as permitted sender) Received: from [209.85.216.179] (HELO mail-qc0-f179.google.com) (209.85.216.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jun 2013 09:30:35 +0000 Received: by mail-qc0-f179.google.com with SMTP id e11so315626qcx.38 for ; Thu, 27 Jun 2013 02:30:14 -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=19w2Ln1Osfo8jdOP9dC6HLiXyHXaf6FtnY+i6AS8C1E=; b=CVNC5bZhNGJBcbuEQ7NVIPIhCDTR5HJZJjm1T1uimCixERmorY7GVmds6ZvC1vyWbW XpKBLgVzJERU6tW/dKLhbwzqM8WKQBkIQguXTYNi7L/N8Lox2LnZFwtwuKgGJOPTE9fi YeXU/KIvanveFT3di2v+tuM1hyTIAE8fLzWdNsAxV/ceTvC6/hojPUZsbN5di2myLkU/ hgt7PPX49MArd6WnIHZodqAKfJS12OqiiItLmP1A5aAM3z1U3IjH4dn/U+XAr2DSl0i+ M554+tfpjMcOHEVsYnZ+iGVhIrvN7aIJmmyYqs1XdMn+2sYgc8k+BDqnnz90QdPBCvzJ B7pg== MIME-Version: 1.0 X-Received: by 10.229.166.2 with SMTP id k2mr2154841qcy.107.1372325414410; Thu, 27 Jun 2013 02:30:14 -0700 (PDT) Received: by 10.49.81.101 with HTTP; Thu, 27 Jun 2013 02:30:14 -0700 (PDT) In-Reply-To: References: Date: Thu, 27 Jun 2013 11:30:14 +0200 Message-ID: Subject: Re: Perl5Matcher cause CPU spike From: Thomas Johnson To: JMeter Users List Content-Type: multipart/alternative; boundary=f46d04478ac1d7a04604e01f68c1 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04478ac1d7a04604e01f68c1 Content-Type: text/plain; charset=UTF-8 As a quick question, is there any reason that you're not using the XPath extractor? It might be a bit easier to get the desired data that way if you have namespace support enabled. You could search for //*[local-name()='RfpOID' and namespace-uri()='http://rfp.testdomain.testdomain.com/v4_0'] As for the regular expression, it looks like you're using a lot of greedy wildcards (.*) in there. This is forcing the regex engine to do loads of backtracking as it tries every possible permutation to find a match. You could probably clean this up by using non-greedy wildcards and more restrictive sets instead. I have nothing to test with right now, so my syntax could be a bit off, but something like (.*?) should work a little better. It'll match any RfpOID tag belonging to a numbered namespace. On Thu, Jun 27, 2013 at 10:52 AM, Vance Zhao wrote: > Hi, > > Don't know if we have discussed this before but I found the regex lib we > used --"org.apache.oro.text.regex.Perl5Matcher" > which will consume CPU spike time during > the load testing. > > > > The response return in my case is soap which format as: > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance"> > > > > 4DBC8638-BBE0-4626-97D6-004F111F0C2B > Test > Test > 12110 > Test > 37 > > 2010-01-11 > 2010-01-12 > 2010-01-15 > > > ................................................................................. > > The regex pattern I use is: <(.*)RfpOID>(.*) to grape the > rfpOID for this response due to the namesapce prex "ns2" changes sometime > and the response of this api around big to 65k. > > The CPU will be eat quickly when I use 20 threads user load > > > - *20 Threads* ( Jmeter thread eat 97% CPU) > > > > And the thread dump from Jmeter is saying mosto the Jmeter Thread is > running for *Perl5Matcher* > * > "Before_getRfp 1-10" prio=6 tid=0x03067c00 nid=0x4874 runnable [0x04d8f000] > java.lang.Thread.State: RUNNABLE > at org.apache.oro.text.regex.Perl5Matcher.__match(Unknown Source) > at org.apache.oro.text.regex.Perl5Matcher.__match(Unknown Source) > at org.apache.oro.text.regex.Perl5Matcher.__tryExpression(Unknown > Source) > at org.apache.oro.text.regex.Perl5Matcher.__interpret(Unknown Source) > at org.apache.oro.text.regex.Perl5Matcher.contains(Unknown Source) > at > > org.apache.jmeter.extractor.RegexExtractor.matchStrings(RegexExtractor.java:234) > at > > org.apache.jmeter.extractor.RegexExtractor.processMatches(RegexExtractor.java:219) > at > org.apache.jmeter.extractor.RegexExtractor.process(RegexExtractor.java:118) > at > > org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:737) > at > > org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:438) > at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) > at java.lang.Thread.run(Unknown Source)* > > Also, the single thread load also will jump to 25% CPU utilization > > > - *Single Thread* (Jmeter thread eat 25% CPU) > > After that, I did some tests to compare Perl5Matcher with other Java perl5 > regex lib ( I use jregex). Please check my code attached. > > Time for using org.apache.oro.text.regex.Perl5Matcher 3801(ms) > > Time for using jregex 13(ms) > * > * > Thanks for reading so long but I'd like to know if we can user other regex > lib for Jmeter. > > Vance* > * > --f46d04478ac1d7a04604e01f68c1--