Archived community.zenoss.org | full text search
Skip navigation
1 2 Previous Next 37596 Views 16 Replies Latest reply: Jul 28, 2011 7:24 PM by MattRK RSS
bbibeault ZenossEmployee 142 posts since
May 19, 2009
Currently Being Moderated

Jul 22, 2010 2:13 PM

Zenoss Core Performance Tuning

Zenoss Core Performance Tuning

The  purpose of this article is to highlight various steps a Zenoss  administrator can take to resolve performance issues. Zenoss performance  issues can have the following symptoms:

 

  • slowness of the web ui (event console, status page)
  • frequent heartbeat failures
  • gaps in performance graphs
  • slow startup/restart times of Zenoss

 

 

 

The  above symptoms can be caused by any number of reasons. Here are the  various areas that should be investigated when trying to tune a Zenoss  deployment.

 

System Resources

The following system resource requirements assume the following:

  • a mix of devices is being monitored (Windows, Unix, routers, switches, firewalls)
  • events will be removed from the database after a reasonable amount of time (6-12mo)
  • no device is spewing an enormous amount of events at Zenoss (syslog or traps)

 

Deployment Size: S (0-250 Devices)

4GB RAM

2 CPU Cores

300GB, 10K RPM Drives

 

Deployment Size: M (250-500 Devices)

4-8GB RAM

4 CPU Cores

300GB, 10K RPM Drive

 

Deployment Size: L (500-1000)

8GB RAM

4-8 CPU Cores

75GB, 15K RPM Drives

300GB, 10K RPM Drives

 

Deployment Size: XL (1000-1500)

16GB RAM

8 CPU Cores

75GB, 15K RPM Drives

300GB, 10K RPM Drives

Filesystem Tuning

Zenoss  stores all its performance data in RRD files. As a result, Zenoss  constantly has to access a great number of files during performance  collection. These performance updates are 8 bytes per datapoint, which  translates into 4KB filesystem blocks. Under such a high volume/low  throughput usage pattern, journaled filesystems can be very bad for I/O  performance. If possible, Zenoss servers should have a non-journaled  filesystem partition for performance data (located under $ZENHOME/perf).

 

If the setup of a separate partition/filesystem is not possible we recommend the use of the options below:

 

defaults,noatime,nodiratime,data=writeback,commit=100

 

These  options should be placed into the /etc/fstab file and will take effect  after rebooting the system. For more information on filesystem  performance tuning with regards to increasing RRD performance, please  see: http://oss.oetiker.ch/rrdtool-trac/wiki/TuningRRD

MySQL Tuning

 

Assuming  the above system resources are met, MySQL often becomes the first  bottleneck. This is due to the default MySQL configuration being a  “starter only” configuration, and not intended for production use. When a  Zenoss system is deployed for the first time, it is easy to  underestimate the event load the system will have to deal with.  Considering that Zenoss receives events from syslog, SNMP traps, and  Windows event log, event load can easily add up to multiple gigabytes  per week or even per day. It is therefore important to limit both the  number of received events as well as the number of events retained in  the database. This can be done by dropping unneeded events and  configuring jobs to age events periodically.

 

Since  Zenoss stores all event-based data in the MySQL database, MySQL  performance impacts the entire Zenoss UI. The Zenoss administrator  should use a configuration that allows MySQL to more fully utilize the  hardware resources of the Zenoss server. The following configuration is a  good starting point:

 

[mysqld]

user=mysql

innodb_file_per_table

# Default to using old password format for compatibility with mysql

# 3.x clients (those using the mysqlclient10 compatibility package).

old_passwords=1

 

skip_locking

innodb_buffer_pool_size = [see below]

 

innodb_additional_mem_pool_size = 32M

innodb_log_buffer_size = 2M

innodb_flush_method = O_DIRECT

innodb_fast_shutdown = 1

innodb_flush_log_at_trx_commit = 2

innodb_thread_concurrency = 4

query_cache_size = 32M

 

 

 

innodb_buffer_pool_size

should be set to the following:

 

System Sizeinnodb_buffer_pool_size
S512M
M512M or 1024M (depending on RAM size)
L1024M
XL2048M
XXL4096M

 

 

 

Note:  For most Zenoss dedicated MySQL installations the above configuration  will work as shown; others might require additional options added to  guarantee proper functioning of the database. Before deploying the  configuration above please create a backup of your current configuration  located under /etc/my.cnf. Deploy the configuration to /etc/my.cnf and  restart the MySQL server.

 

 

 

For  administrators that want to take further steps to optimize MySQL we  recommend the use of the excellent MySQLTuner script to be found at  http://wiki.mysqltuner.com/ MySQLTuner

 

 

 

Zope Performance

 

Zope  is the application server that runs the Zenoss web UI. In combination  with ZEO, user  experience mostly hinges on proper performance tuning of  the Zope-ZEO combo. Unfortunately, Zope/ZEO tunning is not an exact  science. Optimal performance might require several iterations. However,  the settings below will help to improve performance:

 

Search and configure the following settings in $ZENHOME/etc/zope.conf

 

Default setting: cache-size 5000

S and M systems: cache-size 50000

L and XL systems: cache-size 100000 (or more)

 

The  recommendations made here assume you followed the hardware  recommendations above. This setting will most likely have the single  biggest impact on UI performance. It is related to how many objects are  in the ZEO database, which in turn is a function of how many and what  type of devices are in the system. If you log in as the admin user and  visit the following URL:

 

http://YOUR_SERVER:8080/Control_Panel/Database/main/ manage_cacheParameters

 

you  will be able to see how many objects are in your database. Please note  that the cache-size setting actually specifies the number of objects.  This means that it might be difficult to gauge how much memory will  actually be consumed. This can only be determined after Zope has been  running by actually looking at ps/top output. Also, the cache is shared  by all zserver-threads (see below), which means that if you increase the  number of zserver-threads it is usually recommended to also increase  the cache-size. The above recommendation assumes you don't run more than  6 threads.

 

Default setting: zserver-threads = 4

S and M systems: zserver-threads = 4

L and XL systems: zserver-threads = 10 (also add pool-size 50 after cache-size in the configuration file)

 

This  number represents the number of threads Zope uses to serve client  requests. It it very important to understand that more is not equals  better for this setting; on the contrary, some applications perform  better with fewer threads. Also note that increasing the zserver-threads  above 7 will require an increase in pool-size (see above).

 

ZEO Performance

 

ZEO  (Zope Enterprise Objects) is the database behind most of the Web UI. As  mentioned above, ZEO and Zope both have to be tuned in order to achieve  optimal UI performance. The data behind the ZEO database is stored in  the $ZENHOME/var/Data.fs file. To ensure proper performance it is vital  that this file be located on a fast filesystem.

Zeopack

The  ZEO database keeps tracks of all transactions that are performed, this  means that the database file will grow over time to become quite large. A  larger file will slow down overall access times, we therefore advice to  “pack” this file frequently. Packing means that old transactions are  removed from the data store, resulting in a smaller file and therefore  faster access. We generally recommend that the following job be run on a  set schedule via cron to be run by the zenoss user. Also, it is  important to combine the packing with a backup prior to the packing,  since the data is changed during packing.

 

#run pack every monday morning at 2am

0 2 * * 1 bash -lc “$ZENHOME/bin/zeopack.py -h localhost -p 8100 >> /PATH/TO/ SOME/logfile.log 2>&1

 

Data.fs on ramdisk

The  ultimate speed-up can be achieved if one configures the Data.fs file to  be located in a ramdisk. Note: The setup of the ramdisk and making it  persistent to bring it back after reboot is outside the scope of this  article. Given you have an available ramdisk, you can simply shutdown  Zenoss delete any non Data.fs files (index, lock, tmp). Edit the  $ZENHOME/etc/zeo.conf file and change the <filestorage 1> section  to look as follows:

 

<filestorage 1>

#old storage location

#path $INSTANCE/var/Data.fs

#used for ramdisk

path /PATH/TO/RAMDISK/Data.fs

</filestorage>

 

 

 

Once  you restart, zeo will access the Data.fs file in its new location.  Note: since ramdisks are highly volatile it is recommended to perform  high frequency backups on top of your regular backups. The following  script could be used to do this:

 

 

 

#!/bin/bash

 

#this script creates backups and also handles cleanups #it is used to take care of the ramdisk

 

#directory for the backups BLOC=$ZENHOME/backups/rapids/

 

#create backup filename so we don't conflict

 

FILENAME=${BLOC}'rapidBackup.'`date  +%F-%H-%M`'.tgz' /opt/zenoss/bin/zenbackup --no-eventsdb --no-perfdata  --temp-dir=/apps/ zenoss/backups_tmp --file=${FILENAME}

 

#delete all backups older than 6h find ${BLOC} -mmin +720 -delete

 

 

The  above should be run every 30min or even more often, and the latest  backup can be used to restore data after sudden power failures. It is  important to understand that the use of a ramdisk can potentially cause  data loss; however, since after initial Zenoss configuration, most data  contained within ZEO does not change constantly, it is a small risk to  take, especially since at most 30min of data will be lost.

  • MattRK Rank: White Belt 57 posts since
    Apr 28, 2010
    Currently Being Moderated
    1. Jul 23, 2010 3:41 PM (in response to bbibeault)
    Re: Zenoss Core Performance Tuning

    I have a quick question regarding the filesystem tuning. I'm planning to start fresh with 3.0 and i'm in the process of building the new box Zenoss will live on. Its a dual xeon server with 4gb of ram. I'm not very familiar with setting up the linux filesystem and how it handles partitions and such. I'm wondering if you could give me a suggestion on how to configure my setup. I'm going to be installing CentOS 5.4.

     

    I have two raid arrays.

     

    Volume 1) ~36gb total

    • 2 x 36gb 15k sas drives in a raid 1 config

     

    Volume 2) ~438gb total

    • 4 x 146gb 15k sas drives in a raid 5 config

     

     

    I'm looking for suggested setup including how to partition the volumes for $ZENHOME, mysql, and the OS as well as what type of filesystem to use. (Non-jounaled was suggested for the $ZENHOME but I don't know what type)

     

    Initially i thought of using the 36gb volume for the OS and then creating two seperate partitions from the 438gb volume. One for sql and one for $ZENHOME. But i'm not sure if thats the ideal setup.

     

    Any help would be appriciated.

     

    Thanks!

  • MattRK Rank: White Belt 57 posts since
    Apr 28, 2010
    Currently Being Moderated
    2. Jul 23, 2010 5:01 PM (in response to MattRK)
    Re: Zenoss Core Performance Tuning

    I guess my main question is how should i divide up the second volume between the MYSQL partition and the $ZENHOME partition. Should it be split down the middle 50/50. Does one require more space than the other? I realize that it all depends on how many devices i'm monitoring. I'm really just looking for a recommended setup. E.g. On agerage for every 1MB of MYSQL data $ZENHOME consume .5MB. Or the otherway around.

     

    Thanks!

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    3. Jul 26, 2010 8:47 AM (in response to MattRK)
    Re: Zenoss Core Performance Tuning

    Well, I haven't had to do any real performance tuning on my system yet, but from what I gather, most of the data is going to be in the filesystem in $ZENHOME. At least, that's where the graphs, your custom scripts, and much of the Zenpack data goes. MySQL size is going to depend on how many events you want to keep, but we haven't seen that get very large really .... How many devices are you looking to monitor? How many datapoints?

     

    I've got about 100 devices, and so far with 2 years of back data I'm not using over 20G of space. We use the standard CENTOS5 filesystem, which I think is ext3.

     

    I would put the OS on array 1, and everything else on array 2 - I don't see any reason to partition MySQL or anything off from the $ZENHOME...

     

    --

    James Pulver

    Information Technology Area Supervisor

    LEPP Computer Group

    Cornell University

  • MattRK Rank: White Belt 57 posts since
    Apr 28, 2010
    Currently Being Moderated
    4. Jul 26, 2010 11:32 AM (in response to jmp242)
    Re: Zenoss Core Performance Tuning

    Thanks for the response. We have right about 100 devices. (Between physical and virtual servers & network gear)

     

    At this point i'm still working with ESXi. My original plan (when i posted this) Was to kill ESXi and just install CentOS on the physical box. (Mainly because the machine has 4 gigs of ram. ESXi eats about 1gb of that.) This weekend i configured the new VM as follows. I switched from a thin provisioned disk to a flat disk based on some information i read regarding poor performance on thin provisioned disks with SQL. Here is the new setup. I configured this manually during the setup of CentOS 5.4.

     

    *Primary Partitions*

    /boot     -     100mb     -     ext3

    /           -     30gb        -     ext3

    /swap   -     1gb          -     swap

     

    *Extended Partitions*

    /var     -      35gb         -     ext3

    /opt    -      35gb         -      ext2

     

     

    Any opinions on this setup?

     

    Thanks!

  • sjacobs Rank: White Belt 63 posts since
    Aug 26, 2009
    Currently Being Moderated
    5. Jul 28, 2010 5:17 AM (in response to bbibeault)
    Re: Zenoss Core Performance Tuning

    About the mysql tuning.

     

    I have a second instance running specially for zenoss on the machine.

     

    the my.cf is located in the /usr/local/zenoss/mysql directory I guess I have to modify the my.cf there and not in the /etc like decreibed in the manual here?

     

    [mysqladmin]
    user=root

    [mysqld]
    basedir=/usr/local/zenoss/mysql
    datadir=/usr/local/zenoss/mysql/data
    port=3307
    socket=/usr/local/zenoss/mysql/tmp/mysql.sock
    tmpdir=/usr/local/zenoss/mysql/tmp

    [mysqld_safe]
    mysqld=mysqld.bin

    [client]
    port=3307
    socket=/usr/local/zenoss/mysql/tmp/mysql.sock

    [manager]
    port=3307
    socket=/usr/local/zenoss/mysql/tmp/mysql.sock
    pid-file=/usr/local/zenoss/mysql/tmp/manager.pid
    default-mysqld-path=/usr/local/zenoss/mysql/bin/mysqld.bin

     

    Update

     

    Did the changes in Mysql and in Zope what i want to do is ...

     

    Zeopack

    The  ZEO database keeps tracks of all transactions that are performed, this  means that the database file will grow over time to become quite large. A  larger file will slow down overall access times, we therefore advice to  “pack” this file frequently. Packing means that old transactions are  removed from the data store, resulting in a smaller file and therefore  faster access. We generally recommend that the following job be run on a  set schedule via cron to be run by the zenoss user. Also, it is  important to combine the packing with a backup prior to the packing,  since the data is changed during packing.

     

    #run pack every monday morning at 2am

    0 2 * * 1 bash -lc “$ZENHOME/bin/zeopack.py -h localhost -p 8100 >> /PATH/TO/ SOME/logfile.log 2>&1

     

    I seem to miss the zeopack.py in the "ZENHOME/bin/zeopack.py"

     

    I did find them here ...

    snlmon01:/usr/local/zenoss/zenoss/etc # locate zeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/manual_tests/testzeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/zeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/zeopack.pyc
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZODB/scripts/manual_tests/testzeopack.py

     

    What to do copy it to the $ZENHOME/bin location ... or is my installation f$ck$d

     

  • rgartley Rank: White Belt 23 posts since
    Jan 23, 2008
    Currently Being Moderated
    7. Jul 28, 2010 11:02 AM (in response to bbibeault)
    Re: Zenoss Core Performance Tuning

    LOL... I found this post on the web yesterday and I was going to link to it here. It works great! Thanks for the tip!

     

    Still not going to remove the bookmark though!

  • sjacobs Rank: White Belt 63 posts since
    Aug 26, 2009
    Currently Being Moderated
    8. Jul 29, 2010 5:19 AM (in response to bbibeault)
    Re: Zenoss Core Performance Tuning

    And what about this one ???

     

    Zeopack

    The  ZEO database keeps tracks of all transactions that are performed, this  means that the database file will grow over time to become quite large. A  larger file will slow down overall access times, we therefore advice to  “pack” this file frequently. Packing means that old transactions are  removed from the data store, resulting in a smaller file and therefore  faster access. We generally recommend that the following job be run on a  set schedule via cron to be run by the zenoss user. Also, it is  important to combine the packing with a backup prior to the packing,  since the data is changed during packing.

     

    #run pack every monday morning at 2am

    0 2 * * 1 bash -lc “$ZENHOME/bin/zeopack.py -h localhost -p 8100 >> /PATH/TO/ SOME/logfile.log 2>&1

     

    I seem to miss the zeopack.py in the "ZENHOME/bin/zeopack.py"

     

    I did find them here ...

    snlmon01:/usr/local/zenoss/zenoss/etc # locate zeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/manual_tests/testzeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/zeopack.py
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZEO/scripts/zeopack.pyc
    /usr/local/zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-i686.egg/ZODB/scripts/manual_tests/testzeopack.py

     

    What to do copy it to the $ZENHOME/bin location ... or is my installation f$ck$d

  • rgartley Rank: White Belt 23 posts since
    Jan 23, 2008
    Currently Being Moderated
    9. Jul 29, 2010 12:04 PM (in response to sjacobs)
    Re: Zenoss Core Performance Tuning

    I'd say your install is f$ck$d as zeopack.py is located in the $ZENHOME/bin/ directory. I'm running ver 2.5.2.

     

    Couldn't tell you what to do on this one, but I'd sure try to copy it over an see what happens..... but that's just me.

  • Gabe Rank: Green Belt 94 posts since
    Jun 29, 2008
    Currently Being Moderated
    10. Aug 18, 2010 4:39 AM (in response to rgartley)
    Re: Zenoss Core Performance Tuning

    with admin, can you reach?

    http://XXX:8080/Control_Panel/Database/main/manage_workspace

     

    first thx OP and all other for all info very nice thread

     

    according to

    docs/DOC-7696

    $ZENHOME/bin/zeopack.py -p 8100

    ive just upgraded to 301 and this made me
    freak out a little but it seems the script has been moved to

    ./zenoss/python/lib/python2.6/site-packages/ZODB3-3.9.3-py2.6-linux-x86_64.egg/ZEO/scripts/

    zeopack.py

    zeopack.test

     

    it seems to been rewritten and maybe work different now ?

     

    tried it out from dir but got this

     

    zeopack -p 8100
    ZEO.zrpc WARNING (14988) CW: error connecting to ('zenoss.xxxxxx', 8100): ECONNREFUSED

    ZEO.zrpc WARNING (14988) CW: error connecting to ('zenoss.xxxxxx', 8100): ECONNREFUSED

    ZEO.zrpc WARNING (14988) CW: error connecting to ('zenoss.xxxxxx', 8100): ECONNREFUSED

     

    could still be packed from Control_Panel tho but would be nice to automate it

  • ebailey Rank: White Belt 24 posts since
    Jul 30, 2010
    Currently Being Moderated
    11. Aug 21, 2010 12:03 AM (in response to Gabe)
    Re: Zenoss Core Performance Tuning

    run zeopack with "-h localhost" ie

     

    zeopack -h localhost -p 8100

     

    This worked for me - no idea why the script changed.

     

    Ed

  • Ian McCracken ZenossEmployee 257 posts since
    Feb 26, 2007
    Currently Being Moderated
    12. Aug 27, 2010 1:39 PM (in response to ebailey)
    Re: Zenoss Core Performance Tuning

    There's another important thing to tune: the zeoclient cache-size.

     

    In zope.conf, you'll see two cache-size settings:

     

    <zodb_db main>

        ...

        cache-size 5000

        <zeoclient 1>

            ...

            cache-size 20MB

        </zeoclient>

    </zodb_db>

     

    The first is mentioned above. The second should be increased by a lot. If you've got the memory, go for it. I make mine 1024MB immediately after installation (which is overkill, admittedly).

     

    There's no real rule about how large your cache should be. If you can, make it (for example) double the size of your Data.fs; this would allow nearly everything in ZODB to live in the cache, and things will be very quick. Err on the side of too large (again, if you have the memory).

     

    Here's a document about this with more detailed information: http://wiki.zope.org/zope2/ZEOCache

  • ebailey Rank: White Belt 24 posts since
    Jul 30, 2010
    Currently Being Moderated
    13. Aug 27, 2010 3:20 PM (in response to Ian McCracken)
    Re: Zenoss Core Performance Tuning

    Ian,

     

    I made the change and the performance improvement has been really

    nice. The first time you hit the infra tab after the restart is pretty

    slow, but its pretty fast once you get past the restart. I also have

    been experimenting with assigning 2 processors to the runzope process

    (thanks for the tip Jeremy) and that has seemingly made the infra tab

    respond much faster. Your tip is a very good idea.

     

    Thanks

     

    Ed

  • fparacchini Rank: White Belt 11 posts since
    Jul 26, 2008
    Currently Being Moderated
    14. Sep 27, 2010 6:24 AM (in response to Ian McCracken)
    Re: Zenoss Core Performance Tuning

    I confirm that the cache size improved the performance.

     

    Can you also try the following suggestion ?

     

    thread/14504?tstart=0

     

    Ciao

    Fabio

1 2 Previous Next