Results 1 to 8 of 8

Thread: OK, but how to really reduce memory usage?

  1. #1
    mr.interested is offline Member
    Join Date
    Jan 2011
    Posts
    12
    Rep Power
    4

    Default OK, but how to really reduce memory usage?

    I've finally managed to install Zimbra (I've tried both open-source and ne) on my VPS with 4gb of RAM (with 3gb guaranteed). I've installed Zimbra on completely naked system (Ubuntu 10.10 64-bit) which uses roughly 20mb of RAM. I didn't install unnecessary components like logger or spell check. Just very basic installation.

    I need to configure it so it will use 1.5-2gb of RAM at the very maximum for no more than 5 users.

    I've then followed so many threads here advising how to reduce memory usage, by issuing the following commands:

    zmlocalconfig -e tomcat_java_heap_memory_percent=40
    zmlocalconfig -e mysql_memory_percent=10
    zmlocalconfig -e mysql_table_cache=250
    zmlocalconfig -e mailboxd_java_heap_memory_percent=10
    zmlocalconfig -e zmmtaconfig_interval=7200
    zmmtactl restart
    vi /opt/zimbra/conf/my.cnf in:
    threadcache = 20
    maxconnections = 20
    vi /opt/zimbra/conf/amavisd.conf.in in:
    $max_servers = 10;
    to:
    $max_servers = 2;
    And? Nothing. The consumption is always between 3.5 and 4gb:



    The very flat line from the beginning shows how the usage looked like when I left Zimbra overnight, doing nothing (!). The two "mountains" towards the end show two attempts to again install Zimbra. Each time the consumptions was below 4gb.

    The below depicts in detail how the reconfiguration "worked". The servers were restarted in half-way, but then again, after servers started the memory usage went through the roof.



    I love Zimbra. It's a fantastic system, but during the past few days I installed Zimbra at least 20 times, spending 12+ hours a day. Please, can anyone advise me on how to make it work by using only 2gb at the very maximum for no more than 5 users?
    Last edited by mr.interested; 02-02-2011 at 08:02 AM.

  2. #2
    fcash is offline Elite Member
    Join Date
    Jun 2007
    Location
    BC, Canada
    Posts
    281
    Rep Power
    8

    Default

    If you look in "top" or "free" output, where is the memory being used? If it's in the Inactive, Buffer, or Cache, then that's normal. The kernel is cacheing data in RAM to make the most use of it ("free" or "unused" RAM is wasted RAM). If apps need more RAM, the kernel will flush the buffers/cached RAM and allocate it to the app.

    It's only if the Wired/Active column is at 4 GB, or if Swap usage is high, that you have to worry.
    Freddie

  3. #3
    Saturdays is offline Advanced Member
    Join Date
    Jun 2010
    Posts
    198
    Rep Power
    5

    Default

    please paste the output of top -c and free -m here.

  4. #4
    LMStone's Avatar
    LMStone is offline Moderator
    Join Date
    Sep 2006
    Location
    477 Congress Street | Portland, ME 04101
    Posts
    1,374
    Rep Power
    11

    Default

    Likely MySQL is using a lot of RAM; this can only be trimmed by editing the my.cnf file post-install, as the Zimbra installer allocates RAM to MySQL based on how much RAM the installer sees at the time of install.

    If you install and run mysqltuner.pl (wget http://mysqltuner.pl to download), it will tell you how big your InnoDB databases are and how (much) bigger your InnoDB buffer pool is.

    Create your five mailboxes and get some emails in them to get the MySQL database populated. Then, you can run mysqltuner.pl and with the information reported, you can reduce the InnoDB buffer pool size to, say, 200MB more than the size of your InnoDB database. As you use the system more, your InnoDB database usage will grow, so it's a good idea to run the tool every few weeks or months to make sure you are allocating enough RAM to MySQL. BTW, if you don't, Zimbra will still run but MySQL will just be slow. :-)

    Hope that helps,
    Mark

  5. #5
    hescominsoon is offline Special Member
    Join Date
    Sep 2010
    Posts
    106
    Rep Power
    4

    Default

    Quote Originally Posted by LMStone View Post
    Likely MySQL is using a lot of RAM; this can only be trimmed by editing the my.cnf file post-install, as the Zimbra installer allocates RAM to MySQL based on how much RAM the installer sees at the time of install.

    If you install and run mysqltuner.pl (wget http://mysqltuner.pl to download), it will tell you how big your InnoDB databases are and how (much) bigger your InnoDB buffer pool is.

    Create your five mailboxes and get some emails in them to get the MySQL database populated. Then, you can run mysqltuner.pl and with the information reported, you can reduce the InnoDB buffer pool size to, say, 200MB more than the size of your InnoDB database. As you use the system more, your InnoDB database usage will grow, so it's a good idea to run the tool every few weeks or months to make sure you are allocating enough RAM to MySQL. BTW, if you don't, Zimbra will still run but MySQL will just be slow. :-)

    Hope that helps,
    Mark
    java is the ram eater and if you hamstring it zimbras performance craters.

  6. #6
    hescominsoon is offline Special Member
    Join Date
    Sep 2010
    Posts
    106
    Rep Power
    4

    Default

    Quote Originally Posted by mr.interested View Post
    I've finally managed to install Zimbra (I've tried both open-source and ne) on my VPS with 4gb of RAM (with 3gb guaranteed). I've installed Zimbra on completely naked system (Ubuntu 10.10 64-bit) which uses roughly 20mb of RAM. I didn't install unnecessary components like logger or spell check. Just very basic installation.

    I need to configure it so it will use 1.5-2gb of RAM at the very maximum for no more than 5 users.

    I've then followed so many threads here advising how to reduce memory usage, by issuing the following commands:



    vi /opt/zimbra/conf/my.cnf in:


    vi /opt/zimbra/conf/amavisd.conf.in in:


    And? Nothing. The consumption is always between 3.5 and 4gb:



    The very flat line from the beginning shows how the usage looked like when I left Zimbra overnight, doing nothing (!). The two "mountains" towards the end show two attempts to again install Zimbra. Each time the consumptions was below 4gb.

    The below depicts in detail how the reconfiguration "worked". The servers were restarted in half-way, but then again, after servers started the memory usage went through the roof.



    I love Zimbra. It's a fantastic system, but during the past few days I installed Zimbra at least 20 times, spending 12+ hours a day. Please, can anyone advise me on how to make it work by using only 2gb at the very maximum for no more than 5 users?
    Look at my system. I have it running fine with little tinkering. are you digging into swap badly? set vm.swappiness=0. That's the only thing i did to modify ram usage. now the machine simply doesn't swap at all..

  7. #7
    hescominsoon is offline Special Member
    Join Date
    Sep 2010
    Posts
    106
    Rep Power
    4

    Default

    Quote Originally Posted by mr.interested View Post
    I've finally managed to install Zimbra (I've tried both open-source and ne) on my VPS with 4gb of RAM (with 3gb guaranteed). I've installed Zimbra on completely naked system (Ubuntu 10.10 64-bit) which uses roughly 20mb of RAM. I didn't install unnecessary components like logger or spell check. Just very basic installation.

    I need to configure it so it will use 1.5-2gb of RAM at the very maximum for no more than 5 users.

    I've then followed so many threads here advising how to reduce memory usage, by issuing the following commands:



    vi /opt/zimbra/conf/my.cnf in:


    vi /opt/zimbra/conf/amavisd.conf.in in:


    And? Nothing. The consumption is always between 3.5 and 4gb:



    The very flat line from the beginning shows how the usage looked like when I left Zimbra overnight, doing nothing (!). The two "mountains" towards the end show two attempts to again install Zimbra. Each time the consumptions was below 4gb.

    The below depicts in detail how the reconfiguration "worked". The servers were restarted in half-way, but then again, after servers started the memory usage went through the roof.



    I love Zimbra. It's a fantastic system, but during the past few days I installed Zimbra at least 20 times, spending 12+ hours a day. Please, can anyone advise me on how to make it work by using only 2gb at the very maximum for no more than 5 users?
    if you aren't digging into swap 90% ram usage or even 95% ram usage is normal for a Linux machine. Linux will use everything it can for caching for speed. If you aren't digging into swap and if the machine is performing well high memory usage is normal.

  8. #8
    blackpuma's Avatar
    blackpuma is offline Intermediate Member
    Join Date
    Oct 2007
    Posts
    22
    Rep Power
    7

    Default

    Quote Originally Posted by hescominsoon View Post
    if you aren't digging into swap ...
    This is a long the lines of what went through my mind. What are those memory graphs representing? Are you sure you're measuring what you think are?

    If it's just "used" RAM, like represented by the top program, it's meaningless. Idle RAM is wasted hardware. Linux makes good use of idle RAM by caching. This is what you want to see.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mozilla and memory usage
    By Klug in forum Developers
    Replies: 2
    Last Post: 03-17-2008, 03:52 AM
  2. Memory usage on Zimbra 5.0.2 NE on RHEL 5.1?
    By Miklos Kalman in forum Administrators
    Replies: 6
    Last Post: 03-03-2008, 04:19 PM
  3. Replies: 0
    Last Post: 11-03-2007, 01:32 PM
  4. [SOLVED] how to set tomcat memory usage in 4.5.x?
    By jeffw in forum Installation
    Replies: 6
    Last Post: 11-02-2007, 12:13 PM
  5. Client Memory Usage
    By jwilso2 in forum Users
    Replies: 13
    Last Post: 07-16-2007, 06:10 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
  •