From owner-freebsd-hackers Mon Mar 12 22:34:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from sdmail0.sd.bmarts.com (sdmail0.sd.bmarts.com [209.247.77.155]) by hub.freebsd.org (Postfix) with ESMTP id 289B237B71C for ; Mon, 12 Mar 2001 22:34:43 -0800 (PST) (envelope-from gordont@bluemtn.net) Received: from localhost (gordont@localhost) by sdmail0.sd.bmarts.com (8.11.3/8.11.2/BMA1.1) with ESMTP id f2D6YWq91369; Mon, 12 Mar 2001 22:34:32 -0800 (PST) Date: Mon, 12 Mar 2001 22:34:32 -0800 (PST) From: Gordon Tetlow X-X-Sender: To: Dan Phoenix Cc: Subject: Re: optimizing apache with php and nfs mounts In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 12 Mar 2001, Dan Phoenix wrote: > CC="gcc -O6 -fomit-frame-pointer" OPTIM="-O2 -DBUFFERED_LOGS" > > could some c guru tell me if this would be bad to use to an apache > optimization? I need to compile apache on my own not with ports.... > looking at makefile > in apache13 in ports collection i see these optimization flags. > along with --mmap-static module. > > > can you use both -06 and -02 for optmization at the same time? > -fomit-frame-pointer as well? -O6 and -O2 do seem a bit contradictory. I'm guessing it just uses -O6. -fomit-frame-pointer is not enabled per the -O flags so that does do something, but it does make it rather difficult to track down problems without a frame pointer. > this is my full config line so far > CC="gcc -O6 -fomit-frame-pointer" OPTIM="-O2 -DBUFFERED_LOGS" ./configure > --prefix=/usr/local/apache --enable-module=rewrite > --activate-module=src/modules/php4/libphp4.a > > alot of other crap modules get thrown into httpd.conf as well i have > noticed....slowly researching each and disabling what i don;t need. Unless you really need mod_rewrite, I suggest you don't use it. It's rather black-magicish, difficult to get working, and as I recall, I think it's had some security issues about it. > INterested in talking with some c experts and apache experts on this > issue. I probably qualify for the latter.... Optimizations are good and all, but I look at it this way: It's a mission critical webserver, I don't want it crashing. As a result, we compile ours with nothing higher that -O2 and no unusual optimizations. Sure, it might be a bit slower than it could have been, but we don't have to worry about chasing down compiler bugs that interact strangly with the webserver code. Also, I think anything higher than -O2 actually produces a larger binary (it inlines functions whenever possible). Again, I don't like living on the bleeding edge when it comes to revenue streams. Hope this helps, -gordon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message