Difference between revisions of "Optimizing Memory Usage"
Latest revision as of 15:13, 17 July 2015
Zenoss 4 uses several new technologies including RabbitMQ and some Java-based applications, which can consume quite a bit of memory. The minimum recommended amount of RAM for a Zenoss 4.x install is 8GB.
This section will document some steps you can use to make Zenoss more memory-efficient for deployments with relatively low numbers of managed devices, where extreme scalability is not a concern.
Zenoss Core 4 uses MySQL.
The commercial version of Zenoss uses zends. Zends is a commercially-licensed version of MySQL that is included with Zenoss Service Dynamics. By default, it is tuned to handle up to 2000 devices. For smaller installations, the pool and cache sizes may be a bit high.
To change settings for MySQL, edit /opt/zenoss/etc/my.cnf (or /opt/zends/etc/zends.conf if you are using the commercial version.) Change innodb_buffer_pool_size to a smaller value, such as 256M. You can also lower the other sizes accordingly. Suggested minimal configuration:
[mysqld] skip_external_locking max_allowed_packet = 64M innodb_buffer_pool_size = 256M # log file size should be 25% of of buffer pool size innodb_log_file_size = 64M innodb_additional_mem_pool_size = 16M innodb_log_buffer_size = 4M innodb_fast_shutdown = 1 innodb_flush_log_at_trx_commit = 2 [mysqldump] quick max_allowed_packet = 64M
You will need to edit this file as root. After making changes, perform the following steps:
# /etc/init.d/mysql restart
For the commercial version, you will want to use the zends initscript:
# /etc/init.d/zends stop # rm /etc/zends/data/ib_logfile* # /etc/init.d/zends start
zeneventserver is a new Java-based event server for Zenoss. By default, it will allow the Java heap to grow to 1/4 of the available system memory with a 64-bit JVM. This can be modified by editing the /home/zenoss/.bashrc file to add a -Xmx512m option to the default JVM arguments, as follows:
$ export DEFAULT_ZEP_JVM_ARGS="-server -Xmx512m"
Type zeneventserver restart as the zenoss user to apply these new settings.
Zenoss uses ZenPacks to extend functionality of the core product, and also includes some additional daemons that you may not need. To turn extra daemons off, perform the following steps:
$ touch /opt/zenoss/etc/DAEMONS_TXT_ONLY
Then create a file called /opt/zenoss/etc/daemons.txt that contains something like this:
zeneventserver zeneventd zopectl zenhub zenjobs zenping zensyslog zenstatus zenactiond zentrap zenmodeler zenperfsnmp zencommand zenprocess zenrrdcached #zenwin #zeneventlog #zenjmx #zenwinperf
The list above is a list of all daemons that start when you run zenoss restart as the zenoss user. I've commented out the ones I don't want by appending a #.