The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Ubuntu
.
google unix.com



Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Ubuntu server team wants to know – how do you Ubuntu? iBot Security Advisories (RSS) 0 09-25-2008 10:30 AM
Ubuntu: X.org vulnerabilities iBot Security Advisories (RSS) 0 06-13-2008 09:00 AM
Ubuntu Linux Toolbox: 1000+ Commands For Ubuntu And Debian Power ... - Business Wire iBot UNIX and Linux RSS News 0 12-19-2007 10:50 AM
Ubuntu Linux Toolbox: 1000+ Commands For Ubuntu And Debian Power ... - PR-Inside.com iBot UNIX and Linux RSS News 0 12-19-2007 09:00 AM
is Ubuntu for me? zerodegreec UNIX for Dummies Questions & Answers 3 05-23-2007 01:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-13-2009
mojoman mojoman is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 179
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).
  #2 (permalink)  
Old 01-14-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
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.

Last edited by otheus; 01-14-2009 at 10:18 AM..
  #3 (permalink)  
Old 01-14-2009
mojoman mojoman is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 179
Quote:
Originally Posted by otheus View Post
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 or not x86_64, I'm pretty sure you're not using mutexes.

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

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.

Last edited by otheus; 01-14-2009 at 10:46 AM..
  #4 (permalink)  
Old 01-14-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
That's a Ubuntu specific question, so I've moved the thread. I don't know the answer.
  #5 (permalink)  
Old 01-14-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,843
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.
  #6 (permalink)  
Old 01-14-2009
mojoman mojoman is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 179
Quote:
Originally Posted by pludi View Post
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.
  #7 (permalink)  
Old 02-05-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,884
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*
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0