Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Performance tuning

  1. #1
    joho's Avatar
    joho is offline Loyal Member
    Join Date
    Jan 2009
    Location
    Stockholm, Sweden
    Posts
    96
    Rep Power
    6

    Question Performance tuning

    So, we're beginning to see some not-so-good performance on our Zimbra server since installing 6.0.6. I'm not sure there's any relation to the version per se, we are migrating more and more accounts over to it, so that may very well be a reason.

    I'm trying to do some performance-tuning reading .. our systems is a dual quad-core Xeon with 28GB of memory. It appears to me it's doing caching in the wrong places since the java process is consuming 8-12 GB depending on how you count. It'd be nicer to put some more memory to MySQL use, for example. Or message caching. As for message caching, I've seen these suggestions:

    * To see current setting
    zmprov gs `zmhostname` zimbraMessageCacheSize
    * To modify setting
    zmprov ms `zmhostname` zimbraMessageCacheSize 104857600

    and

    # can be set on global config or server
    zmprov ms zimbraMessageCacheSize 104857600
    Except that the highest allowed value according to zmprov is 10000 .. (currently set to 2000).. say what?


    -joho

  2. #2
    Krishopper is offline Dedicated Member
    Join Date
    Dec 2006
    Location
    Minneapolis MN
    Posts
    775
    Rep Power
    9

    Default

    The attribute definition is "Maximum number of JavaMail MimeMessage objects in the message cache.", so I think they may have changed it from size (bytes/KB/etc.) to a simple count of the number of items at one point. Not sure when, though.

  3. #3
    joho's Avatar
    joho is offline Loyal Member
    Join Date
    Jan 2009
    Location
    Stockholm, Sweden
    Posts
    96
    Rep Power
    6

    Default

    Hmm.. but that could mean "any amount of memory", depending on how big the messages are.. no?



    -joho

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

    Default

    Try running the script here as the zimbra user: http://mysqltuner.pl/mysqltuner.pl and post the results.

    We can analyze the results for you and make some tuning recommendations accordingly.

    If your mail volumes are picking up, I'd also recommend using a RAM disk for the Amavis temp directory to relieve pressure on the hard disks.

    Hope that helps,
    Mark

  5. #5
    thunder04 is offline Special Member
    Join Date
    Dec 2007
    Location
    At work...Menlo Park, CA
    Posts
    155
    Rep Power
    7

    Default

    I ran mysqltuner.pl (as zimbra user) on my Zimbra server (8.0.2 on Ubuntu 10.04) and one of its recommendations is to run OPTIMIZE TABLE. I figure this won't hurt (right?), so I want to do it. However, when I run "mysqlcheck -o --all-databases" as user zimbra, I get the error:

    Code:
    mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    Sorry to be such a n00b. What am I doing wrong? How can I accomplish this?

    Thanks!

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

    Default

    Quote Originally Posted by thunder04 View Post
    I ran mysqltuner.pl (as zimbra user) on my Zimbra server (8.0.2 on Ubuntu 10.04) and one of its recommendations is to run OPTIMIZE TABLE. I figure this won't hurt (right?), so I want to do it. However, when I run "mysqlcheck -o --all-databases" as user zimbra, I get the error:

    Code:
    mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    Sorry to be such a n00b. What am I doing wrong? How can I accomplish this?

    Thanks!
    /var/run/mysqld is the default location for the mysql socket file; Zimbra uses a different location.

    If you open /opt/zimbra/conf/my.cnf via less or cat, you'll find the actual location of the socket file, and then you can specify that as a parameter in mysqlcheck.

    We have never found we needed to optimize the tables for performance reasons, even on mailbox servers with several thousand mailboxes. What have found helps with performance is to make sure that the InnoDB Buffer Pool is at least a little larger than the InnoDB table size. MySQLTuner.pl will flag this for you; it's one of the last report outputs.

    If you really still want to do this, I would do so with Zimbra stopped and only after backing up MySQL. IOW, as the zimbra user:

    1. zmcontrol stop
    2. Copy the MySQL directory someplace safe, and for belts 'n suspenders insurance, run a mysql dump after starting just mysql.
    3. mysql start
    4. MySQL dump (just in case)
    5. optimize the tables
    6. flush the tables to disk and then mysql stop
    7. Start Zimbra, test and if OK carry on, else stop Zimbra, restore MySQL


    Hope that helps,
    Mark
    Last edited by LMStone; 01-03-2013 at 09:17 AM.

  7. #7
    thunder04 is offline Special Member
    Join Date
    Dec 2007
    Location
    At work...Menlo Park, CA
    Posts
    155
    Rep Power
    7

    Default

    We have ~360 mailboxes. If doing an OPTIMIZE TABLES won't benefit us performance wise, then I won't go through the trouble. Along with doing this, the script also recommended adjusting the query_cache_size to >= 8M.

    However, Zimbra hasn't been running for 24 hours yet (made some config changes yesterday), so I was going to wait and re-run the script tomorrow to see if this is still a recommendation (or if additional recommendations come up)...unless you think it's safe to make that change now?

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

    Default

    Quote Originally Posted by thunder04 View Post
    We have ~360 mailboxes. If doing an OPTIMIZE TABLES won't benefit us performance wise, then I won't go through the trouble. Along with doing this, the script also recommended adjusting the query_cache_size to >= 8M.

    However, Zimbra hasn't been running for 24 hours yet (made some config changes yesterday), so I was going to wait and re-run the script tomorrow to see if this is still a recommendation (or if additional recommendations come up)...unless you think it's safe to make that change now?
    The Query Cache is turned off by design. The mail store is changing frequently so caching mailbox query results is a bit of a waste.

    Assuming you didn't either add RAM to your Zimbra server after you installed Zimbra or you have less than, say, ~20GB of email per user, I'd speculate that your InnoDB Pool Buffer size as configured in /opt/zimbra/conf/my.cnf still exceeds your InnoDB database size.

    IOW, likely for that small a Zimbra server no MySQL tuning will be necessary.

    The most effective things you can do to have a fast single Zimbra server of that size is to have wicked fast underlying disk storage (i.e. RAID 10 of 15K DASD disks or a SAN with good cache and >1,500 IOPS at least available just for the Zimbra server), to put Amavis's tmp directory on a RAM disk, make sure vm.swappiness is set to 0, have highly responsive DNS servers available to Zimbra and have 12GB or more of RAM.

    Hope that helps,
    Mark

  9. #9
    thunder04 is offline Special Member
    Join Date
    Dec 2007
    Location
    At work...Menlo Park, CA
    Posts
    155
    Rep Power
    7

    Default

    Got it. I'll seek more memory for our server (it's got 8 GB, but I can find memory cheap on eBay!) and go from there.

    Thanks!!

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

    Default

    Quote Originally Posted by thunder04 View Post
    Got it. I'll seek more memory for our server (it's got 8 GB, but I can find memory cheap on eBay!) and go from there.

    Thanks!!
    Terrific!

    Keep in mind that /opt/zimbra/conf/my.cnf is created at initial install based on the amount of RAM installed in the server at that time and never thereafter updated.

    So, if mysqltuner.pl ever reports that your innodb buffer pool is smaller than your innodb database, you'll need to increase that allocation by hand editing the Zimbra my.cnf file and restarting Zimbra.

    mysqltuner.pl will report this, which as you can see is OK because the buffer size exceeds the database size:

    Code:
    [OK] InnoDB data size / buffer pool: 2.2G/2.5G
    If your values are the other way around, mysqltuner will flag that item with two exclamation points instead of the "[OK]" and then you need to edit the following:

    Code:
    malbec:~ # cat /opt/zimbra/conf/my.cnf | grep innodb_buffer_pool
    # innodb_buffer_pool_size        = 2452764672
    innodb_buffer_pool_size        = 2560M
    malbec:~ #
    Zimbra's default is to specify the size in bytes (commented out above); we prefer to do so in MB to make it more readable. Both are acceptable formats for this variable.

    Hope that helps,
    Mark

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Filesystem performance
    By bonadio in forum Administrators
    Replies: 2
    Last Post: 04-26-2008, 08:51 PM
  2. Web Client Performance
    By palmczak in forum Installation
    Replies: 14
    Last Post: 03-21-2008, 10:10 AM
  3. Replies: 11
    Last Post: 12-03-2006, 01:29 PM
  4. Zimbra Hardware performance and upgradation
    By mansuper in forum Administrators
    Replies: 8
    Last Post: 10-25-2006, 07:51 PM
  5. Performance, spam and lot more
    By montievv in forum Administrators
    Replies: 1
    Last Post: 07-24-2006, 11:24 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
  •