Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 76759104A2 for ; Wed, 19 Feb 2014 22:14:50 +0000 (UTC) Received: (qmail 9568 invoked by uid 500); 19 Feb 2014 22:14:50 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 9504 invoked by uid 500); 19 Feb 2014 22:14:49 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 9494 invoked by uid 99); 19 Feb 2014 22:14:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 22:14:49 +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 philippe.mouawad@gmail.com designates 209.85.223.176 as permitted sender) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 22:14:43 +0000 Received: by mail-ie0-f176.google.com with SMTP id rd18so721586iec.35 for ; Wed, 19 Feb 2014 14:14:23 -0800 (PST) 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=r75sN7UM128A1kcSMdjljGVPq718ZnS1s1jY8SMzcDk=; b=h3MSDUyby/w1N8UtKwk+0tIhb4JcGl7uBz7qRAjxppinIne8/6RmMoBC21S2OFGT+t tAMi27oGteGcABjWozd7oIi+VO3FMAxQb+RP9GGbKpdL8nkB9A4BRg9FkpMROWl27gpD vDQB4VSb6se1MlocHqbyVvs8l+EsEVYu9PAIZUHYIYIwiMmQDapFl7d/AyHFdbrDu0zs 6sGr+zquc/zV7F7AznzW5pHVhzn2jIMJjMFWJas1Nqv9GkIJ6gfmCVbLx+jS3z9+5stL FNWojgNJOBcRgINUiXAC8U9vMgpK79gPlGL3t6kXkpCQApWxPSkNpZ5wslbUwz9iPiaH 9a8Q== MIME-Version: 1.0 X-Received: by 10.43.58.19 with SMTP id wi19mr3738649icb.53.1392848063187; Wed, 19 Feb 2014 14:14:23 -0800 (PST) Received: by 10.43.64.212 with HTTP; Wed, 19 Feb 2014 14:14:23 -0800 (PST) In-Reply-To: References: Date: Wed, 19 Feb 2014 23:14:23 +0100 Message-ID: Subject: Re: Bug 56119 - dealing with idle connection timeout and dropped connection From: Philippe Mouawad To: "dev@jmeter.apache.org" Content-Type: multipart/alternative; boundary=bcaec51f966308517f04f2c9b6bd X-Virus-Checked: Checked by ClamAV on apache.org --bcaec51f966308517f04f2c9b6bd Content-Type: text/plain; charset=ISO-8859-1 Sebb, what do you mean by jmeter.a.o ? On Wed, Feb 19, 2014 at 10:51 PM, sebb wrote: > On 19 February 2014 21:03, Philippe Mouawad > wrote: > > On Wed, Feb 19, 2014 at 9:58 PM, sebb wrote: > > > >> On 19 February 2014 18:49, sebb wrote: > >> > It looks as though the problem reported in Bug 56119 was due to the > >> > server dropping connections that have been idle too long. > >> > > >> > There may also be servers that only allow a connection to be reused a > >> > certain number of times (this does not seem to have been the case > >> > here). > >> > > >> > This email is to discuss what JMeter could perhaps do to make it > >> > easier to test such servers. > >> > > >> > The two existing work-rounds are: > >> > - disable Keep-Alive > >> > - enable staleCheck > >> > > >> > Neither is ideal; the first is awkward to use, and staleCheck can > >> > generate unnecessary additional traffic (which is why it was disabled > >> > in 2.11). > >> > > >> > I can think of two possible approaches: > >> > > >> > 1) proactively shut connections. This would be easy for servers that > >> > limit reuse. > >> > Just count reuses and turn off keep-alive when a specified limit is > >> reached. > >> > Not so easy for idle timeouts; one cannot retroactively disable > >> keep-alive. > >> > > >> > 2) Deal with the disconnects when they occur. > >> > The code needs to distinguish which errors are retriable, and may need > >> > to distinguish at what point the failure occurs. For example, even a > >> > POST ought to be retriable if JMeter is unable to send any data on the > >> > connection. > >> > > >> > Also need to consider how one might report retries. > >> > I think the tester needs to be able to find out if additional requests > >> > have been made by JMeter. > >> > >> Further testing against the ASF servers shows that HC 4.2.x does > >> handle idle timeouts without needing to use the staleCheck option. > >> This relies on the server sending a header of the form: > >> > >> Keep-Alive: timeout=5, max=100 > >> > >> In this case, the connection is automatically recreated if necessary > >> when the next sampler runs. > >> If the server fails to send the header, then the connection may be > >> dropped unexpectedly (which is what was happening with Bug 56119). > >> So another approach might be to allow an optional keep-alive timeout > >> in case the server does not provide one. > >> > >> Or we could take the view that there is nothing to fix in JMeter. > >> The Keep-Alive header is there for a reason, it tells the client when > >> it is safe to reuse the connectiion. > >> If the server fails to send it, then it is broken, and so the failed > >> samples are to be expected. > >> > > > > I think we need to make something at least for servers like Amazon S3 > which > > close connections after number of uses. > > Did you check to see if this kind of server send a keep alive header ? > > I just tested again with jmeter.a.o. > It returns headers of the form: > > Keep-Alive: timeout=5, max=100 > Connection: Keep-Alive > ... > Keep-Alive: timeout=5, max=99 > Connection: Keep-Alive > ... > etc > ... > Keep-Alive: timeout=5, max=1 > Connection: Keep-Alive > ... > Connection: close > > So the HC connection manager does not need to keep track of the > remaining re-use count; the server disconnects at the end of the last > request. > Nice and simple. > > I assume S3 does the same as jmeter.a.o if it is well-behaved. > > > Anyway on my side I think what has been changed in 2.11 should not be > > reverted, because for servers correctly configured you don't get these > > errors, I made 3 campaigns on different servers with 2.11 and never got > > this kind of issues. > > Agreed, no need to revert. > > > But maybe we should document it better somewhere. > > Yes, the error and likely cause should be documented. > Probably easiest to start as a Wiki page. > > > > > > > -- > > Cordialement. > > Philippe Mouawad. > -- Cordialement. Philippe Mouawad. --bcaec51f966308517f04f2c9b6bd--