Nick R on Sun, 5 Sep 1999 09:51:33 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [Plug] Streamlining Linux


About the Apache stuff, according to what I've read from RH5.2 Unleashed, there are 2 ways to run Apache, as standalone and through inetd. If you run it through inetd, it doesn't keep spare memory wasting servers around, but it's gotta fire up Apache to handle http requests, so it's a little bit slower on the uptake. It seems to have saved me quite a bit. Each httpd running took somewhere between 1% & 2% of my memory. That's still quite a chunk even w/ 1 or 2 of them running. I don't have the traffic that warrants a standalone server (56K and all) and I doubt anybody will notice the difference anyway. If you have a dedicated machine you should obviously use standalone, but if that's just a small part of what you're doing, then inetd is good.

You know, I don't seem to remember setting some of those services to start-up automatically. In fact, I'm pretty sure I didn't set them to do so. I can't imaginc what would've been going through my mind to set the news server to load on boot-up.

       -Laktar, a.k.a. Nick Rosen, laktar.dyndns.org


If I Ever Became An Evil Overlord:
25. No matter how well it would perform, I will never construct any sort of
machinery which is completely indestructible except for one small and
virtually inaccessible vulnerable spot.
-- Peter's Evil Overlord List, http://www.eviloverlord.com/lists/overlord.html



From: Hugh Brock <hbrock@ibm.net>
To: laktar@hotmail.com
Subject: Re: [Plug] Streamlining Linux
Date: Thu, 02 Sep 1999 23:29:08 -0500

Nick R wrote:
>
> I just installed RH 5.2 on my system and it's eating up quite a bit of
> memory. About 1/2 of my 64M on start-up. I'd like to streamline this and get
> rid of all the unnecessary crap that's getting loaded. What I've done so far
> is to switch Apache to run from inetd so that I don't have a couple of
> servers running all the time, eating up my memory,


Hi Nick.

I'm only replying to this because I'm going through the same crap
myself, not because I know what the hell I'm talking about, so please
ignore if anything I say is irrelevant. I'm going to go through your ps
ax (aux?) and look at what I think you probably don't need to be
running.

First off regarding Apache: I think it spawns its own sub-daemons to
handle incoming requests, so I'm not sure what the implications are of
running it via inetd. You might want to check the Apache docs on that.
Bottom line, I think even if there are 6 httpds running they don't ust
very much memory, and I think you can control the number it spawns from
httpd.conf. So check that out.

Second, I'm assuming you know how to comment out lines in rc2.d, rc3.d,
etc., so that you can actually prevent these various things from
loading.

>   PID TTY STAT TIME COMMAND
>     1  ?  S    0:03 init
>     2  ?  SW   0:00 (kflushd)
>     3  ?  SW<  0:14 (kswapd)
>     4  ?  SW   0:00 (md_thread)
>     5  ?  SW   0:00 (md_thread)
>    48  ?  S    0:00 /sbin/kerneld
>   203  ?  S    0:00 syslogd
>   212  ?  S    0:00 klogd
>   235  ?  S    0:00 crond
>   246  ?  S    0:00 inetd
>   257  ?  SW   0:00 (snmpd)

Probably you don't need snmpd unless you're using it for network
management.

>   278  ?  S    0:00 named

You definitely don't need named; put all your local machines in
/etc/hosts and call it a day.

>   289  ?  S    0:00 routed

Even large sites don't run routed; from what I understand it's not very
secure, and you don't need it if you're using /etc/hosts.

>   300  ?  SW   0:00 (lpd)
>   313  ?  S    0:00 nwserv
>   319  ?  SW   0:00 (nwbind)

Are you running your own news server?

>   324  ?  S    0:00 rpc.mountd
>   333  ?  S    0:00 rpc.nfsd
>   344  ?  SW   0:00 (rpc.rusersd)
>   366  ?  S    0:00 rwhod
>   369  ?  SW   0:00 (ncpserv)

All the above can go unless you're running NFS.

>   380  ?  S    0:00 /usr/sbin/amd -a /.automount -l syslog -c 1000 /net
> /etc/amd
>   393  ?  SW   0:00 (nfsiod)
>   394  ?  SW   0:00 (nfsiod)
>   395  ?  SW   0:00 (nfsiod)
>   396  ?  SW   0:00 (nfsiod)
>   412  ?  S    0:00 /usr/sbin/automount --timeout 60 /misc file
> /etc/auto.misc

Ditto this stuff, although I have no experience with automount, so I
don't know what it does. I think it's NFS-related, though, which means
you can ditch it unless you're using NFS.

>   429  a0 S    0:00 gpm -t ms
>   463  ?  SW   0:00 (mcserv)
>   474  ?  SW   0:00 (smbd)
>   483  ?  S    0:00 nmbd -D
>   500   2 SW   0:00 (mingetty)
>   501   3 SW   0:00 (mingetty)
>   502   4 SW   0:00 (mingetty)
>   503   4 SW   0:00 (mingetty)
>   504   4 SW   0:00 (mingetty)
>   506  ?  S    0:01 update (bdflush)
>   573  ?  SW   0:00 (ifup-ppp)
>   580  ?  SW   0:00 (pppd)
> 1872   1 S    0:00 -bash
> 1888   6 S    0:00 /sbin/mingetty tty6
> 1890   5 S    0:00 /sbin/mingetty tty5

Don't worry about the mingettys unless you never run more than one xterm
in X. I don't think they cost much, and it's convenient to have them
around.

> 1895   1 R    0:00 ps ax
>   189  ?  SW   0:00 (portmap)

Portmap is (I believe) another NFS related thing that constitutes a
security risk. Probably best to turn it off.

>   224  ?  S    0:00 /usr/sbin/atd
>   355  ?  SW   0:00 (rpc.rwalld)
>   444  ?  SW   0:00 (postmaster)

rwalld should also go.

Hope the above is marginally useful.

Understand that I am running rh 6.0 and so some of the above are not
familiar to me. However I'm pretty confident in my recommendations.

Good luck,
--Hugh

______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com

_______________________________________________
Plug maillist  -  Plug@lists.nothinbut.net
http://lists.nothinbut.net/mail/listinfo/plug