-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Content-Length using Undertow or Jetty #467
Comments
Can you create a demo app at github so I can look? Also, did you try the jooby asset module: http://jooby.org/doc/assets/ How did you run the tests? 7300 doesn't seem to fast, but of course depends on what you run there. We did pretty good at Techempower benchmark. They use wrk |
I will try to prepare demo app. Yes, I'm using assets module. I did simple test on my local machine, it was just rendering home page (Jade without cache), resolving session etc. Results are GOOD. PHP7 (Laravel with caches, optimized page) has 650req/s. Similar page. ;) Netty on my production server has 9600 req/s (Jooby in production mode). The test was not for checking general performance of Jooby - which is awesome, but for checking which one web server is the fastest one with Jooby. I was using JMeter. 2 months ago I found Jooby on Techempower benchmark - that's why I'm here! :) |
glad you're happy with a jooby performance is better than Spring/Play.. just there was a recent discussion in reddit about jooby performance and that was the reason I asked about it. demo app will great to see and/or reproduce the content-length errors between servers (these type of errors are tricky) |
Well, the issue with Undertow server is just size of file served via assets module. Didn't check Jetty. Here's working example. I couldn't replicate issue with JavaScript file, but finally I did it! Just in my case the .js file is quite big, it's Angular app in debug mode: 1.162kB. So the issue is not with "replacing" file by newer version, but with sending it. I think both web servers have limits. |
@marcinc81 thanks a lot for the examples. I was able to reproduce and fix in both servers. Problem was exactly the same in both 😄 Wasn't not a content-lenght problem (necessarily)... it was related to asynchronous sending of larger files (> 16kb) and closing the connection too early. Will push the fixes later today, thanks again. |
Yesterday I was doing comparison of all 3 servers: Netty, Jetty and Undertow. By the way Undertow is the fastest one, Netty is next, last is Jetty. Really small difference: 7300req/s - 6300req/s. For sure no one will notice this difference in production.
Anyway, I changed server to Undertow as it is the winner and found weird issue. After changing some asset (eg. generated JavaScript from Gulp/Browserify), browser sends this error message:
GET http://localhost:8080/assets/js/forms.js net::ERR_CONTENT_LENGTH_MISMATCH
And indeed, in HTTP header Jooby sets content length different than sent file has in reality. Doesn't help reloading app, start / stop, mvn clean, etc. And this is weird. Probably this issue doesn't apply in a production where assets are static.
The same issue is with Jetty, but in this case this web server logs exception:
Additionally Jetty has problem with serving one image (png, 1954544 bytes) - sends only first 800kB, and browser displays the same error (content length mismatch).
Switching back to Netty resolves the problem.
Cheers! :)
The text was updated successfully, but these errors were encountered: