CoolStack (Solaris AMP), It’s all about performance

I’ve written before about the SAMP cluster, which is Apache, MySQL, and PHP bundled together that comes off the Solaris Companion CD. Now there is a whole new package out there called the CoolStack Solaris AMP cluster (sparc only for now) which is all the same thing, but its built optimized with Sun Studio 11 and precompiled into one big package so all you have to do is pkgadd. Building with Sun Studio 11 optimizations provides a huge benefit over standard packages because it can increase performance big time. They also have other separate optimized packages like Perl 5.8.8, Tomcat 5.5.17 and Squid 2.5. So here’s how it works:

Download from here.

# bzip2 -d CSQamp.pkg.bz2
# pkgadd -d ./CSQamp.pkg

This installs Apache 2.0.58 with MPM prefork and modules for PHP, SSL, Perl, MySQL 5.0.22 (without clustering), and PHP 5.1.4. Everything goes in /usr/local and its pretty much self explanatory once you see the directory structure.

# ls /usr/local
Copyright.libxml2 bin/ lib/ mysql_32bit/ share/
apache2/ include/ man/ php5/

Note that one directory shows mysql_32bit. The CSQamp package comes with the optimized 32 bit MySQL, but you can install the optimized 64 bit version by going through the same download page, it has a CSQmysql package that is separate. It was compiled this way so it will work with the optimized 32 bit PHP.
One nice thing is in each /usr/local directory “apache2″, “mysql32_bit”, “php5″, they have a README file which tells what optimizations went into the compile and some notes about each.

Something I noticed that didn’t make sense was there wasn’t var directory inside mysql32_bit directory. You have to create this if you want to get logs from MySQL:

# mkdir /usr/local/mysql32_bit/var
# chown -R mysql:mysql /usr/local/mysql32_bit
# su - mysql
# /usr/local/mysql32_bit/bin/mysql_install_db
# cp /usr/local/mysql32_bit/share/mysql/my-medium.cnf /usr/local/mysql32_bit
# /usr/local/mysql_32bit/share/mysql/mysql.server start
SUCCESS!

Now we just need to configure Apache:

# /usr/local/apache2/bin/apachectl start

Apache is compiled to work with OpenSSL 0.9.7. If you run the latest OpenSolaris or SXCR, you will get an error here about needing libssl.so.0.9.7. This is because the latest bits have libssl.so.0.9.8 but Solaris 10 U1 and U2 already have 0.9.7 in /usr/sfw/lib. What I did here was just make a link from 0.9.7 to 0.9.8 since I am using the latest.

Put test.php in /usr/local/apache2/htdocs:

# cat test.php
< ?php
phpinfo();
?>

Goto http://localhost/test.php, you should get a php configuration page, with MySQL support enabled.

The CoolStack AMP Cluster is a quick way to get setup for production. While the CSQamp package contains an optimized 32 bit MySQL, you can use the CSQmysql 64 bit package for the heavy loads. There is a lot of benefits to using the CoolStack especially the CSQperl 5.8.8 package which beats the Perl 5.8.4 and 5.6.1 that Solaris ships with. Something else that might be nice is to have Ruby into this package. Overall the Coolstack is a killer product.

Comments are closed.