Web Hosting Talk







View Full Version : different size of apache's binary


Darkstar
02-18-2002, 05:45 AM
Does anybody know why apache has different size of it's run time binary on different machines even if it's compiled with the same options?
here are you examples (OS is the same on these three servers Red Hat 7.2)

--
1st server:

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
23428 nobody 9 0 2900 2532 1960 S 1.6 0.2 0:00 httpd
20722 nobody 10 0 2812 2188 2060 S 0.8 0.2 0:01 httpd
20780 nobody 10 0 2812 2184 1928 S 0.8 0.2 0:01 httpd
20823 nobody 10 0 2808 2152 1900 S 0.8 0.2 0:01 httpd
20861 nobody 10 0 2808 2188 1932 S 0.8 0.2 0:01 httpd
20865 nobody 10 0 2876 2280 2096 S 0.8 0.2 0:01 httpd
20872 nobody 10 0 2812 2204 2032 S 0.8 0.2 0:01 httpd
21032 nobody 9 0 2824 2168 1924 S 0.8 0.2 0:01 httpd


2nd server:

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
17263 freehost 11 0 5240 3764 3384 S 0.3 0.1 0:00 httpd
17429 freehost 10 0 5240 4484 3376 S 0.3 0.2 0:00 httpd
17597 freehost 9 0 5244 5148 3476 S 0.3 0.2 0:00 httpd
17269 freehost 9 0 5248 5104 3432 S 0.1 0.2 0:00 httpd
17271 freehost 9 0 5240 3800 3432 S 0.1 0.1 0:00 httpd
17277 freehost 9 0 5240 3760 3388 S 0.1 0.1 0:00 httpd
17285 freehost 9 0 5240 3760 3388 S 0.1 0.1 0:00 httpd
17298 freehost 9 0 5248 5048 3376 S 0.1 0.2 0:00 httpd
17319 freehost 9 0 5252 5124 3448 S 0.1 0.2 0:00 httpd
17372 freehost 9 0 5240 3764 3404 S 0.1 0.1 0:00 httpd


3d server:

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
11752 nobody 10 0 3164 3164 2460 S 0.8 0.6 0:16 httpd
11762 nobody 10 0 3152 3152 2460 S 0.8 0.6 0:19 httpd
11768 nobody 10 0 3096 3096 2460 S 0.8 0.6 0:16 httpd
11776 nobody 10 0 3116 3116 2460 S 0.8 0.6 0:17 httpd
11785 nobody 10 0 3168 3168 2460 S 0.8 0.6 0:17 httpd
11790 nobody 10 0 3100 3100 2460 S 0.8 0.6 0:16 httpd
11794 nobody 10 0 3100 3100 2460 S 0.8 0.6 0:16 httpd
11795 nobody 10 0 3112 3112 2460 S 0.8 0.6 0:16 httpd
11802 nobody 10 0 3072 3072 2460 S 0.8 0.5 0:17 httpd

--

Looks very odd to me.
Anybody?

spock
02-18-2002, 07:46 AM
This is usually due to using different sets of dynamically loaded modules - for example mod_ssl or PHP on one server and not on the other (and the PHP module size will differ wildly depending on what options it was compiled with).

Cutting down on modules you don't use can make a big difference in memory usage.

Darkstar
02-18-2002, 09:13 AM
As I mentioned in my post apache was compiled with the same options. and I forgot to mention that on all these three servers apache has dynamic modules support disabled.

---
./configure --prefix=/home/httpd --sysconfdir=/etc/httpd/conf --libexecdir=/usr/sbin/ --activate-module=src/modules/layout/liblayout.a --disable-module=so --disable-module=actions --enable-module=alias --disable-module=asis --disable-module=autoindex --disable-module=env --disable-module=imap --disable-module=include --enable-module=rewrite --disable-module=status --enable-module=cgi --enable-module=log_config --enable-module=negotiation --enable-module=access --enable-module=auth --activate-module=src/modules/php4/libphp4.a
----

php as well was compiled with the same options...

./configure --with-apache=/root/apache_1.3.22

all the same settings but still the size of run time binary differs....

spock
02-18-2002, 10:05 AM
OK, then it's a little more tricky. ;)

I suppose there might be differences in versions of libraries loaded dynamically by Apache modules, or in the configuration of such subsystems. Hard to say without actually examining the running processes in detail.

You can try looking at /proc/<childpid>/maps (where <childpid> is the process id of an Apache child process) on the different machines to see if the same dynamic libraries are loaded.