RE: [Simpleweb-Support] Problem when stress testing an application using SimpleWeb
Brought to you by:
niallg
From: Niall G. <gal...@ya...> - 2005-07-26 19:23:58
|
Hi Henry, The reason the connection is closed is because RFC 2616 says that this is the way this must be done! For example, that the scenario where the request conatins a larger chunked encoded message body, and then you read only half of it. If the poller is not closed, where do you read the next request header from? Also if you send some wrong information how is the browser supposed to interpret it? Anyway, there is a large section in the HTTP/1.1 specification that discusses pipelining and its semantics. It should provide some more detail. Niall --- Henry Voyer <hen...@ge...> wrote: > Re Hi Neil, > > Well i found the problem and fixed it. And i would > like your input about it. > The problem is when the client suddently close the > stream and this happens > often in highly concurrent transactions. > > java.io.IOException: Stream closed > at > java.io.PushbackInputStream.ensureOpen(PushbackInputStream.java:57) > at > java.io.PushbackInputStream.unread(PushbackInputStream.java:181) > at > simple.http.PollerInputStream.available(PollerInputStream.java:114) > at > simple.http.BasicPoller.process(BasicPoller.java:117) > at > simple.http.Processor.execute(Processor.java:121) > at simple.http.Processor.run(Processor.java:83) > at java.lang.Thread.run(Thread.java:595) > > Then the exception makes the closes the poller > > This happens, in the class : simple.http.Processor > > private void execute() throws InterruptedException > { > Object top = queue.dequeue(); > Poller poller = (Poller)top; > try{ > poller.process(proc); > }catch(Exception e){ > poller.close(); > } > } > > Why close the poller? > > > My fix consist in removing the try catch, and > removing the line of the > pooler.close > > the code is : > > private void execute() throws IOException, > InterruptedException { > Object top = queue.dequeue(); > Poller poller = (Poller) top; > poller.process(proc); > } > > then is catched in the run method > > public void run() { > while (alive) { > try { > execute(); > } > catch (IOException e) { > l > } > catch (InterruptedException e) { > logger.error("Interrupted exception > while executing an request", > e); > } > } > } > > > -----Original Message----- > From: sim...@li... > [mailto:sim...@li...]On > Behalf Of Henry > Voyer > Sent: Tuesday, July 26, 2005 1:06 PM > To: sim...@li... > Cc: jor...@ge... > Subject: RE: [Simpleweb-Support] Problem when stress > testing an > application using SimpleWeb > > > Hi Neil, > > Thanks for answering. > > We know thats part of the problem. But for the HTTP > processing that doesnt > mean that simple has to stop processing more > requests comming from the same > or other clients. It looks like the poller.close() > does just that. One error > and everything stops. > > Il continue checking to see exactly at what > request/ratio it happens and > exacly why. > > Regards > And thanks > > henry > > > > > -----Original Message----- > From: sim...@li... > [mailto:sim...@li...]On > Behalf Of Niall > Gallagher > Sent: Tuesday, July 26, 2005 10:53 AM > To: sim...@li... > Subject: Re: [Simpleweb-Support] Problem when stress > testing an > application using SimpleWeb > > > Hi Henry, > > The stream has been closed because of an error! An > error has occured probably because the HTTP request > contained a message body. At any rate there is some > HTTP/1.1 violation with delimeters. > > Has your request got a message body that you have > failed to read? > > Niall > > --- Henry Voyer <hen...@ge...> wrote: > > > Hi everyone > > > > I have been stress testing an extensive > transaction > > oriented application > > that uses simple. > > The stress test consist of using jmeter with > around > > 20 threads sending 500 > > requests each to my server. > > > > After a couple of minutes the system stops. > > > > So i started putting logs and found the section > > where the errors occurs. > > The code : > > > > simple.http.Processor > > > > private void execute() throws > InterruptedException > > { > > logger.debug("Reading a process"); > > Object top = queue.dequeue(); > > logger.debug("Processing " + > > ToStringBuilder.reflectionToString(top)); > > Poller poller = (Poller)top; > > try{ > > logger.debug("Who is being processed " + > > ToStringBuilder.reflectionToString(proc)); > > poller.process(proc); > > logger.debug("Finishing pooler"); > > }catch(Exception e){ > > logger.error("Closing the pooler due to: > ", > > e); > > poller.close(); > > } > > } > > > > The exception is: > > > > ERROR 2005-07-26 10:02:00,125 Processor.execute - > > Closing the pooler due to: > > java.io.IOException: Stream closed > > at > > > java.io.PushbackInputStream.ensureOpen(PushbackInputStream.java:57) > > at > > > java.io.PushbackInputStream.unread(PushbackInputStream.java:181) > > at > simple.http.PollerInputStream.available(Unknown > > Source) > > at simple.http.BasicPoller.process(Unknown > Source) > > at simple.http.Processor.execute(Unknown Source) > > at simple.http.Processor.run(Unknown Source) > > at java.lang.Thread.run(Thread.java:595) > > > > My configuration is: > > > > System.setProperty("simple.http.load.mapper", > > custommapper); > > System.setProperty("simple.http.poller", > > "simple.http.GranularPoller"); > === message truncated === Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |