Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-2011, 05:02 AM
Member
 
Posts: 12
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:

Quote:
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:
Quote:
threadcache = 20
maxconnections = 20
vi /opt/zimbra/conf/amavisd.conf.in in:
Quote:
$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 07:02 AM..
Reply With Quote
  #2 (permalink)  
Old 02-02-2011, 02:17 PM
Elite Member
 
Posts: 281
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
Reply With Quote
  #3 (permalink)  
Old 02-03-2011, 12:09 AM
Advanced Member
 
Posts: 198
Default

please paste the output of top -c and free -m here.
Reply With Quote
  #4 (permalink)  
Old 02-03-2011, 08:08 AM
Moderator
 
Posts: 1,209
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
__________________
___________________________________
L. Mark Stone, CIO


"Uptime. All the time."

477 Congress Street | Portland, ME 04101-3431 | (207) 772-5678

proactive maintenance and monitoring | technology consulting
Zimbra groupware | EMR implementations | private cloud hosting
Reply With Quote
  #5 (permalink)  
Old 02-03-2011, 07:35 PM
Loyal Member
 
Posts: 88
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.
__________________
Running Zimbra on:
Dell PE1800
CentOS 5.x x86_64
1 x p-4 3.0 ghz xeon w/HT
6 gigs ram
8 users
250 gig MDRAID 1
Release 7.1.4_GA_2555.RHEL5_64_20120105094627 CentOS5_64 FOSS edition.
Reply With Quote
  #6 (permalink)  
Old 02-03-2011, 07:36 PM
Loyal Member
 
Posts: 88
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..
__________________
Running Zimbra on:
Dell PE1800
CentOS 5.x x86_64
1 x p-4 3.0 ghz xeon w/HT
6 gigs ram
8 users
250 gig MDRAID 1
Release 7.1.4_GA_2555.RHEL5_64_20120105094627 CentOS5_64 FOSS edition.
Reply With Quote
  #7 (permalink)  
Old 02-07-2011, 04:32 PM
Loyal Member
 
Posts: 88
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.
__________________
Running Zimbra on:
Dell PE1800
CentOS 5.x x86_64
1 x p-4 3.0 ghz xeon w/HT
6 gigs ram
8 users
250 gig MDRAID 1
Release 7.1.4_GA_2555.RHEL5_64_20120105094627 CentOS5_64 FOSS edition.
Reply With Quote
  #8 (permalink)  
Old 02-08-2011, 12:20 PM
Intermediate Member
 
Posts: 22
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.