Find the answer to your Linux question:
Results 1 to 3 of 3
Just a little tip for people running apache who really want to improve performance though reducing the size of your httpd binary. You can set your CFLAGS environment variable to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284

    Tip: Reduce httpd binary size


    Just a little tip for people running apache who really want to improve performance though reducing the size of your httpd binary.

    You can set your CFLAGS environment variable to contain information passed to GCC when using "make" to build software. After much experimentation i have found that this deliver's the best results:
    Code:
    export CFLAGS="-O3 -fomit-frame-pointer -s"
    I thought i would share that, as i havent found anything else like it documented on the web (specifically for apache).

    Also to improve apache performance, explicitly disable modules you dont need. For my apache 1.3 installation, i used on my apache ./configure line:
    Code:
    --disable-module=userdir --disable-module=imap
    From doing that, I was able to reduce the size of my httpd binary by about 18%.

    J

  2. #2
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    When it comes to reducing binary files it migh help if you changed "-O3" to "-O2" or even "-Os". AFAIK, the O3 flag will inline many functions to their callers, which can increase performance in some cases and decrease in others, but certainly will increase code size. With O2 this is only true fot the functions marked "inline" by the programmer.
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

  3. #3
    Just Joined!
    Join Date
    Sep 2004
    Location
    UMR
    Posts
    14
    in theory, -Os should give the smallest binary, and -O3 should give the largest (but fastest) binary. not always the case, but nothing is "always"

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •