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
HttpParser.parsedHeader consume too much memory #6493
Comments
@leoluecken83 Can you give us the exact stack trace of the areas you circled in red? |
@gregw is this related issue 5562? |
this profile generated by async-profiler. |
@leonchen83 OK I can see the full stack traces now, so it is indeed effort spent building the header cache. But again, I can't tell you much more unless you can give me examples of the headers/requests being sent. |
we refresh chrome and execute above requests many times, then we got the profiler |
Ahhh!!! The proposed fix for #5562 of only creating the expensive header cache on a second request was taken out of the fix for #5562. @leonchen83 it is really important for us to see the headers of your requests so that we can improve our cache handling. It may just be that you have non-persistent HTTP requests, so the cache is never used. @sbordet Can you re-evaluate your feedback on #5562 - as I think only creating the cache on a second request may well be helpful here. |
@leonchen83 our comments passed! Thanks for that. You are using curl to send individal requests with lots of custom headers. So each connection only ever has a single request, thus the header cache is of zero use to you (unless your real load actually does use persistent connections). If you only ever have a single request per connection, then set the header cache size to 0. @sbordet I really REALLY think we should reconsider the original fix to #5562 and only create the expensive ArrayTrie if we have a second request! |
Delay creating a header cache until a second request on a parser. Signed-off-by: Greg Wilkins <gregw@webtide.com>
Delay creating a header cache until a second request on a parser. Signed-off-by: Greg Wilkins <gregw@webtide.com>
Refactored cache code into subclass Signed-off-by: Greg Wilkins <gregw@webtide.com>
Jetty version(s)
10.0.5
Java version/vendor
(use: java -version)
openjdk version "11.0.2"
OS type/version
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
Description
HttpParser.parsedHeader consume too much memory than jetty 9.4
How to reproduce?
jetty 10.0.5
more details see attachment
admin-20210702-01.zip
The text was updated successfully, but these errors were encountered: