Compiling Postgres 64 bit for Solaris x86 with Solaris Studio
Creating optimized Postgres binaries for Solaris is essential in squeezing every last ounce of performance out of your system. Rather than using generic GCC compilers we tend to focus on using highly specialized and optmized Solaris Studio compilers from Oracle. The latest versions are highly tuned for multi-core operation and can make a big impact on performance for heavily loaded servers.
LiveTime utilizes Postgres for virtually all of its performant customers and specializes in tuning of Postgres across tens of thousands of users. An optimized Postgres binary is essential for getting the best out of any hardware. LiveTime uses 64bit binaries as standard on both x86 and SPARC processors running Solaris 10.
We currently deploy Postgres 9 as standard, although 8.4 has served us well for a very long time. To compile on Solaris using the latest Solaris Studio compilers (currently 12.2) use the following syntax on the command line. The base requirements also require the gmake package on Solaris.
shell> configure prefix=/usr/local/postgres --without-readline "CC=/opt/solstudio12.2/bin/cc" "CFLAGS=-xO5 -xtarget=generic -m64"
shell> gmake
shell> gmake install
After you have built and installed postgres, you can include various performance options for postgres and the OS itself based on your needs. We present a few links below for various performance options available for Solaris.
Tuning
Performance Tuning on Solaris
Improving LiveTime Performance with Tomcat 7.0
LiveTime 6.5 now ships preconfigured with Tomcat 7.0. One of the great advantages of Tomcat 7.0 is that it has been well tuned for performance already (also supporting the new Servlet 3.0 specification and asynchronous request processing) and can cope with thousands of users very easily. However, exposing LiveTime to the general Internet we often see a very large increase in apparent users, growing to 10′s of thousands in a very short time, that can take hours to drop off.
The problem is that web bots and search engines continually crawl the public knowledge base of LiveTime and create new connections for every page they access. This can consume valuable resources that are much better used for servicing real customers.
Rather than simply blocking these bots a better approach is available in Tomcat 7.0 through the use of valves. Valves are basically small libraries of services that can be enabled within Tomcat to perform a number of low level tasks.
Using the new Crawler Session Manager Valve of Tomcat 7.0 we have been able to reduce session counts by almost 95%, similar to what has been seen by others users.
Configuration
To configure the Crawler Valve simply edit the server.xml file on your Tomcat Server and add the following line to your engine block as follows.
<Engine name="Catalina" defaultHost="localhost">
<Valve className="org.apache.catalina.valves.CrawlerSessionManagerValve"
crawlerUserAgents=".*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*"
sessionInactiveInterval="60"/>
Next restart Tomcat and monitor the sessions on the LiveTime System reports page. You will see a significant drop in session count and corresponding increase in available resources and performance. This has already been done for you in LiveTime and Novell Service Desk 6.5.
References:
Crawler Session Manager Valve