Find the answer to your Linux question:
Results 1 to 6 of 6
Hello! I've just finished setting up a test web server using Centos 5.5, and I find the resource usage quite high. With a similar setup my older redhat 9 takes ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    7

    Centos 5.5 resource usage


    Hello!

    I've just finished setting up a test web server using Centos 5.5, and I find the resource usage quite high. With a similar setup my older redhat 9 takes up half this even with some user activity. There isn't any user activity except myself configuring & testing.

    It's using almost 500 MB of RAM, and I need to know if this is normal before I set this into a production environment. It also seems to take up more RAM the longer the uptime has gone. On first boot it's maybe ~200 MB or less, and after a few days it'll be up to 500+.

    I'll list my config, and then if there's anything else you guys need please let me know, thanks!

    Centos 5.5 with everything updated (using yum update).

    Apache, php, mysql, bind - all latest versions downloaded from the websites of these groups, and APF firewall with default settings and development mode enabled. There's also sendmail enabled but not yet configured.

    No other software has been installed or touched, except a few services like cups which I stopped on boot with chkconfig.

    If there's other info you need please tell me what it is and the best way for me to get it to you. Thanks!

  2. #2
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4
    I'm by no means an expert, and in fact are having issues with my own CentOS5.5 box now, but that does seem high from what my box is running at (essentially the same stuff)

    I've got 768mb of RAM, and only 357mb of it is actually used with everything running (including X), and its been running for...well actually only 1 day, but even in my long hauls with no reboots, I've never seen it higher.

    A quick google search results with the command:

    ps -aux --sort -rss

    which will show all running process and sort them by their percentage of memory usage. My highest are snort and mysqld.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    7
    Bellow is the data you wanted. I rebooted just 2 hours ago and it's already using almost 400 MB of RAM, with no user activity except mine.

    Code:
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    mysql     3938  0.0  1.2 200028 25956 ?        Sl   09:08   0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/
    root      4147  0.0  0.7 256928 15684 ?        SN   09:08   0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd
    apache    5710  0.0  0.6 278836 13668 ?        S    10:15   0:00 /usr/sbin/httpd
    apache    4073  0.0  0.6 278848 13628 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4067  0.0  0.6 278248 13160 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4072  0.0  0.6 278212 13032 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4066  0.0  0.6 277972 12840 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4071  0.0  0.6 277804 12688 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4069  0.0  0.6 277872 12652 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    4070  0.0  0.6 277852 12612 ?        S    09:08   0:00 /usr/sbin/httpd
    root      4012  0.0  0.4 273260 10004 ?        Ss   09:08   0:00 /usr/sbin/httpd
    apache    4068  0.0  0.3 273616  7300 ?        S    09:08   0:00 /usr/sbin/httpd
    apache    5862  0.0  0.3 273460  6472 ?        S    10:21   0:00 /usr/sbin/httpd
    named     2349  0.0  0.2 250604  4624 ?        Ssl  09:08   0:00 /usr/sbin/named -u named -t /var/named/chroot
    68        2570  0.0  0.1  30924  3980 ?        Ss   09:08   0:01 hald
    root      6235  0.0  0.1  90124  3244 ?        Ss   10:35   0:00 sshd: ****** [priv]
    root      6365  2.0  0.1  63968  2728 ?        Ss   10:36   0:00 sshd: [accepted]
    root      6367  0.0  0.1  64860  2680 ?        Ss   10:36   0:00 sshd: [accepted]
    root      3976  0.0  0.1  69008  2092 ?        Ss   09:08   0:00 sendmail: accepting connections
    smmsp     3984  0.0  0.0  59760  1804 ?        Ss   09:08   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
    ********  6245  0.0  0.0  90124  1736 ?        S    10:35   0:00 sshd: ******@pts/0
    root      6289  0.1  0.0  66092  1580 pts/0    S    10:35   0:00 -bash
    root      2636  0.0  0.0 119932  1520 ?        Ssl  09:08   0:00 automount
    ********  6246  0.0  0.0  66092  1488 pts/0    Ss   10:35   0:00 -bash
    root      6278  0.0  0.0 101084  1388 pts/0    S    10:35   0:00 su -
    root      2543  0.0  0.0  21172  1360 ?        Ssl  09:08   0:00 pcscd
    sshd      6366  0.0  0.0  63968  1356 ?        S    10:36   0:00 sshd: [net]
    sshd      6368  0.0  0.0  64860  1300 ?        S    10:36   0:00 sshd: [net]
    avahi     4064  0.0  0.0  23272  1292 ?        Ss   09:08   0:00 avahi-daemon: running [srv01.local]
    root      3897  0.0  0.0  65956  1268 ?        S    09:08   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --lo
    root      3857  0.0  0.0  62624  1216 ?        Ss   09:08   0:00 /usr/sbin/sshd
    root      4025  0.0  0.0  74836  1160 ?        Ss   09:08   0:00 crond
    root      4149  0.0  0.0  12916  1152 ?        SN   09:08   0:00 /usr/libexec/gam_server
    root      2571  0.0  0.0  21692  1044 ?        S    09:08   0:00 hald-runner
    root      6369  0.0  0.0  65724  1000 pts/0    R+   10:36   0:00 ps -aux --sort -rss
    dbus      2470  0.0  0.0  21256   976 ?        Ss   09:08   0:00 dbus-daemon --system
    root      2424  0.0  0.0  14360   884 ?        Ss   09:08   0:00 rpc.statd
    68        2579  0.0  0.0  12324   844 ?        S    09:08   0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
    root      2186  0.0  0.0  27324   808 ?        S<sl 09:08   0:00 auditd
    root       537  0.0  0.0  12672   784 ?        S<s  09:07   0:00 /sbin/udevd -d
    root      2483  0.0  0.0  10432   784 ?        Ss   09:08   0:00 /usr/sbin/hcid
    root      2447  0.0  0.0  56072   776 ?        Ss   09:08   0:00 rpc.idmapd
    root      2188  0.0  0.0  16264   744 ?        S<sl 09:08   0:00 /sbin/audispd
    root         1  0.0  0.0  10348   692 ?        Ss   09:07   0:00 init [3]
    root      2218  0.0  0.0   5908   612 ?        Ss   09:08   0:00 syslogd -m 0
    rpc       2379  0.0  0.0   8052   576 ?        Ss   09:08   0:00 portmap
    root      2557  0.0  0.0   3800   576 ?        Ss   09:08   0:00 /usr/sbin/acpid
    root      2489  0.0  0.0   5936   548 ?        Ss   09:08   0:00 /usr/sbin/sdpd
    root      4090  0.0  0.0   3792   484 tty1     Ss+  09:08   0:00 /sbin/mingetty tty1
    root      4091  0.0  0.0   3792   484 tty2     Ss+  09:08   0:00 /sbin/mingetty tty2
    root      4092  0.0  0.0   3792   484 tty3     Ss+  09:08   0:00 /sbin/mingetty tty3
    root      4095  0.0  0.0   3792   484 tty5     Ss+  09:08   0:00 /sbin/mingetty tty5
    root      2609  0.0  0.0   8516   480 ?        Ss   09:08   0:00 /usr/bin/hidd --server
    root      4093  0.0  0.0   3792   480 tty4     Ss+  09:08   0:00 /sbin/mingetty tty4
    root      4097  0.0  0.0   3792   480 tty6     Ss+  09:08   0:00 /sbin/mingetty tty6
    root      4038  0.0  0.0  18732   460 ?        Ss   09:08   0:00 /usr/sbin/atd
    root      2221  0.0  0.0   3804   428 ?        Ss   09:08   0:00 klogd -x
    root      2311  0.0  0.0  10760   372 ?        Ss   09:08   0:00 irqbalance
    root      3998  0.0  0.0   6452   372 ?        Ss   09:08   0:00 gpm -m /dev/input/mice -t exps2
    avahi     4065  0.0  0.0  23148   340 ?        Ss   09:08   0:00 avahi-daemon: chroot helper
    root         2  0.0  0.0      0     0 ?        S<   09:07   0:00 [migration/0]
    root         3  0.0  0.0      0     0 ?        SN   09:07   0:00 [ksoftirqd/0]
    root         4  0.0  0.0      0     0 ?        S<   09:07   0:00 [watchdog/0]
    root         5  0.0  0.0      0     0 ?        S<   09:07   0:00 [migration/1]
    root         6  0.0  0.0      0     0 ?        SN   09:07   0:00 [ksoftirqd/1]
    root         7  0.0  0.0      0     0 ?        S<   09:07   0:00 [watchdog/1]
    root         8  0.0  0.0      0     0 ?        S<   09:07   0:00 [migration/2]
    root         9  0.0  0.0      0     0 ?        SN   09:07   0:00 [ksoftirqd/2]
    root        10  0.0  0.0      0     0 ?        S<   09:07   0:00 [watchdog/2]
    root        11  0.0  0.0      0     0 ?        S<   09:07   0:00 [migration/3]
    root        12  0.0  0.0      0     0 ?        SN   09:07   0:00 [ksoftirqd/3]
    root        13  0.0  0.0      0     0 ?        S<   09:07   0:00 [watchdog/3]
    root        14  0.0  0.0      0     0 ?        S<   09:07   0:00 [events/0]
    root        15  0.0  0.0      0     0 ?        S<   09:07   0:00 [events/1]
    root        16  0.0  0.0      0     0 ?        S<   09:07   0:00 [events/2]
    root        17  0.0  0.0      0     0 ?        S<   09:07   0:00 [events/3]
    root        18  0.0  0.0      0     0 ?        S<   09:07   0:00 [khelper]
    root        35  0.0  0.0      0     0 ?        S<   09:07   0:00 [kthread]
    root        42  0.0  0.0      0     0 ?        S<   09:07   0:00 [kblockd/0]
    root        43  0.0  0.0      0     0 ?        S<   09:07   0:00 [kblockd/1]
    root        44  0.0  0.0      0     0 ?        S<   09:07   0:00 [kblockd/2]
    root        45  0.0  0.0      0     0 ?        S<   09:07   0:00 [kblockd/3]
    root        46  0.0  0.0      0     0 ?        S<   09:07   0:00 [kacpid]
    root       137  0.0  0.0      0     0 ?        S<   09:07   0:00 [cqueue/0]
    root       138  0.0  0.0      0     0 ?        S<   09:07   0:00 [cqueue/1]
    root       139  0.0  0.0      0     0 ?        S<   09:07   0:00 [cqueue/2]
    root       140  0.0  0.0      0     0 ?        S<   09:07   0:00 [cqueue/3]
    root       143  0.0  0.0      0     0 ?        S<   09:07   0:00 [khubd]
    root       145  0.0  0.0      0     0 ?        S<   09:07   0:00 [kseriod]
    root       231  0.0  0.0      0     0 ?        S    09:07   0:00 [khungtaskd]
    root       232  0.0  0.0      0     0 ?        S    09:07   0:00 [pdflush]
    root       233  0.0  0.0      0     0 ?        S    09:07   0:00 [pdflush]
    root       234  0.0  0.0      0     0 ?        S<   09:07   0:00 [kswapd0]
    root       235  0.0  0.0      0     0 ?        S<   09:07   0:00 [aio/0]
    root       236  0.0  0.0      0     0 ?        S<   09:07   0:00 [aio/1]
    root       237  0.0  0.0      0     0 ?        S<   09:07   0:00 [aio/2]
    root       238  0.0  0.0      0     0 ?        S<   09:07   0:00 [aio/3]
    root       390  0.0  0.0      0     0 ?        S<   09:07   0:00 [kpsmoused]
    root       436  0.0  0.0      0     0 ?        S<   09:07   0:00 [ata/0]
    root       437  0.0  0.0      0     0 ?        S<   09:07   0:00 [ata/1]
    root       438  0.0  0.0      0     0 ?        S<   09:07   0:00 [ata/2]
    root       439  0.0  0.0      0     0 ?        S<   09:07   0:00 [ata/3]
    root       440  0.0  0.0      0     0 ?        S<   09:07   0:00 [ata_aux]
    root       446  0.0  0.0      0     0 ?        S<   09:07   0:00 [scsi_eh_0]
    root       447  0.0  0.0      0     0 ?        S<   09:07   0:00 [scsi_eh_1]
    root       458  0.0  0.0      0     0 ?        S<   09:07   0:00 [kstriped]
    root       479  0.0  0.0      0     0 ?        S<   09:07   0:00 [kjournald]
    root       504  0.0  0.0      0     0 ?        S<   09:07   0:00 [kauditd]
    root      1320  0.0  0.0      0     0 ?        S<   09:07   0:00 [hd-audio0]
    root      1577  0.0  0.0      0     0 ?        S<   09:07   0:00 [kmpathd/0]
    root      1578  0.0  0.0      0     0 ?        S<   09:07   0:00 [kmpathd/1]
    root      1579  0.0  0.0      0     0 ?        S<   09:07   0:00 [kmpathd/2]
    root      1580  0.0  0.0      0     0 ?        S<   09:07   0:00 [kmpathd/3]
    root      1581  0.0  0.0      0     0 ?        S<   09:07   0:00 [kmpath_handlerd]
    root      1649  0.0  0.0      0     0 ?        S<   09:07   0:00 [kjournald]
    root      2412  0.0  0.0      0     0 ?        S<   09:08   0:00 [rpciod/0]
    root      2413  0.0  0.0      0     0 ?        S<   09:08   0:00 [rpciod/1]
    root      2414  0.0  0.0      0     0 ?        S<   09:08   0:00 [rpciod/2]
    root      2415  0.0  0.0      0     0 ?        S<   09:08   0:00 [rpciod/3]
    root      2520  0.0  0.0      0     0 ?        S<   09:08   0:00 [krfcommd]

  4. #4
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    A ps -A like above is not really helpful to determine the actual memory usage. 500mb for a server running webserver, database and lots of other stuff is not that much anyway. In the end most of the stuff will be cached in the swap. To determine which is really in memory and not cached, please post:

    Code:
    # cat /proc/meminfo
    # free -m -o

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    7
    I'm expecting the memory usage to hover around 700 - 1200MB, but only once I put the server into production. Right now there's only some empty websites and a test DB configured on it and some test DNS zones. So I'm trying to figure out why memory usage climbs up to around 500MB in this kind of environment, if it's normal or not, and if I can do something about it before it goes public, otherwise I'll need more RAM.

    Here is the data you requested:

    Code:
    [root@srv01 ~]# cat /proc/meminfo
    MemTotal:      2049568 kB
    MemFree:       1654628 kB
    Buffers:         31028 kB
    Cached:         195840 kB
    SwapCached:          0 kB
    Active:         175368 kB
    Inactive:       158712 kB
    HighTotal:           0 kB
    HighFree:            0 kB
    LowTotal:      2049568 kB
    LowFree:       1654628 kB
    SwapTotal:     4192956 kB
    SwapFree:      4192956 kB
    Dirty:              56 kB
    Writeback:           0 kB
    AnonPages:      107300 kB
    Mapped:          17452 kB
    Slab:            27116 kB
    PageTables:      12136 kB
    NFS_Unstable:        0 kB
    Bounce:              0 kB
    CommitLimit:   5217740 kB
    Committed_AS:   436204 kB
    VmallocTotal: 34359738367 kB
    VmallocUsed:    265376 kB
    VmallocChunk: 34359472119 kB
    HugePages_Total:     0
    HugePages_Free:      0
    HugePages_Rsvd:      0
    Hugepagesize:     2048 kB
    Code:
    [root@srv01 ~]# free -m -o
                 total       used       free     shared    buffers     cached
    Mem:          2001        385       1615          0         30        191
    Swap:         4094          0       4094
    Right now it's been up less than 15 hours.
    The memory usage on the web server related processes seem fine to me, however there's lots of smaller processes I'm simply not familiar with, that I guess were installed by default by the OS or those who installed centos on my server at the datacenter. Not sure if all of them are required.

    Thanks.

  6. #6
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    That doesn't look that bad. 385mb used from which 191mb are cached. swap is completely unused and you have 2gb ram / 4gb swap.

    apache2: ~132mb
    mysql: ~24mb

    these both make up around 80% of the actual memory usage (used=385 - cached=191 = 194mb).

    Can't see any trouble from my point of view. You have 2gb ram and 4gb swap which is not really huge, but should be enough for lot of things.

    (EDIT) PS: I just thought of the used - cached thingy and I am right now unsure if this really holds. From my understanding the cached are pages that were read ahead from the disk to the memory for fasten access and must be subtracted from the used. But that could be already done for you in that meminfo thingy. Forgive and correct me if I am wrong.
    Last edited by Kloschüssel; 07-15-2010 at 12:41 PM.

Posting Permissions

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