
Tuning
Setthe maximum age based on whether the content is updated (existing les are modied) on a
regularschedule. For example, if content is updated four times a day at regular intervals, you
couldset the maximum age to 21600 seconds (6 hours). Otherwise, consider setting the
maximumage to the longest time you are willing to serve the previous version of a content le
afterthe le has been modied. If your web site’s content changes infrequently, you might want
toincrease this value for improved performance.
Setthe maximum age in the Admin Console in the Maximum Age eld on the conguration's
Performancetab ⇒Cache tab, under File Cache. In the command-line interface, use wadm
set-file-cache-propand change the max-age property. The default value is 30 seconds. The
rangeof values is 0.001-3600.
MaximumHeap Cache SizeTheoptimal cache heap size depends upon how much system memory is free. A larger heap size
meansthat the Web Server can cache more content and therefore get a better hit ratio.
However,the heap size should not be so large that the operating system starts paging cached
les.
Tuning
Setthe maximum heap size in the Admin Console in the Maximum Heap Space Size eld on the
conguration'sPerformance tab ⇒Cache tab, under File Cache. In the command-line
interface,use wadm set-file-cache-prop and change the max-heap-space property. The
defaultvalue is 10485760 bytes. The range of values is 0-9223372036854775807. In a 32–bit
WebServer, since processes have four GBs of address space for the le cache, the value should
bewell under four GB.
Usingthe nocache ParameterYoucan use the parameter nocache for the Service function send-file to specify that les in a
certaindirectory should not be cached. Make this change by editing obj.conf. For example, if
youhave a set of les that changes too rapidly for caching to be useful, you can put them into a
directoryand instruct the server not to cache les in that directory by editing obj.conf.
Example<Object name=default>
...
NameTrans fn="pfx2dir"from="/myurl"dir="/export/mydir"
name="myname"
...
Service method=(GET|HEAD|POST) type=*~magnus-internal/*
fn=send-file
UsingMonitoringData to TuneYour Server
Chapter2 • Tuning Sun Java System Web Server 63