Thierry,

It's funny that I can very easily reproduce the problem. Using the test case I provided, the minimal setup (only the required restlet related jars), using Restlet 1.01, etc. With Apache Bench, it's real obvious there are problems.

I switched to Asyncweb to try it out. However, I'm getting different sorts of errors with Asyncweb, particularly as it relates to the content length being sent back. I found a few bug reports that seem outstanding for Asyncweb and keep alive. Basically, the headers coming back from Asyncweb aren't correct when under load.

Anyway, so I'm back to using Jetty now. Everything is perfect using Jetty. I can hammer it with AB and not see any of the errors or problems that I described. This is with or without keep-alive on.

My take? Jetty still wins and the others just aren't there yet. Who knows what the issues could be though.

I still think this might be related to the other bug report. Maybe those guys (Jim, Stian) want to test their application on Jetty and see if it clears up their problem?

I haven't tried to isolate the problem as either for sure being in the noelios engine, or if the problems are in the web servers themselves. That's just too much work, I've got to move on.

Thanks,

Adam


Thierry Boileau wrote:
Hi Adam,

Actually, I sent the post ten times, and it didn't fail. Hum, I don't know what can happen.

Thierry


The first post's http headers are similar to yours. However, as mentioned in my email, it's the second post that times out. After doing the first post, with success, hit the reload/refresh button. Do you get a timeout? I do.

Disabling keep alive in the browser (using about:config) does not cause any problems for any number of posts.

Adam

p.s. Happy to provide the http headers as you request, however for the second post I don't get any. The live headers extension must work after a successful session has been completed.

Thierry Boileau wrote:
Hello Adam,

I didn'tt reproduce your problem.

Here is the requests/response headers as shown with the LiveHttpHeaders extension, could you send yours?
**************************
http://localhost:8182/

POST / HTTP/1.1
Host: localhost:8182
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: fr,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: session=AQYFYMMYWCONXQUKCDWG
Content-Type: application/x-www-form-urlencoded
Content-Length: 7
foo=bar

HTTP/1.x 200 The request has succeeded
Date: Tue, 05 Jun 2007 17:32:26 GMT
Server: Noelios-Restlet-Engine/@[EMAIL PROTECTED]@[EMAIL PROTECTED]@release-number@
Content-Type: text/plain; charset=ISO-8859-1
Content-Length: 11
**************************


best regards,
Thierry Boileau

I've discovered a problem with the Simple framework web server in conjunction with Keep Alive. Basically, it seems triggered by two POST requests in a row. The first POST request works fine, however a followup POST request will hang. Once a certain time has passed (in Firefox I believe it's 30 seconds), another POST request will go through.

Once a POST has been made, then any other request will timeout including GET requests, etc. After the timeout expires, all requests will work again. Also (possibly related, but not sure), I'm getting some connection resets when performing multiple GET operations quickly in a row (simply by clicking the refresh button on the browser).

I'm wondering if this is related to bug #313. It seems very similar. Is bug #313 using the Simple web server??

By disabling Keep Alive in my browser (Firefox - about:config), the problem completely goes away. It's obvious that the keep alive handling is problematic.

I've switched to the Async web server to run my tests and don't have any of the above described problems. So, that's why I'm confident it's likely in the Simple helper classes.

I'll plan on filing a bug report, but I wanted to see if this issue was known about before I did. I can't see any bug like it, but thought I'd check on the mailing list first. I'm hopeful that this issue will help whomever is being hung up on bug #313 as well.

Here's the restlet I'm using for testing purposes. Again, to see the difference, be sure to use a browser which you can disable keep alive, like Firefox.

public class RestletTest {
  private static int count = 1;
  public static void main(String[] args) throws Exception {
    Restlet restlet = new Restlet() {
      @Override
public void handle(Request request, Response response) { response.setEntity("Request #" + (count++), MediaType.TEXT_PLAIN);
      }
    };
    new Server(Protocol.HTTP, 8182, restlet).start();
  }
}

Here's an HTML file which you can use to post to the above servlet.

<html>
<body>
<form action="http://localhost:8182/"; method="POST">
<input type="hidden" name="foo" value="bar" />
<input type="submit" />
</form>
</body>
</html>


Thanks,

Adam


Reply via email to