httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Nordby <and...@fix.no>
Subject Heap memory usage on Solaris 7
Date Fri, 06 Jul 2001 16:10:45 GMT
Hello,

(Sorry if I'm writing to the wrong list or asking something that has been
asked before. I just haven't found any good solution to this. Please let
me know if the message should go elsewhere.)

I'm having problems with Apache 1.3.20's memory usage on Solaris 7 08/99.
For every VirtualHost I add, Apache seems to use around 24 kilobytes more
memory. This is really too much, considering I need to use n * 1000
VirtualHosts and need to have a fair amount of servers processes running to
scale well. With 1087 VirtualHosts and 150 processes running, each httpd
has allocated 13448 KB memory according to memps (a Sun memtool
program):

  PID     Size     Resident  Shared  Private Process
  13341   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13352   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13345   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13358   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13354   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13356   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
  13360   13448k   13432k    1840k   11592k  /usr/local/apache/bin/httpd
(..)

That means I need ~ 1970 MB memory for my current setup, and I've just
got started. :-)

Now, looking at the memory structure of one of these processes (while
running), I can see:

# /usr/proc/bin/pmap -x 13356

13356:  /usr/local/apache/bin/httpd
Address   Kbytes Resident Shared Private Permissions       Mapped File
00010000     472     464     376      88 read/exec         httpd
00094000      32      32       -      32 read/write/exec   httpd
0009C000   11288   11280      24   11256 read/write/exec    [ heap ]
FF180000     664     664     656       8 read/exec         libc.so.1
FF234000      32      32       8      24 read/write/exec   libc.so.1
FF23C000       8       8       -       8 read/write/exec    [ anon ]
FF250000      48      48      16      32 read/write/shared  [ anon ]
FF260000      16      16       8       8 read/exec
nss_files.so.1
FF272000       8       8       -       8 read/write/exec
nss_files.so.1
FF280000     520     520     440      80 read/exec         libnsl.so.1
FF310000      40      40       -      40 read/write/exec   libnsl.so.1
FF31A000      32      32       -      32 read/write/exec    [ anon ]
FF330000      16      16       8       8 read/exec         libc_psr.so.1
FF340000      16      16       8       8 read/exec         libmp.so.2
FF352000       8       8       -       8 read/write/exec   libmp.so.2
FF370000       8       8       -       8 read/write/exec    [ anon ]
FF380000      32      32      24       8 read/exec
libsocket.so.1
FF396000      16      16       8       8 read/write/exec
libsocket.so.1
FF3A0000       8       8       -       8 read/exec         libdl.so.1
FF3B0000     128     128     120       8 read/exec         ld.so.1
FF3DE000      16      16       -      16 read/write/exec   ld.so.1
FFBE6000      40      40       -      40 read/write/exec    [ stack ]
--------  ------  ------  ------  ------
total Kb   13448   13432    1696   11736

It's the heap that's killing me. How can I reduce Apache's heap memory
usage in Solaris? I've tried using a shared memory scoreboard, with/without
DSO support (-DNO_DL_NEEDED, --disable-module=so), using -Os
optimization with gcc, disabled all extra (I can do without about 10 of
the standard ones) & external modules etc. With no luck. Generally, I've
compiled Apache with (+ -Os added to CFLAGS):

# ./configure --enable-module=all --disable-module=auth_db \
--disable-module=so
# make

And I'm using gcc 2.95.3 (from www.sunfreeware.com) and GNU ld 2.11.2.
I've also tried gcc 2.95.2 19991024 (release) and GNU ld 2.9.1. With not
much difference, heap is over 11 MB any way I do this. Also with older
versions of Apache, I've tried 1.3.12 and 1.3.14 too.

Any tips on this? Is the answer Apache 2? :-)

Cheers,

-- 
Anders.

Mime
View raw message