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

From Toilet Cleaner to CEO

On 22-April-2012, my entrepreneurship journey story was published by The Sunday Times in Singapore by Mr. Wong Kim Hoh








































Making Optimum Choices in Life

I was asked by one of my business mentees I am currently mentoring, "How do I make the most optimum choice in life when I am bombarded with possibilities all the time?"Life is full of choices. This choice, that choice, both choice or none of the above. THAT's a whopping 4 choice!  Choice can open the door to a whole new possibilities, not only at cross-roads on our path in life, but in each moment, giving us access to the bountiful of possibilities with which we can paint our world any way we want it to be.  We can choose a new action, thought or feeling at any time, and create an entirely new reality as a result.  Every choice has an impact or consequence, to a greater or lesser extent, each one like a pebble dropped in a pond; the ripples, the ramifications, spreading out into your future and other areas of your life. Even one small choice made today that shifts your life by a minor degree can take you to an entirely different future than the one you are heading, opening …

The 4 Essentials of Effective Leadership

I read this article written Mark Raciappa, ActionCOACH and I totally agree. His communication is clear, concise and it resonated with me. Mark says;
I remember a bumper sticker: “Either Lead or Follow—But Get Out of the Way!”
Interestingly, in my company, I say something similar and it goes like this "If you can lead, lead. If you can't lead, follow. If you cannot lead or follow, get out of my way!
Mark continued to write that, when our role calls for the former, here are 4 important things to keep in mind:1. Great leaders communicate. Realizing that good communication is a 2-way street, we must be responsible for our part. That being said, true communication is the response that you get. Whatever form you choose (verbal, mail, e-mail, etc), if you don’t get the outcome you seek (from a “willing” recipient), the responsibility lies with the sender. Great leaders confirm, gain commitment, and solicit feedback to improve the process.2. Great leaders make decisions. Far too ofte…