Skip to main content

Optimizing the Solaris Network Cache and Accelerator for the Apache Web Server

I met an old friend whom was complaining that one of his Solaris servers at work which run the Apache web server is very slow. He has added RAM and migrated from RAID-5 to RAID-0 to improve disk I/O but the problem still persists. He asked me if I have any tips to offer as I had some Solaris experience several years ago.

Googling on my personal file-server, I saw a tip I kept since year 2004. Since it could be useful to more people, I decided to share it on my blog.

Note: This tip offers an optimized configuration for dedicated web servers running Apache Web Server on a Solaris Operating System. This document is a brief how-to on configuring and optimizing the Solaris Network Cache and Accelerator (SNCA).

Requirements
  • Solaris 2.8 OS
  • 256MB RAM
  • Apache Web Server 1.3.x
Necessary Packages for the Solaris OS

32 bits:

SUNWncar
SUNWncau

64 bits:

SUNWncarx
SUNWncaux

1. As a start, edit the file /etc/nca/ncakmod.conf and configure the following parameters:

status=enabled
httpd_door_path=/var/run/nca_httpd_1.door
ncad_status=enabled
nca_active=disabled

2. Configure the log file used by SNCA:

Edit the file /etc/nca/ncalogd.conf and configure the following parameters:

status=enabled    // enabled /disabled
logd_path_name="/var/nca/log" // log file
logd_file_size=1000000 // Maximum file size


Create the log file:

$touch /var/nca/ncalogd.conf


3. Configure the network interfaces to work with SNCA:

Edit the file /etc/nca/nca.if:

Add the name of the interfaces, e.g.: hme0 or hme0:1 or * (for all interfaces)

Each interface must have its corresponding file hostname.interface-name inside /etc/ and the corresponding host line in the file /etc/hosts.


4. Verify that the following startup files exist and are enabled:

/etc/rc2.d/S42ncakmod
/etc/rc2.d/S94ncalogd


5. Verify that the line "nca (number)" exists inside the file /etc/name_to_major.


6. Optimizations for maximum performance:

Edit the file /etc/system and add in the end:

* Tuning NCA for 3GB of memory
set sq_max_size=0
set ge:ge_intr_mode=1
set nca:nca_conn_hash_size=82500 // Size of hash table
set nca:nca_conn_req_max_q=100000 // Maximum number of pending connections
set nca:nca_conn_req_max_q0=100000 // Maximum number of pending incomplete connections
set nca:nca_ppmax=290000 // Amount available of memory to use by SNCA (pags)
set nca:nca_vpmax=290000 // Amount available of virtual memory to use by SNCA


7. Restart the system with reconfigure option:

# reboot -- -r

8. Changes in Apache Web Server:

Edit the file /apache/conf/httpd.conf:

KeepAlive Off

Comment the following parameters:

#Timeout
#MaxKeepAliveRequests
#KeepAliveTimeout


Edit the file /apache/bin/apachectl and include:

# 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


9. Restart Apache Web Server:

/apache/bin/apachectl restart


10. To view the log file:

#ncab2clf -D -i /var/nca/log


That's all :)

Comments

Popular posts from this blog

OpenProj - FREE alternative to Microsoft Project I wanted to share with all of you about Projity's important announcement last week at LinuxWorld. Projity announced the release of OpenProj, a FREE (yeah, another FREE software) and open source replacement of Microsoft Project. OpenProj is available on Windows, Linux, Unix or Mac and is interoperable with Microsoft Project. The best thing is, it even opens existing MS Project files! How cool is that? I read on OpenProj website that OpenProj has been downloaded on an average every 35 seconds around the clock at http://www.projity.com since they launched and made the software available last week. OpenProj is now in the 99.99th percentile for activity on Sourceforge.net and is quickly becoming one of the most used open source solutions worldwide. The OpenProj folks are expecting about 11 million worldwide users and in my opinion, this has been an excellent start for them. MS Project has been a key strategic solution for Micro...
In early April 2006, I sign-up for the Excellerated Business School for Entrepreneurs (BSE) after a preview session held in Singapore by Executive-Directions. The seminar was held from 15 April to 23 April 2006 in Subang Jaya Hotel in Kuala Lumpur, Malaysia. The BSE in KL was organized by GlobeSL Sdn Bhd. I left Singapore on 14 April via Transtar , the only 1st class coach service which has 16 seats to create a lot of room for your leg. They also provide hot meal during the journey with hot drinks on demand. The seats are equipped with a massage chair, a personal in-flight entertainment system on LCD screen, PC Games and the F&B Attendant will provide anything that you ask for. From newspaper, magazines, blanket, hot/cold drinks, a new set of earphones for the entertainment system... they have it all. They are most courteous and polite at all times. I truly enjoy the Transtar service. For SG$50 from Singapore to KL, it's worth it. I arrived in Subang Jaya Hotel at about 10p...

What Makes a Champion?

By NG Chang Siang, Education Success Coach MindChamps Holdings Ltd ‘’ What makes a champion is a champion mindset. The champion mindset is the transferable commodity, not the skill itself. If you have done something great in one field, you are far more likely to do it in another ‘’ --Professor Allan Snyder FRS I have a good friend who is a primary school teacher. He also takes on as a role of a coach in flaw ball for the students in his school. Guess what? He never play flaw ball before. Not even that, after he coached his students, they won a school team which was coached by a national flawball player. That day I met him in our soccer game as we play soccer together every Monday. He played soccer very well and represented his schools when he was very young. I ask him : “ How did you do it…?” “ How can someone with no flaw-ball playing experience train and beat another team whom has an experience coach?” He replied: “ Oh, I just use the strategy I know in playing soccer and apply...