엄지월드

[Tomcat] consider increasing the maximum size of the cache 본문

Server&DevOps

[Tomcat] consider increasing the maximum size of the cache

킨글 2025. 1. 27. 10:57

Tomcat을 통해서 배포를 하니 아래와 같이 에러가 발생했다. 

27-Jan-2025 10:50:05.675 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/META-INF/dgminfo] to the cache for web application [/web-0.0.1-SNAPSHOT] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
27-Jan-2025 10:50:05.792 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule] 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
27-Jan-2025 10:50:05.792 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule] 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
27-Jan-2025 10:50:05.872 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/META-INF/spring.components] 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
2025-01-27 10:50:05.888  INFO 13958 --- [com-startStop-1] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
27-Jan-2025 10:50:05.961 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/META-INF/spring.components] 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
27-Jan-2025 10:50:05.963 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/com/dodrambio/web/] 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
27-Jan-2025 10:50:06.009 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/META-INF/spring-autoconfigure-metadata.properties] 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
27-Jan-2025 10:50:06.104 경고 [domain.com-startStop-1] org.apache.catalina.webresources.Cache.getResources Unable to add the resource at [/WEB-INF/classes/messages.properties] 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

 

1. JVM의 메타스페이스 크기 증가 

- Tomcat을 실행할 때 -XX:MaxMetaspaceSize 옵션 추가

#!/bin/bash

TOMCAT_HOME=/home/hosting_users/domain/tomcat
cd $TOMCAT_HOME/bin

# 메타스페이스 크기 설정
export CATALINA_OPTS="-XX:MaxMetaspaceSize=512m"

# Tomcat 중지 및 시작
./shutdown.sh
./startup.sh

# 로그 출력
tail -500f $TOMCAT_HOME/logs/catalina.out

 

2. Tomcat 캐시 크기 증가

- server.xml 파일에서 <Host> 태그 내에 maxCacheSize 속성을 추가하거나 수정

<Host ...>
    ...
    <Context>
        <Resources maxCacheSize="100000" />
    </Context>
</Host>
Comments