Inthe previous example, the server does not stat for path /ntrans-base/nsfc and
/ntrans-base/nsfc/*if ntrans-base is set. If ntrans-base is not set, the server does not stat for
URLs/nsfc and /nsfc/*. By default, ntrans-base is set. The example assumes the default
PathCheckserver functions are used.
Whenyou use nostat= virtual-path in the assign-name NameTrans, the server assumes that
staton the specied virtual-path will fail. Therefore, use nostat only when the path of the
virtual-pathdoes not exist on the system, for example, in NSAPI plug-in URLs. Using nostat
onthose URLs improves performance by avoiding unnecessary stats on those URLs.
Formore information about obj.conf, see the Sun Java System Web Server 7.0 Update 1
Administrator’sConguration FileReference.
UsingBusy Functions
Thedefault busy function returns a "503 Service Unavailable"response and logs a message
dependingupon the log level setting. You might want to modify this behavior for your
application.You can specify your own busy functions for any NSAPI function in the obj.conf
leby including a service function in the conguration le in this format:
busy="my-busy-function"
Forexample, you could use this sample service function:
Service fn="send-cgi"busy="service-toobusy"
Thisallows dierent responses if the server become too busy in the course of processing a
requestthat includes a number of types (such as Service,AddLog, and PathCheck). Note that
yourbusy function applies to all functions that require a native thread to execute when the
defaultthread type is non-native.
Touse your own busy function instead of the default busy function for the entire server, you can
writean NSAPI init function that includes a func_insert call as shown below:
extern "C"NSAPI_PUBLIC int my_custom_busy_function
(pblock *pb, Session *sn, Request *rq);
my_init(pblock *pb, Session *, Request *){func_insert
("service-toobusy", my_custom_busy_function);}
Busyfunctions are never executed on a pool thread, so you must be careful to avoid using
functioncalls that could cause the thread to block.
UsingBusyFunctions
Chapter2 • Tuning Sun Java System Web Server 83