Solaris Network Cache & Accelerator – does it work or not .. ?

Determining whether Network Cache Accelerator works on Solaris…

First ensure that you have enabled everything you need in /etc/nca/*

Check apache2 that it is NOT listening IPV6!
Simple test:
-bash-3.00# grep ^Listen /etc/apache2/httpd.conf
Listen 192.168.77.22:80

Should be enough

Next place the following into /usr/apache2/bin/apachectl just before the end of the configuration section:

# Enable NCA:
NCAKMODCONF=/etc/nca/ncakmod.conf
if [ -f $NCAKMODCONF ]; then
. $NCAKMODCONF
if [ "x$status" = "xenabled" ]; then
HTTPD=”env LD_PRELOAD=/usr/lib/ncad_addr.so $HTTPD”
fi
fi

Reboot – yay, this shouldn’t happen on a UNIX box ;)

ncad_addr.so should be preloaded by LD_PRELOAD:
-bash-3.00# pldd `pgrep http`|grep ncad
/usr/lib/ncad_addr.so.1
/usr/lib/ncad_addr.so.1
/usr/lib/ncad_addr.so.1
/usr/lib/ncad_addr.so.1
/usr/lib/ncad_addr.so.1
/usr/lib/ncad_addr.so.1

Also you can check by pargs -e if LD_PRELOAD is set properly.

Hardcore way of determining whether NCA works:
-bash-3.00# truss -ff -t accept,listen,bind /usr/apache2/bin/apachectl start
703: bind(256, 0x08047C90, 16, SOV_SOCKBSD) = 0
703: listen(256, 8192, SOV_DEFAULT) = 0
707: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
709: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
711: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
713: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
715: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
<run eg. GET http://<ip>/123.html>
713: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) = 11
713: accept(256, 0x081A5268, 0x081A5254, SOV_DEFAULT) (sleeping...)
<run second time, no output should happen from accept() as request is served by kernel!>
^C
-bash-3.00#

Notes:
pfiles `pgrep http`|grep AF will show you that listening socket is AF_INET type, not AF_NCA! This is odd!

It seems that on Solaris Nevada truss -v is broken (doesn’t display parameters in details?? On Solaris 10 it works..

Also it seems that sotruss -f -T ncad_addr.so output differs from Solaris 10 to Nevada – smells like second bug? It seems it doesn’t show calls to bind() from ncad_addr.so ?

2 Responses to “Solaris Network Cache & Accelerator – does it work or not .. ?”

  1. piotrek says:

    Hello! I’m newbie in Solaris System, can u help me? help command doesn’t work in shell:(

  2. admin says:

    Piotrze kolego drogi, do czego ci ten paskudny solaris javovcu ty jeden… ;]