This is the warning message we get when cachingAllowed is not set to false
org.apache.catalina.webresources.Cache.getResource Unable to add the resource
at [/WEB-INF/classes/] to the cache for web application [/x] because there
was insufficient free space available after evicting expired cache entries -
consider increasing the maximum size of the cache.
Regards
Jalaj P Asher
-Original Message-
From: Jalaj Asher
Sent: Tuesday, July 16, 2024 1:30 PM
To: Tomcat Users List
Subject: RE: Reg: tomcat CPU spikes
> space". Which was very quickly filling up our disk space as well as
> increasing disk IO causing latency concerns.
1. Also interesting. Can you post one of those messages here? Was there a stack
trace shown or just the warning?
It is just the warning. No stack trace. I will work on recreating this
since all our environments has this disabled.
2. Interesting. How much static content do you have? This seems like a good
use-case for a reverse-proxy to handle your staticcontent for you.
We have not collated the complete size of it. But are reasons we cannot do that.
Also I was reviewing some older heap dumps and I could see that the jars are
getting cached in tomcat even with cachingAllowed=false.
Also this is not a consistent issue once it happens it takes sometime for the
stack to go away as well as post tomcat reboots the problem goes away with the
same settings and we do see that the wars are getting deployed during tomcat
startup as well.
Regards
Jalaj P Asher
-Original Message-
From: Christopher Schultz
Sent: Tuesday, July 16, 2024 10:05 AM
To: users@tomcat.apache.org
Subject: Re: Reg: tomcat CPU spikes
Attention! - This email has originated from an External Source outside of
eClinicalWorks. Always use caution when opening attachments, clicking links, or
when responding to this email. If you feel this is a phishing scam, please use
the Phish Alert Report button in Outlook.
Jalaj,
On 7/15/24 18:18, Jalaj Asher wrote:
> We ran into 2 issues
> 1. We needed to allocate significant amount of -XMX for heap space,
> if we allowed caching, since increasing memory by a few hundred MB as
> well was not enough.
Interesting. How much static content do you have? This seems like a good
use-case for a reverse-proxy to handle your static content for you.
> 2. Also with the setting being enabled, it generated logs stating
> "could not add a resource as there wasn’t enough
> space". Which was very quickly filling up our disk space as well as
> increasing disk IO causing latency concerns.
Also interesting. Can you post one of those messages here? Was there a stack
trace shown or just the warning?
-chris
> -Original Message-
> From: Christopher Schultz
> Sent: Monday, July 15, 2024 4:19 PM
> To: users@tomcat.apache.org
> Subject: Re: Reg: tomcat CPU spikes
>
> Attention! - This email has originated from an External Source outside of
> eClinicalWorks. Always use caution when opening attachments, clicking links,
> or when responding to this email. If you feel this is a phishing scam, please
> use the Phish Alert Report button in Outlook.
>
>
> Jalaj,
>
> On 7/15/24 15:03, Jalaj Asher wrote:
>> Yeah I was wondering the same as this has been in place since a few
>> years now atleast 4 years since cachingAllowed had some changes in
>> tomcat 8 which was resulting in it caching all static content as well
>> as jsps and jars and our though process was if we have static content
>> being cached on the client end and jsps in the work folder each time
>> on access we don’t need the cache.
> Does the cache actively hurt you?
>
>> Is there a way to cache just the jars and not every thing else in memory ?
>
> I think the short answer is "no there is not a way to do this" but I may be
> wrong.
>
> The long answer might be "maybe, but you will have to play games with
> and and maybe some other things to get it
> working.
>
> I would save yourself some complexity and simply enable caching.
>
> -chris
>
>> -Original Message-
>> From: Christopher Schultz
>> Sent: Friday, July 12, 2024 4:02 PM
>> To: users@tomcat.apache.org
>> Subject: Re: Reg: tomcat CPU spikes
>>
>> Attention! - This email has originated from an External Source outside of
>> eClinicalWorks. Always use caution when opening attachments, clicking links,
>> or when responding to this email. If you feel this is a phishing scam,
>> please use the Phish Alert Report button in Outlook.
>>
>>
>> Jalaj,
>>
>> On 7/12/24 10:19, Jalaj Asher wrote:
>>> Thank you Chuck and John for the responses.
>>>
>>> Just a few points from the things you highlighted and wanted me to
>>> check 1. unpackwar is set to true. I checked and was informed that we need
>>> that to be true for a specific war file.
>>> 2. cachingAllowed=false. We keep it as false across the board.
>>
>> Well... that'll do it. In order to locate resources, Tomcat needs to sift
>> through all of those JAR files every time. Scan