Results 1 to 12 of 12

Thread: memory usage

  1. #1
    Join Date
    May 2006
    Posts
    307

    memory usage

    I just got a new server Dual E5520 with 6GB RAM, SAS 15k rpm raid10. It's running well. However, the memory usage is just around 2.5GB, even when I have more traffic. Here is the kernel info

    # uname -a
    Linux server2.domain.com 2.6.18-128.1.10.el5 #1 SMP Thu May 7 10:35:59 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
    Any idea that we can put more content into memory?
    Thank you.
    Traditional music traveling

  2. #2
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853

  3. #3
    Disable swap, use tmpfs for /tmp

  4. #4
    Join Date
    May 2006
    Posts
    307
    Here is my top and vmstat results

    top - 03:37:49 up 6 days, 13:07, 1 user, load average: 0.59, 0.56, 0.64
    Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie
    Cpu(s): 8.3%us, 1.4%sy, 0.0%ni, 89.8%id, 0.1%wa, 0.0%hi, 0.4%si, 0.0%st
    Mem: 6097972k total, 938816k used, 5159156k free, 47700k buffers
    Swap: 1052248k total, 0k used, 1052248k free, 535660k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    6066 root 15 0 1432m 72m 15m S 1.0 1.2 68:39.38 ./jre/bin/java -Djava.compiler=NONE -cp /usr/S
    6378 apache 15 0 64808 3836 1440 S 1.0 0.1 0:00.11 /usr/sbin/httpd -k start -DSSL
    7450 apache 15 0 64808 3836 1440 S 0.7 0.1 0:00.06 /usr/sbin/httpd -k start -DSSL
    2142 apache 15 0 64400 3672 1444 S 0.3 0.1 0:00.19 /usr/sbin/httpd -k start -DSSL
    7429 apache 15 0 64328 3548 1432 S 0.3 0.1 0:00.02 /usr/sbin/httpd -k start -DSSL
    8131 apache 15 0 64676 3936 1572 S 0.3 0.1 0:00.01 /usr/sbin/httpd -k start -DSSL
    25855 apache 15 0 64880 4032 1588 S 0.3 0.1 0:00.61 /usr/sbin/httpd -k start -DSSL
    1 root 15 0 10344 680 568 S 0.0 0.0 0:01.46 init [3]
    2 root RT -5 0 0 0 S 0.0 0.0 0:00.22 [migration/0]
    3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 [ksoftirqd/0]
    4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 [watchdog/0]

    # vmstat
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
    r b swpd free buff cache si so bi bo in cs us sy id wa st
    0 0 0 5138448 47712 535708 0 0 0 14 3 1 2 1 97 0 0
    Quote Originally Posted by whrss View Post
    Did you check the result of "nice top -c" (after that hit '1' in the keyboard to check the load distributed across the CPU cores).

    check vmstat's O/P too.. If you think that you have enough memory, you can think of a downgrade.
    Traditional music traveling

  5. #5
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    181
    UK, Chicago, & Singapore Fully Managed Cloud VPS
    UK & Arizona Jelastic Java, PHP & Ruby PaaS

    Comprehensive SLAs, backups, full SSD, rebootless kernel updates.
    Experienced managed hosting provider since 2001. True 24x7 Support & Server Management

  6. #6
    Join Date
    May 2006
    Posts
    307
    server is memcached already. Now, it's using less than 1GB memory, but the CPU load is 2+

    top - 11:26:46 up 35 min, 1 user, load average: 2.77, 2.32, 1.89
    Tasks: 391 total, 2 running, 389 sleeping, 0 stopped, 0 zombie
    Cpu(s): 26.3%us, 3.7%sy, 0.0%ni, 68.9%id, 0.0%wa, 0.1%hi, 1.0%si, 0.0%st
    Mem: 6097972k total, 823876k used, 5274096k free, 24980k buffers
    Swap: 1052248k total, 0k used, 1052248k free, 294332k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    7891 joomla 17 0 149m 20m 5392 R 3.0 0.3 0:00.09 php-cgi
    6032 root 15 0 1425m 68m 14m S 1.0 1.1 0:15.40 java
    3061 root 15 0 12868 1332 808 R 0.7 0.0 0:00.90 top
    531 apache 15 0 64820 3820 1440 S 0.3 0.1 0:00.13 httpd
    870 apache 15 0 64820 3820 1440 S 0.3 0.1 0:00.15 httpd
    2283 apache 15 0 64836 3820 1440 S 0.3 0.1 0:00.14 httpd
    2794 apache 15 0 64964 3928 1432 S 0.3 0.1 0:00.14 httpd
    Any idea to help please? I want to put more data into RAM, not CPU
    Thank you.
    Traditional music traveling

  7. #7
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    181
    memcached isn't something you just install and forget as such - if you want to cache more stuff in memory then memcached is probably what you need... but by default most scripts won't use it for much.

    You'll probably need to go through your applications to figure out what's using up CPU cycles unnecessarily and implement an appropriate caching strategy for those objects. That might involve caching database queries or pretty much anything.
    UK, Chicago, & Singapore Fully Managed Cloud VPS
    UK & Arizona Jelastic Java, PHP & Ruby PaaS

    Comprehensive SLAs, backups, full SSD, rebootless kernel updates.
    Experienced managed hosting provider since 2001. True 24x7 Support & Server Management

  8. #8
    Hello,

    Paste free -mt output here where we can give you better suggestions.

    Thee memory maybe cached by the linux kernel which you nay have assumed as used.

  9. #9
    Join Date
    May 2006
    Posts
    307
    Here is free command result

    # free -mt
    total used free shared buffers cached
    Mem: 5955 1162 4792 0 74 671
    -/+ buffers/cache: 416 5538
    Swap: 1027 0 1027
    Total: 6982 1162 5820
    Traditional music traveling

  10. #10
    Join Date
    Jul 2009
    Posts
    240
    apache mod_mem_cache

  11. #11
    Join Date
    Mar 2009
    Location
    Chicago, IL
    Posts
    219
    That Top output looks like php is your bottleneck, not your processor or memory. If you want to make a big dent in that, you should look at installing a PHP opcode cacher like Eaccelerator or XCache. I think that's where you're going to get your biggest benefit.

    http://serveradmins.net/blog/xcache-...che-on-centos/
    and then
    http://serveradmins.net/blog/tuning-...un-and-profit/

    If you're running CentOS, that'll be a good step by step on how to install and configure XCache.

    As a side note, unless your application is *specifically* written to use memcached, it serves no purpose running it on your server.

  12. #12
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    181
    Quote Originally Posted by SA-ChrisM View Post
    That Top output looks like php is your bottleneck, not your processor or memory. If you want to make a big dent in that, you should look at installing a PHP opcode cacher like Eaccelerator or XCache. I think that's where you're going to get your biggest benefit.
    Since it's currently "running well" I'd say it's difficult to establish his "bottleneck" without load testing to actually find it... I'm also curious how PHP could ever create a bottleneck without CPU/memory/IO as a root cause? (actual cause would of course be the PHP code itself, which could potentially be optimised in some sense, but it would manifest as some sort of heavy resource usage on an actual part of the system).

    Despite that, I certainly agree that installing one of the various opcode caching systems may help with performance. If I may also add, it does seem a strange concept to look at how to use a certain resource simply because it's there: i.e. if everything works well what needs "fixing" exactly?

    Quote Originally Posted by SA-ChrisM View Post
    As a side note, unless your application is *specifically* written to use memcached, it serves no purpose running it on your server.
    I think we're saying the same thing, but to clarify - you can install and make good use of memcached in conjunction with pre-written applications which were not written to use it. However, you will of course need to re-write some parts to take advantage of it.

    My point is simply that just because your forum/blog/cart etc. software doesn't inherently 'support' memcached doesn't mean that you couldn't easily modify it to do so. Though of course as with any 'mod' you may perform on some third party scripts it's worth keeping in mind the additional work you'll have on your hands for each time a new version is released that you wish to upgrade to...
    UK, Chicago, & Singapore Fully Managed Cloud VPS
    UK & Arizona Jelastic Java, PHP & Ruby PaaS

    Comprehensive SLAs, backups, full SSD, rebootless kernel updates.
    Experienced managed hosting provider since 2001. True 24x7 Support & Server Management

Similar Threads

  1. Server Load/CPU Usage/Memory Usage
    By -YaYa- in forum Running a Web Hosting Business
    Replies: 18
    Last Post: 02-11-2006, 12:43 AM
  2. server load, cpu usage, memory usage
    By Nullified in forum Programming Discussion
    Replies: 4
    Last Post: 12-31-2004, 08:46 PM
  3. Memory Usage
    By al11 in forum Web Hosting
    Replies: 4
    Last Post: 12-30-2004, 12:29 AM
  4. Memory & CPU Usage
    By Bobby_Jo in forum Hosting Security and Technology
    Replies: 7
    Last Post: 07-30-2003, 12:54 AM
  5. memory usage
    By sonik in forum Dedicated Server
    Replies: 7
    Last Post: 04-07-2001, 03:53 AM

Posting Permissions

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