org.apache.catalina.webresources.Cache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [/filestore] - consider increasing the maximum s
需要耐心啊,太急于求成,希望直接就得到解决方法了...以至于正确方法都已经出现了,我却没有耐心看下去,所以反而又耽误了不少时间....
项目加载100+张图片,还有一个小的MP4,所以console警告缓存不够
org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/base/1325/WA6144-150x112.jpg] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
The background cache eviction process was unable to free [10] percent of the cache for Context [/liuda] - consider increasing the maximum size of the cache. After eviction approximately [11,145] KB of data remained in the cache
反正就是缓存不够了
上面链接是stackoverflow上出现的和我一样的错误,第二个答案成功的解决了这个警告,就是把缓存弄大点。一开始没耐心看答案,直接把代码加进server.xml了,正确的应该是加到context.xml
<Resources cachingAllowed="true" cacheMaxSize="100000" />
作者:我比风更自由
来源:CSDN
原文:https://blog.csdn.net/qq_26684469/article/details/52346667
版权声明:本文为博主原创文章,转载请附上博文链接!
背景资料
一个WebSource是在Web应用程序中的文件或目录。出于性能原因,Tomcat可以缓存WebSource。默认情况下,静态资源缓存(总共所有资源)的最大值为 10240千字节(10 MB)。在请求webResource时(例如,在加载静态图像时),webResource被加载到缓存中,然后将其称为缓存条目。每个缓存条目都有一个TTL(生存时间),这是允许缓存条目保留在缓存中的时间。当TTL过期时,缓存条目有资格从缓存中删除。cacheTTL的默认值为5000毫秒(5秒)。
加载webResource时,代码会计算缓存的新大小。如果计算的大小大于默认的最大大小,则必须删除一个或多个缓存的条目,否则新大小将超过最大值。因此代码将计算“targetSize”,这是缓存希望保持的大小(作为最佳值),默认情况下为95%。为了达到此targetSize,必须从缓存中删除/逐出条目。
因此,当其TTL过期且尚未达到targetSize时,将删除缓存条目。
在尝试通过逐出缓存条目来释放缓存之后
因此,如果在尝试释放缓存后,大小仍然超过最大值,它将显示有关无法释放的警告消息:
cache.addFail=Unable to add the resource at [{0}] to the cache for web application [{1}] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
问题
因此,正如警告信息所述,问题是
insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
如果您的Web应用程序在短时间(5秒)内加载了大量未缓存的webResources(大约最大缓存,默认为10mb),那么您将收到警告。
当Tomcat 7无法释放缓存时,它根本不会输出任何警告,而Tomcat 8将输出警告。
因此,如果您使用的Tomcat 8具有与Tomcat 7相同的默认缓存配置,并且您在Tomcat 8中收到警告,那么Tomcat 7的(和我的)缓存设置在没有警告的情况下表现不佳。
解决方案
有多种解决方案:
- 增加缓存(推荐)
- 降低TTL(不推荐)
- 禁止缓存日志警告(不推荐)
- 禁用缓存
通过在Context元素中添加$CATALINA_BASE/conf/context.xml“XXXXX”代表增加的高速缓存大小,以kbytes为单位。默认值为10240(10 MB),因此请设置大于此值的大小。
<Resources cacheMaxSize="XXXXX" />
您必须调整以获得最佳设置。请注意,当您突然增加流量/资源请求时,问题可能会再次出现。
org.apache.catalina.webresources.Cache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [/filestore] - consider increasing the maximum s的更多相关文章
- org.apache.catalina.webresources.Cache.getResource Unable to add the resource
org.apache.catalina.webresources.Cache.getResource Unable to add the resource at xxx to the cache be ...
- Tomcat8 启动中提示 org.apache.catalina.webresources.Cache.getResource Unable to add the resource
Tomcat8 启动过程中提示: org.apache.catalina.webresources.Cache.getResource Unable to add the resource at xx ...
- at org.apache.catalina.webresources.CachedResource.validateResources
"catalina-exec-659" #5239 daemon prio=5 os_prio=0 tid=0x00007fcba8099800 nid=0x581 waiting ...
- Failed to initialize component [org.apache.catalina.webresources.JarResource
去本地仓库里删除掉对应出错的jar包,然后回到pom里面加个空行 让他重新下载(最好把maven仓库全部都删了 重新下载一次 ) 先备份 在复制回来 完美解决
- consider increasing the maximum size of the cache.
虚拟机上搭建jenkins,出现unable to free [10] percent of the cache for Context [/jenkins] 提示让我加大缓存 consider in ...
- org.apache.catalina.LifecycleException: Failed to start component
1.错误描述 Using CATALINA_BASE: "D:\NetBeans\apache-tomcat-8.0.12" Using CATALINA_HOME: " ...
- org.apache.catalina.LifecycleException: Failed to stop component(生命周期异常)
真是郁闷透顶,以前昨天还可以用,换了myeclipse自带的tomcat就可以用: 异常: org.apache.catalina.LifecycleException: Failed to stop ...
- java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]
本文为博主原创,未经允许不得转载: 被坑了好长时间的bug,差点就要重新配置环境,重新下载,重新开始的境遇.在此记录一下: 首先展示一下报错的异常: -Apr- ::] org.apache.cata ...
- Tomcat启动报错:org.apache.catalina.LifecycleException: Failed to start component...java.util.zip.ZipException: error in opening zip file
1.项目环境 IntelliJ IDEA2018.1.6 apache-tomcat-8.0.53 基于springboot开发的项目 maven3.5.3 2.出现问题 从svn同步下项目 启动to ...
随机推荐
- Testlink设置
1. Testlink配置修改 1.1. config.inc.php 1.1.1. 日志路径配置 /** * @var string Path to store logs - *for securi ...
- Ubuntu18.10设置静态IP、DNS、卸载无用软件
设置静态IP root@xueji:~# vim /etc/network/interfaces # interfaces() ) and ifdown() auto lo iface lo inet ...
- restful 风格 加上springmvc
一.spring 版本:spring-framework-3.2.7.RELEASE 二.所需其它Jar包: 三.主要代码: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
- Java @Validated 遇到的大坑
我在一个Controller内,在两个方法内使用@Validated,这是两个POST方法会进入的方法,这两个方法的实体类的命名(下图红框内容)不能一样,一样的话就会导致第二个在页面显示不出来错误信息 ...
- React Router 4.0中文快速入门
import React from 'react' import { BrowserRouter as Router, Route, Link } from 'react-router-dom' co ...
- 一、Postgresql的基本操作
---------------------------------------------------------------------------------------------------- ...
- JAVA 员工管理系统(用抽象类实现),简易版。
package Demo513; /* 定义一个Employee类,该类包含: private 成员变量name,number,birthday,其中birthday为MyDate类的对象: abst ...
- 转:error LNK2005: ...already defined in MSVCRTD.lib
编译错误: Error1error LNK2005: _CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR110D.dll)\libcmtd.l ...
- 首次将项目从svn下载到eclipse
1.点击 File --> Import,进入导入项目窗口 2.选择从SVN检出项目,点击Next 3.选择创建新的资源库位置,点击Next 4.在URL处输入SVN项目远程地址,点击Next ...
- BZOJ 2725: [Violet 6]故乡的梦 最短路+线段树
2725: [Violet 6]故乡的梦 Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 678 Solved: 204[Submit][Status ...