Sun Java System Web Proxy Server 4.0.8 管理指南

使用高速缓存命令行界面

代理服务器自带若干个命令行实用程序,可以通过它们配置、更改、生成和修复高速缓存目录结构。这些实用程序中的大多数都与 Server Manager 页面的功能完全相同,但在需要进行维护调度时可能需要使用这些实用程序(例如,作为计时程序作业)。所有这些实用程序都位于 extras 目录中。

Procedure运行命令行实用程序

  1. 从命令行提示符下,转到 server_root/proxy-serverid 目录。

  2. 键入 ./start -shell

    以下各节介绍了各种实用程序。

生成高速缓存目录结构

cbuild 代理实用程序是一个脱机高速缓存数据库管理器。可以通过该实用程序使用命令行界面来创建新的高速缓存结构或修改现有的高速缓存结构。可以使用 Server Manager 页面来使代理服务器能够使用新创建的高速缓存。


注 –

该实用程序不更新 server.xml 文件。cbuild 不能调整具有多个分区的高速缓存的大小。通过 cbuild 创建或修改高速缓存时,应在 server.xml 文件中手动更新 cachecapacity 参数。

<PARTITION partitionname="part1" partitiondir="/home/build/install9
/proxy-server1/cache" maxsize="1600" minspace="5" enabled="true"/>
<CACHE enabled="true" cachecapacity="2000" cachedir="/tmp/cache">

可以在两种模式下调用 cbuild 实用程序。第一种模式为:

cbuild -d conf-dir -c cache-dir -s cache size 
cbuild -d conf-dir -c cache-dir -s cache size -r

例如:

cbuild -d server_root/proxy-serverid/config 
	-c server_root/proxy-serverid/cache -s 512
cbuild -d server_root/proxy-serverid/config 
	-c server_root/proxy-serverid/cache -s 512 -r

其中,

第二种模式为:

cbuild -d conf-dir -c cache-dir -n cache-dim
cbuild -d conf-dir -c cache-dir -n cache-dim -r

例如:

cbuild -d server_root/proxy-serverid/config 
	-c server_root/proxy-serverid/cache -n 3
cbuild -d server_root/proxy-serverid/config 
	-c server_root/proxy-serverid/cache -n 3 -r

其中,

管理高速缓存 URL 列表

代理实用程序 urldb 用于管理高速缓存中的 URL 列表。可以使用此实用程序列出高速缓存的 URL。也可以有选择地废止和删除高速缓存数据库中高速缓存的对象。

可以根据 -o 选项将 urldb 命令分为三个组:

管理高速缓存垃圾收集

通过 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

其中,

管理批量更新

bu 实用程序用于更新高速缓存,它在两种模式下工作。在第一种模式下,该实用程序循环遍历高速缓存数据库并通过发送对每个 URL 的 HTTP 请求更新高速缓存中存在的所有 URL。在第二种模式下,它从给定 URL 开始,对从该 URL 到您指定的深度的 URL 的所有链接执行广度优先遍历,获取页面并将其置于高速缓存中。bu 是符合 RFC 标准的爬虫程序 (robot)。

bu -n hostname -p port -t time-lmt -f contact-address -s sleep-time -o object -r n -d conf-dir

例如:

bu -n phoenix -p 80 -t 3600 -f admin@phoenix.com -s 60 -o nova -r n 
	-d server-root/proxy-serverid/config

其中,