1. What is the Accelerating Apache project?
2. How is this project different from the Apache HTTP Server project?
3. I've downloaded the patches, now what do I do?
4. How do I set up a base Apache source tree?
5. How do I configure, build, and install the patched source tree?
6. Do I have to use every optimization the patches provide?
7. What platforms do the patches support?
8. What about highperformance.conf-dist
and perf-tuning.html?
9. Where is the Apache FAQ?
10. What documentation is available?
11. How much faster can Apache go?
12. Will the ASF adopt the patches?
13. What version of Apache is required?
14. Have the patches been tested?
15. Does SGI support the patches?
16. Where is ap_types.h?
17. How do I get qsc_cas() to compile?
18. Do the patches work with mod_ssl and/or mod_perl?
19. Why does patch ask what file to patch?
20. What version of Apache do I have?
21. Do the patches work with mod_dav?
22. Are there any related projects?
23. What is the status and future of the AAP?
1. What is the Accelerating Apache project?
The Accelerating Apache project is an effort to increase the
performance of the open source Apache
HTTP Server.
2. How is this project different from the Apache HTTP Server project?
The Apache HTTP Server Project is
one arm of the Apache Software
Foundation. They develop and distribute Apache. They value
portability and modularity above extreme performance.
The Accelerating Apache project optimizes and fine-tunes Apache. We
strive to maintain portability and modularity but we value extreme
performance above all.
3. I've downloaded the patches, now what do I do?
After downloading the patches you want, you need to apply them to your
pre-existing Apache source tree using the
patch command. On some systems you can apply the patches
from the directory above (some people call this below)
the apache directory, for example:
Extract source tree from apache_1.3.x, see question 4.
Do not cd apache_1.3.x.
% patch < 10xpatch-1.3.x-n
but if this makes patch complain about the file
10xpatchlevel or ask "File to patch:" then you
could try using the -p1 argument to patch
(after removing the apache source tree, which may be half-patched, to
start over):
Extract source tree from apache_1.3.x, see question 4.
% cd apache_1.3.x
% patch -p1 < 10xpatch-1.3.x-n
Then configure, compile, and install the modified
source tree as you would a normal Apache tree.
Patching Apache/2.0 distributions is similar.
4. How do I set up a base Apache source tree?
First be sure you understand and agree to the terms of the Apache License.
Then download the
source code for the version of Apache you want. (If you can't find it
there maybe it's here.) Each of our
version-specific patch pages points to a distribution site where you can
find the matching version of Apache.
Finally uncompress and untar the source code. Here are some methods
different people use depending on their system and the tools available.
Use what works for you.
method 1
% tar -xzf apache_1.3.x.tar.gz
method 2
% gzcat apache_1.3.x.tar.gz | tar xf -
method 3
% gunzip apache_1.3.x.tar.gz
% tar xf apache_1.3.x.tar
Unloading Apache/2.0 distributions is similar.
5. How do I configure, build, and install the patched source tree?
First, read Apache's guide to compiling and
installing.
Second, read the new documents
found in the patches, particularly perf-mja.html and
qsc.html or mod_qsc.html (for Apache/1.3 and
2.0, respectively), which describe new configuration, compilation, and
run-time options. Without enabling these options your patched
Apache will run only a little bit faster, not ten times faster.
Third, decide which of the configuration, compilation, and run-time
options described in the above documents you desire.
Finally, compile the source tree:
% cd apache_1.3.x
% configure options ...
% make
% make install
The compilation process for Apache/2.0 is different. Read the file
src/README.MPM for instructions.
6. Do I have to use every optimization the patches provide?
No. While the goal of this project is to make Apache run as fast as
possible, we understand that other people have other priorities. Some
of our optimizations disable features you may require (such as graceful
restarts) or have other consequences you may want to avoid. Use only
the ones that fit your needs.
You can turn on and off most of our optimizations individually using
compilation or configuration options. You can also edit out unwanted
optimizations after applying a patch or patch set. We do not recommend,
however, simply omitting a patch from a patch set, because later patches
in a set rely on earlier ones and some patches contain bug fixes that
you probably want alongside optimizations that you may or may not. For
example, patches 10xpatch-1.3.12-0 through -2
compose a patch set; to use -2 you must first apply
-1, and to use -1 you must first apply
-0. You should apply all three patches in order before
enabling or disabling any optimizations.
7. What platforms do the patches support?
We have applied all of the patches to Apache on Irix 6.x and Linux 2.2.x
and 2.4.0, and we're told at least some of them work on Solaris 7 and
FreeBSD-x86 as well. If you port them (especially the function qsc_cas()) to other platforms, we would
welcome your contribution.
Johann
Messner contributed a qsc_cas implementation for
Solaris. He says:
I would like to contribute/let you know that I was able
to compile and use your REALLY GREAT accelerated apache
2.0alpha6 on a Sun Enterprise ES450/Solaris 7.0
I implemented/reused a CompareAndSwap Assembler Routine
for mod_qsc.c:
http://mickey.edvz.uni-linz.ac.at/aap/sol_cas.tar
(I added the resulting .o file simply to the EXTRA_LIBS in
config_vars.mk as
$(top_srcdir)/modules/extra/sol_cas.o
)
I am using a 'home brewn' load generator which
stresses the apache by doing a couple of
'keep-alive' HTTP/1.0 connections; I had to
patch src/main/http_request.c:
void ap_process_request(request_rec *r)
{
#ifdef USE_QSC
if (!qsc_process_request(r))
#endif
process_request_internal(r);
+#ifdef USE_QSC
+ else // MeJ: be sure to flush the request (output buffer!!)
+ (void) ap_rflush(r);
+#endif
....
}
Otherwise the connection output buffer was *NOT* cleared and the
apache closed/reseted the socket ==> keep-alive did not work
with QSC enabled on URLs cached by a MMapFile directive.
After the patch it does work.
In order to use the 4 MB of QSC you have to switch
from SysV IPC/SHM (limited to 1MB) to mmap()ed Shared Memory
in the mm module:
apache_2.0alpha6/src/lib/apr/shmem/unix/mm/mm_conf.h:
/* Shared Memory Type */
/* #undef MM_SHMT_MMANON */
/* #undef MM_SHMT_MMPOSX */
/* #undef MM_SHMT_MMZERO */
/* #undef MM_SHMT_MMFILE */
// MeJ use mmap() based shm
#define MM_SHMT_MMFILE
// MeJ switch off SysV SHM #define MM_SHMT_IPCSHM 1 */
/* #undef MM_SHMT_BEOS */
Thanks Johann!
8. What about highperformance.conf-dist
and perf-tuning.html?
These files in the base Apache source code explain some ways to make
your server faster. They predate our work and improve performance less.
Our patches are actually a superset of the ideas these files present.
9. Where is the Apache FAQ?
http://httpd.apache.org/docs/misc/FAQ.html
10. What documentation is available?
The Apache Server Project has extensive documentation on-line. The
same documentation is included in the Apache source code.
The patches add documentation to the source
tree. Only some of these documents are available on-line, the rest
being integrated into the Apache documentation hierarchy.
11. How much faster can Apache go?
So far the patches increase the performance of Apache/1.3.x up to 900%
(10x) on Irix, up to 70% (1.7x) on Linux 2.2, and up to several hundred
percent on Linux 2.4, as measured by the SPECweb96 benchmark.
12. Will the ASF adopt the patches?
We contributed the patches to the Apache Software Foundation but
the ASF has refused to include the patches in future releases of
Apache/1.3 or 2.0, citing "unnecessary" typecasts and complication
associated with the warning-free 64-bit port, and incompatible license
terms with the state-threaded MPM.
13. What version of Apache is required?
The patches require one of the versions listed on the main page. Don't know what version
you're using?
14. Have the patches been tested?
The official patches have been strenuously tested under heavy SPECweb96
loads and lightly for other access patterns. The contributed patches
have not been tested. No rigorous quality assurance has been performed
on any of the patches. Users of the patches have as yet reported no
unresolved problems.
15. Does SGI support the patches?
Not any more.
16. Where is ap_types.h?
It's a new file. Probably your patch command placed it in the wrong
place. This is my fault: Before the 1.3.12 version, the patches I
produced caused patch to put new files in the current directory instead
of where they belong. I finally learned how to prevent this and from
1.3.12 on this problem should be fixed.
You can either move the new files (there are seven) to their proper
places by hand or you can start over and make patch do it.
To move them by hand, follow these directions:
% mv 10xpatchlevel apache_1.3.x (1.3.9-1.3.11 only)
% mv 64-bit.html apache_1.3.x/htdocs/manual
% mv ap_types.h apache_1.3.x/src/include/ap_types.h
% mv perf-mja.html apache_1.3.x/htdocs/manual/misc
% mv qsc.c apache_1.3.x/src/main
% mv qsc.html apache_1.3.x/htdocs/manual
% uudecode sgi_performance.gif.uu
% mv sgi_performance.gif apache_1.3.x/htdocs
To make your patch command do the right thing with the patch for
1.3.11 (for example), start with two identical original Apache source
trees, one called "apache_1.3.11" and one called "apache_1.3.11-orig",
and then apply the patch to the former. (Patch behaves differently when
both the original and the patched directories exist.)
17. How do I get qsc_cas() to compile?
The function qsc_cas() requires a platform-specific
implementation. It is the only function in all the patches with this
constraint. The patches include versions for some platforms but not
many. If an implementation is not provided for your platform you may
have to invent one (and please contribute it for the benefit of others).
See src/main/qsc.c or
src/modules/extra/mod_qsc.c (Apache/1.3 and 2.0,
respectively) for details.
If you're using an Intel i486 or later processor (including
Pentium, PentiumPro, etc.) and gcc version 2 or later, you may need only
to adjust your compilation flags. It seems gcc defines only the
__i386__ token and not the __i486__,
__i586__, __i686__, __pentium__,
or __pentiumpro__ tokens as it should. Choose the solution
that makes you most comfortable: manually define the appropriate token
from the list above (e.g., gcc -D__pentium__ ...) or try
gcc's -m option (e.g., gcc -mpentium ...).
Note that since the cmpxchgl instruction does not exist
on i386 and earlier processors, using the i486-and-beyond implementation
of qsc_cas() on such processors will cause an illegal
instruction trap and crash Apache.
See question 7 for contributed implementations.
18. Do the patches work with mod_ssl and/or mod_perl?
Yes, on Apache/1.3. Apply the 10x patches (this project's patches)
first, then mod_ssl, then mod_perl to minimize patch conflicts. There
will still be conflicts you must resolve manually (read: you must edit
the code). Unfortunately this project lacks the resources to automate
such multi-patching or to provide meta-patches that track new versions
of Apache, mod_perl, and mod_ssl all together, but we will help with any
specific questions you have and there may be more information in the
mail archive.
There is, however, a reference
merge of accelerated Apache/1.3.20 and mod_ssl 2.8.4 available, to
help you resolve the conflicts.
How well the patches for Apache/2.0 work with mod_ssl or mod_perl
remains to be seen. Let us know if you find
out.
19. Why does patch ask what file to patch?
See question 3.
20. What version of Apache do I have?
Search the file src/include/httpd.h for
SERVER_BASEVERSION. Look at or around that line for a
version string like "Apache/1.3.12" or "2.0a6." That's your version.
21. Do the patches work with mod_dav?
We're told they do, with one caveat: You must add #include
"ap_types.h" to xmlparse.h. See also question 18.
22. Are there any related projects?
We have heard but not confirmed that the Advanced Extranet Server for
Linux Mandrake uses the
AAP's performance enhancements.
Roger Espel Llima wrote
lingerd to
offload Apache's lingering close as a way to increase its scalability.
23. What is the status and future of the AAP?
I, Mike, the project's creator
and prime developer, no longer work on Apache or for SGI. SGI
graciously allowed me to move the project from oss.sgi.com to SourceForge. I hope to find a new
owner, prime developer, and/or evangelist for the project (apply within)
because I hope someone else would give the project a better chance for
adoption by the ASF. I just hate to see a 10x performance increase rot
away so I want to give it one more chance.
I still answer questions about the project and accept code
contributions from fans. I will not port any of the current patches to
any new versions of Apache/1.3 or 2.0 but other project members have and
might again.
See also question 12 and question
22.