Apache 2.2 on Ubuntu 8.10

Hello,

Does anyone know or know how to check if the Apache 2.2 version you can get with the Synaptic Package manager in Ubuntu 8.10has been optimized for 486 or higher processors?

I would think one would have to optimize the executable for 486 or higher processer baed on the Apache optimization guide below. I am a little new to Apache so I do not know if I have to do what they say below since I run on a processor greater than a 496(it is a little confuzing). Any advice?

Atomic Operations

Some modules, such as mod_cache and recent development builds of the worker MPM, use APR's atomic API. This API provides atomic operations that can be used for lightweight thread synchronization.

By default, APR implements these operations using the most efficient mechanism available on each target OS/CPU platform. Many modern CPUs, for example, have an instruction that does an atomic compare-and-swap (CAS) operation in hardware. On some platforms, however, APR defaults to a slower, mutex-based implementation of the atomic API in order to ensure compatibility with older CPU models that lack such instructions. If you are building Apache for one of these platforms, and you plan to run only on newer CPUs, you can select a faster atomic implementation at build time by configuring Apache with the --enable-nonportable-atomics option:

./buildconf
./configure --with-mpm=worker --enable-nonportable-atomics=yes

The --enable-nonportable-atomics option is relevant for the following platforms:

* Solaris on SPARC
  By default, APR uses mutex-based atomics on Solaris/SPARC. If you configure with --enable-nonportable-atomics, however, APR generates code that uses a SPARC v8plus opcode for fast hardware compare-and-swap. If you configure Apache with this option, the atomic operations will be more efficient \(allowing for lower CPU utilization and higher concurrency\), but the resulting executable will run only on UltraSPARC chips.
* Linux on x86
  By default, APR uses mutex-based atomics on Linux. If you configure with --enable-nonportable-atomics, however, APR generates code that uses a 486 opcode for fast hardware compare-and-swap. This will result in more efficient atomic operations, but the resulting executable will run only on 486 and later chips \(and not on 386\).

Try "httpd -V". HTTPD 2.2.9 does not have the "atomics" compile-time option, so I cannot determine if this would work for you.

UPDATE: Oh oh. This seems to be a configuration bug of some sort AND the documentation is out of date. The configure code now (since long before 2.2.9) tests if the architecture being compiled for is greater than i486 and if so, it provides you with "generic" hardware atomics -- ie, pthread mutex locking. It looks like it should have used assembly atomics, but someone goofed and got it the other way around. SO unless your package is specifically for the "i386" architecture, it will have use the pthread calls, not the assembly calls. If you have the APR "libtool" installed (search your filesystem for apr-1/../libtool) check the file for what it sets "host" to. If it's not i386, I'm pretty sure you're not using mutexes.

I'm going to see what Apache developers say about this.

UPDATE2: I found the instance on the mailing archives where the configure code was changed. It was changed according to the comments, but I don't see why.

I am a little new to UBUNTU. When using the synaptic package manager, are the packages pre-compiled? I ask since since you say the "arhictecture being compiled for is greater than 486". Does syaptic download the package, check for the architecture and the compile or as I ask above are they pre-compiled.

That's a Ubuntu specific question, so I've moved the thread. I don't know the answer.

Ubuntu packages are precompiled. The only Linux distributions that I know of that use local compiles are Gentoo and LFS.
But you can always install the source package and create a new binary package tailored for your system.

Well Otheus that answers my question. I will use the precompiled version of Apache then and then use httpd -V to make sure I am using pthreads then.

I've been waiting for a while and still don't have an answer from the Apache community whether atomics are actually enabled on most x86 platforms. *sigh*

Wow you remembered!

Thanks! Well for tume being I am using the precompiled version.

Actually, I remembered that I forgot. I had about 5 "open" threads. Went through my subscription list and found them.