We used the sameCFLAGS when building Apache httpd and mod_jk. Here’s how we built and installed mod_jk:
# cd tomcat-connectors-1.2.20-src/native # CFLAGS="-O3 -falign-functions=0 -march=athlon64 -mfpmath=sse -mmmx -msse -msse2 - msse3 -m3dnow -mtune=athlon64" ./configure --with-apxs=/opt/httpd/bin/apxs [lots of configuration output removed] # make && make install
This assumes that the root directory of the Apache httpd we built is /opt/httpd.
We built the APR connector, httpd, and mod_jk with GCC 4.1.1:
# gcc --version gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
We downloaded Apache httpd version 2.2.3 from http://httpd.apache.organd built it two different ways and benchmarked each of the resulting binaries. We built it for prefork MPM and worker MPM. These are different multithreading and multiprocess models that the server can use. Here are the settings we used for prefork and worker MPM:
We disabled Apache httpd’s common access log so that it would not need to log anything per each request (just as we configured Tomcat). And, we turned on Apache httpd’sKeepAliveconfiguration option:
KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5
We enabled mod_proxy one of two ways at a time. First, for proxying via HTTP: