Link to home
Start Free TrialLog in
Avatar of pmrussell892
pmrussell892

asked on

What are the minimum processes needed to run a server?

Here is my out put of " ps -e "

PID TTY          TIME CMD
    1 ?        00:00:01 init
    2 ?        00:00:00 ksoftirqd/0
    3 ?        00:00:00 events/0
    4 ?        00:00:00 khelper
    5 ?        00:00:00 netlink/0
    6 ?        00:00:00 kacpid
   23 ?        00:00:00 kblockd/0
   33 ?        00:00:03 pdflush
   34 ?        00:00:10 pdflush
   36 ?        00:00:00 aio/0
   35 ?        00:00:00 kswapd0
  619 ?        00:00:00 kseriod
 1544 ?        00:00:00 ata/0
 1546 ?        00:00:00 scsi_eh_0
 1547 ?        00:00:00 scsi_eh_1
 1556 ?        00:00:00 reiserfs/0
 2031 ?        00:00:00 khubd
 2073 ?        00:00:00 udevd
 2444 ?        00:00:00 hwscand
 3366 ?        00:01:36 lshttpd
 3371 ?        00:00:00 lscgid
 3574 ?        00:00:03 syslogd
 3577 ?        00:00:03 klogd
 3885 ?        00:00:00 hwscand
 4122 ?        00:00:00 resmgrd
 4158 ?        00:00:00 sshd
 4161 ?        00:00:00 mysqld_safe
 4204 ?        00:00:01 mysqld
 4220 ?        00:00:00 cron
 4836 tty1     00:00:00 mingetty
 4837 tty2     00:00:00 mingetty
 4838 tty3     00:00:00 mingetty
 4839 tty4     00:00:00 mingetty
 4840 tty5     00:00:00 mingetty
 4841 tty6     00:00:00 mingetty
27580 ?        00:00:03 lshttpd
27585 ?        00:00:01 admin_php
27586 ?        00:00:00 admin_php
27823 ?        00:00:00 php
30678 ?        00:00:00 php
 2144 ?        00:00:00 php
 6167 ?        00:00:00 php
11693 ?        00:00:00 php
14927 ?        00:00:00 php
17136 ?        00:00:00 php
18924 ?        00:00:00 php
20903 ?        00:00:00 php
22911 ?        00:00:00 php
25115 ?        00:00:00 php
25982 ?        00:00:00 sshd
25989 pts/0    00:00:00 bash
26015 pts/0    00:00:00 ps

I am wondering if somebody can please tell me if there are any noticable unecessary processes needed here for running a LAMP system. Maybe I just dont understand how linux uses memory but I am constantly using 20-30 MB of swap. I currently have 256 MB RAM

Here is free -mt

                  total       used       free     shared    buffers     cached
Mem:           249        247          2          0         49        158
-/+ buffers/cache:         39        210
Swap:          541          9        532
Total:         791        256        534

Is this normal? Is there any processes I can shutdown from above list to save on memory? Or is the only option a RAM upgrade?

Thanx for any info. As you can tell I am a newbie with linux so please be easy on me. :)
Avatar of ahoffmann
ahoffmann
Flag of Germany image

your multiple php processes look unusal (at least to me)
to check which processes consume resources use top
Avatar of pmrussell892
pmrussell892

ASKER

Yeah that is normal for the server I am using.

http://www.litespeedtech.com

It uses fcgi processes to pass to php.

I am mostly wondering about these processes

 1 ?        00:00:01 init
    2 ?        00:00:00 ksoftirqd/0
    3 ?        00:00:00 events/0
    4 ?        00:00:00 khelper
    5 ?        00:00:00 netlink/0
    6 ?        00:00:00 kacpid
   23 ?        00:00:00 kblockd/0
   33 ?        00:00:03 pdflush
   34 ?        00:00:10 pdflush
   36 ?        00:00:00 aio/0
   35 ?        00:00:00 kswapd0
  619 ?        00:00:00 kseriod
 1544 ?        00:00:00 ata/0
 1546 ?        00:00:00 scsi_eh_0
 1547 ?        00:00:00 scsi_eh_1
 1556 ?        00:00:00 reiserfs/0
 2031 ?        00:00:00 khubd
 2073 ?        00:00:00 udevd
 2444 ?        00:00:00 hwscand

I use top and mysql and the php processes consume most of the memory. I am wondering more along the lines of what I could possibly kill to save memory. Or if most processes are sleeping. Does this not matter?

I have no X server
I have no windows manager or desktop.
I administer the server strictly through ssh

I am not sure if i am being clear here? Please yell if i am not making any sense.
1 ?        00:00:01 init
    2 ?        00:00:00 ksoftirqd/0
    3 ?        00:00:00 events/0
    4 ?        00:00:00 khelper - Needed as responsible for kernel tasks
    5 ?        00:00:00 netlink/0 - Required for network connectivity
    6 ?        00:00:00 kacpid - Kernel Advanced Configuration and power interface - May be deleteable, but could potentially cause shutdown problems, or standby issues - Disable ACPI in BIOS if you wish to try this.
   23 ?        00:00:00 kblockd/0 - Required
   33 ?        00:00:03 pdflush - Will appear as and when required
   34 ?        00:00:10 pdflush - will appear as and when required
   36 ?        00:00:00 aio/0 - Asynchronous io - needed!
   35 ?        00:00:00 kswapd0 - Needed to use swap
  619 ?        00:00:00 kseriod - kernel serial io
 1544 ?        00:00:00 ata/0 - ata interface
 1546 ?        00:00:00 scsi_eh_0 - scsi interface
 1547 ?        00:00:00 scsi_eh_1 - scsi interface - potential for deleting scsi or ata depending on what drives attached
 1556 ?        00:00:00 reiserfs/0 - Your filing system
 2031 ?        00:00:00 khubd - Kernel usb hub
 2073 ?        00:00:00 udevd - Usb dev d
 2444 ?        00:00:00 hwscand - hardware scand - for hot plugging

You may be able to remove the usb stuff if you don't use that and also either the ata or the scsi depending on what your system has. Ideally you would rebuild your kernel without the modules that you don't need, btu this is not quite trivial, but reasonably eas y to do:

http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html

provides comprehensive instructions on how to do it.
HTH:)
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess there is no serious problem . :)

I am just trying to get some info on if there are any noticable processes I could kill to save memory.

The processes I KNOW iI need running are

Mysqld
lshttpd
php
Admin_php
sshd
cron
mingetty

Do you notice any processes that could be killed from running on a server machine?

My machine info

2 EIDE HD
1 amd processor
no external devices
1 EIDE cd-rom
1 Floppy drive.

No special raid configs or scsi devices.

Hope this clears it up a little

>  I guess there is no serious problem . :)
why chang it then? Never touch a running system

the only process which seems not necessary is hwscand (but check your docs forst!)
Thanx for the input.

I did not know that fast-cgi php was a performance killer.

I have setup apache2 alongside my current litespeed setup
and will see if the swap problem goes away. So far I am holding
at 60MB  free ram with no swap.

Thanx for the info. I will also look into the hwscand

Thanx

Accepted answer with grade A
> I did not know that fast-cgi php was a performance killer.
oops, that's a bit hard, I just said that php as CGI is bad, *probably* with fastcgi not much better
Yeah and Thanx for telling me :)

I am new to this stuff and still learning. As far as running
as cgi that is the only that particular
server will work with php.

I am running apache with mod_php4 now. It was a quick
and painless switch. I also got my pdf catalog generator to
run with apache. Did not want to work with litespeed.

I am saying I am grateful for you bringing that up,  thats all :)