optimize memory

Discussion in 'Site & Server Administration' started by bocko, Jun 12, 2010.

  1. #1
    Hello,

    I transfered all sites from old server to new server
    i have exatcly configuration but on new server i have centos 64bit.

    On old server i have memory used about 40% at the eveneng, on new server i have memory used 50% in the morning and hole day i am waiting eveneng to see how much i will have memory used!

    I have
    Quad Core Xeon 2.4GHz
    4GB RAM
    500GB SATA hd
    CentOS 5.3 64 bit

    i setuped exactly configuration as on old server. Just done with copy/paste!

    httpd.conf
    
    Timeout 200
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 10
    
    <IfModule prefork.c>
    
    StartServers         5
    MinSpareServers      5
    MaxSpareServers      10
    ServerLimit          500
    MaxClients           500
    MaxRequestsPerChild  800
    
    </IfModule>
    
    Code (markup):
    my.cnf

    login as: root
    
    [mysqld]
    set-variable = max_connections=500
    safe-show-database                                                                                                                                            
    #added
    #log-bin #disable bin login
    query_cache_limit = 2M   # default was 1M
    # Set query cache to 32 MB
    query_cache_size  = 64M  # default was 0
    # Enable caching
    query_cache_type  = 1
    table_cache       = 256  #default was 64
    key_buffer_size   = 64M  # default was 8M
    
    
    
    
    Code (markup):

    my top

    
    top - 14:31:16 up  2:35,  2 users,  load average: 0.80, 0.71, 0.61
    Tasks: 196 total,   1 running, 195 sleeping,   0 stopped,   0 zombie
    Cpu(s):  8.3%us,  1.2%sy,  0.1%ni, 88.7%id,  1.5%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:   4046512k total,  2310212k used,  1736300k free,   106704k buffers
    Swap:  4208988k total,        0k used,  4208988k free,  1060156k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    15276 root      39  18  112m  16m 3092 S 39.3  0.4   0:11.74 cpanellogd
    14459 nobody    16   0  125m  17m 4496 S 15.7  0.4   0:00.38 httpd
     7561 nobody    16   0  123m  15m 4200 S  5.9  0.4   0:02.23 httpd
    11753 nobody    16   0  121m  13m 4104 S  3.9  0.3   0:01.16 httpd
    13974 nobody    16   0  120m  12m 4104 S  3.9  0.3   0:00.76 httpd
    15701 nobody    18   0  121m  12m 3688 S  3.9  0.3   0:00.04 httpd
    30350 root      23   0 1448m 139m  10m S  3.9  3.5   0:52.51 java
     8119 nobody    15   0  144m  37m 4820 S  2.0  0.9   0:02.28 httpd
    12986 nobody    15   0  144m  35m 5120 S  2.0  0.9   0:00.68 httpd
    15698 nobody    15   0  121m  12m 3612 S  2.0  0.3   0:00.02 httpd
    15809 root      15   0 12736 1056  716 R  2.0  0.0   0:00.01 top
    28622 mysql     16   0  335m  96m 3844 S  2.0  2.4   4:06.18 mysqld
        1 root      15   0 10348  704  588 S  0.0  0.0   0:01.22 init
        2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.01 migration/0
        3 root      34  19     0    0    0 S  0.0  0.0   0:00.01 ksoftirqd/0
        4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
        5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/1
        6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1
        7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1
        8 root      RT  -5     0    0    0 S  0.0  0.0   0:00.04 migration/2
        9 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/2
       10 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/2
       11 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/3
       12 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/3
       13 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/3
       14 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/0
       15 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/1
       16 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/2
       17 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/3
       18 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
       57 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
       64 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0
       65 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/1
       66 root      10  -5     0    0    0 S  0.0  0.0   0:00.04 kblockd/2
       67 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/3
       68 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
      177 root      16  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0
      178 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/1
      179 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/2
      180 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/3
      183 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd
      185 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
      271 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
      272 root      21   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
      273 root      15   0     0    0    0 S  0.0  0.0   0:00.28 pdflush
      274 root      10  -5     0    0    0 S  0.0  0.0   0:00.11 kswapd0
      275 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
      276 root      18  -5     0    0    0 S  0.0  0.0   0:00.00 aio/1
      277 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 aio/2
      278 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 aio/3
      420 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused
      467 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 ata/0
      468 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 ata/1
    
    
    Code (markup):
    How can i decrease memory to lower bit? Or where i wrong? I have social dating site on my server!
     
    bocko, Jun 12, 2010 IP
  2. oxyhosts2010

    oxyhosts2010 Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think as far as the load shows normal, you really needn't worry about the memory. Apache seems to take a bit of memory. From the settings given, you can try increasing the MaxRequestsPerChild value to 2000.
     
    oxyhosts2010, Jun 13, 2010 IP