HP-UX TCP/IP Performance White Paper, March 2008

20
The max_uri_page_size is specified in bytes. For example, the command nsahttp -m 2097152
causes NSA HTTP to cache only web pages that contain 2MB or fewer.
4.2.1.3 Performance Data
A simulated web server environment was used to measure the performance of NSA HTTP. The workload
was a mix of static content (70%) and dynamic content (30%). The measurements were taken using Web
servers that implement copy avoidance when servicing static requests. The performance improvement was
about 13-17%.
On workloads with only static content, the performance improvement was approximately 60-70%. The
performance improvements can be significantly greater when NSA HTTP is used with web servers that do
not implement copy avoidance for servicing static requests.
4.2.2 Socket Caching for TCP Connections
There is a finite amount of operating system overhead in opening and closing a TCP connection (for
example in the processing of the socket(), accept() and close() system calls) that exists
regardless of any data transfer over the lifetime of the connection. For long-lived connections, the cost of
opening and closing a TCP connection is not significant when amortized over the life of the connection.
However, for a short-lived connection, the overhead of opening and closing a connection can have a
significant performance impact. HP-UX 11i implements a socket caching feature for better performance of
short-lived connections such as web connections.
A considerable amount of kernel resources (such as TCP and IP level data structures, STREAMS data
structures) are allocated for each new TCP endpoint. By avoiding the allocation of these resources each
time an application opens a socket, or receives a socket with a new connection through the accept()
system call, a server can proceed more quickly to the data transfer phase of the connection.
The socket caching feature for TCP connections saves the endpoint resources instead of freeing them,
speeding up the closing function. Once the cache is populated, new TCP connections can use cached
resources, speeding up the opening of a connection. TCP endpoint resources cached due to closing of one
TCP connection can be reused to open a new TCP connection by any application.
HP-UX 11i v3 has been enhanced to cache both IPv4 and IPv6 TCP connections. HP-UX 11i v1 and HP-UX
11i v2 support caching of IPv4 TCP connections only. HP-UX does not currently cache other transport
protocols such as UDP.
4.2.2.1 Tuning Recommendation
Socket caching is enabled by default for IPv4 and IPv6 TCP connections. The default value of number of
TCP endpoint resources that are cached is 512 per processor.
The number of cached elements (TCP endpoint resources) can be changed by using the ndd tunable
socket_caching_tcp. For example to set the number of cached elements to 1024 one would do the
following:
# ndd -set /dev/sockets socket_caching_tcp 1024