通过 cachegc 实用程序,您可以将可能已过期或因存在时间过久而不能高速缓存(由于受到高速缓存大小约束)的对象从高速缓存数据库删除。
请确保在使用 cachegc 实用程序时,代理服务器实例中没有运行 CacheGC。
可以按以下方式使用 cachegc 实用程序:
cachegc -f leave-fs-full-percent -u gc-high-margin-percent -l gc-low-margin-percent -e extra-margin-percent -d conf-dir
例如:
cachegc -f 50 -u 80 -l 60 -e 5 -d server-root/proxy-serverid/config
其中,
leave-fs-full-percent 确定高速缓存分区大小的百分比,低于该值时将不进行垃圾收集
gc-high-margin-percent 控制最大高速缓存大小的百分比,达到此百分比时即会触发垃圾收集
gc-low-margin-percent 控制作为垃圾收集器目标的最大高速缓存大小的百分比
extra-margin-percent 由垃圾收集器用于确定要删除高速缓存的百分比。
conf-dir 是代理服务器实例的配置目录,它位于 server-root/proxy-serverid/config 目录中。