In the 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
PathCheck server functions are used.
When you use nostat= virtual-path in the assign-name NameTrans, the server assumes that
stat on the specied virtual-path will fail. Therefore, use nostat only when the path of the
virtual-path does not exist on the system, for example, in NSAPI plug-in URLs. Using nostat
on those URLs improves performance by avoiding unnecessary stats on those URLs.
For more information about obj.conf , see the Sun Java System Web Server 7.0 Update 1
Administrator’s Conguration File Reference.
Using Busy Functions
The default busy function returns a "503 Service Unavailable" response and logs a message
depending upon 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
le by including a service function in the conguration le in this format:
busy="my-busy-function"
For example, you could use this sample service function:
Service fn="send-cgi" busy="service-toobusy"
This allows dierent responses if the server become too busy in the course of processing a
request that includes a number of types (such as Service, AddLog, and PathCheck). Note that
your busy function applies to all functions that require a native thread to execute when the
default thread type is non-native.
To use your own busy function instead of the default busy function for the entire server, you can
write an 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);}
Busy functions are never executed on a pool thread, so you must be careful to avoid using
function calls that could cause the thread to block.
UsingBusyFunctions
Chapter2 • TuningSunJavaSystemWebServer 83