GZipFilter throwing several exceptions and dramatically slowing down requests

Description

On some of our systems, we see a lot of errors in our logs that look like this:

 See attached log file snippet for what this looks like for just one request for the home page after starting up the server.

These errors are coupled with very slow page load times, and these issues appear to be related.

It is not 100% clear how to reproduce these conditions - whether it is a result of file / user permissions, deployment approach, etc.  This particular set of conditions was found deploying one of our existing Rwanda distributions onto a Vagrant box running Ubuntu 20.04, Tomcat 7, and Java 8.

 

Attachments

4

Activity

Show:

Grace Potma February 22, 2021 at 4:28 PM

Closing since this work was committed. 

Daniel Kayiwa December 3, 2020 at 6:26 PM

Committed at https://github.com/openmrs/openmrs-core/commit/8d89376aa928ff8a04303dae9b992db78b27b28d

if you can confirm that this fixes the reported problems, we can forward port it.

Mike Seaton November 30, 2020 at 9:10 PM

NOTE on the above - I think our recommendations should be that all implementations turn gzip.enabled = false, and configure Tomcat or Apache to handle compression of responses as required.  This is my "fix" to get past this issue for the implementation work I am currently doing, but we should get this investigated and fixed within core.

Mike Seaton November 30, 2020 at 9:04 PM

Some additional metrics:

When I have "gzip.enabled = true", my Tomcat localhost access log shows considerable delays intermittently.  This seems to correspond to a certain number of requests that have been processed.  In each case, after 15 requests for a given page, a delay of around 20 seconds is seen before further requests are logged.  After that, the number of requests varies (10, 11, etc) before another delay of around 20 seconds is seen.  This should be investigated - seems plausible that there is some sort of memory leak or thread/request/memory limit or other locking/contention that wrapping the Response in a GZIPResponseWrapper imposes.  Attached file shows snippets of my localhost access log with timings for several basic UI pages, both with gzip.enabled = true and gzip.enabled = false.

 /  /  /   FYI in case you have any thoughts.

Fixed

Details

Assignee

Reporter

Complexity

Low

Affects versions

Priority

Created November 30, 2020 at 5:30 PM
Updated November 16, 2022 at 10:11 PM
Resolved February 22, 2021 at 4:28 PM