<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zabbix Zone</title>
	<atom:link href="http://zabbixzone.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zabbixzone.com</link>
	<description>Free Knowledge for All</description>
	<lastBuildDate>Mon, 08 Oct 2012 11:58:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Backuping Full Database</title>
		<link>http://zabbixzone.com/zabbix/backuping-full-database/</link>
		<comments>http://zabbixzone.com/zabbix/backuping-full-database/#comments</comments>
		<pubDate>Fri, 21 Sep 2012 13:11:30 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[full]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[xtrabackup]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=302</guid>
		<description><![CDATA[Dump doesn&#8217;t work. If you have huge tables with billions of rows your backup process could become a nightmare, mainly if you need to restore it. This method aims to perform a full backup of a large MySQL database, as Zabbix (any version), focusing on a fast recovery from disaster. So I chose XtraBackup for [...]]]></description>
			<content:encoded><![CDATA[<p>Dump doesn&#8217;t work. If you have huge tables with billions of rows your backup process could become a nightmare, mainly if you need to restore it.</p>
<p>This method aims to perform a full backup of a large MySQL database, as Zabbix (any version), focusing on a fast recovery from disaster. So I chose <a href="http://www.percona.com/software/percona-xtrabackup" target="_blank">XtraBackup</a> for this task, a backup tool from <a href="http://www.percona.com" target="_blank">Percona</a>, which works using the hotcopy mode.</p>
<p>First, you need to download and install XtraBackup:<br />
<a href="http://www.percona.com/downloads/XtraBackup/LATEST/" target="_blank">http://www.percona.com/downloads/XtraBackup/LATEST/</a></p>
<p>XtraBackup offers a lot of parameters, so this script is intented to be the simplest possible.</p>
<p>Make sure that you&#8217;re using InnoDB for history tables at least. In my case, I have a Zabbix Database with 300GB data that takes about 3 hours to do all backup.</p>
<p>Create script <em>/var/lib/xtrabackup/mysql-fullbackup.sh</em>:</p>
<p><a href="https://github.com/xsbr/zabbixzone/blob/master/mysql-fullbackup.sh" target="_blank">https://github.com/xsbr/zabbixzone/blob/master/mysql-fullbackup.sh</a></p><pre class="crayon-plain-tag">#!/bin/bash
#
# mysql-fullbackup.sh
# v0.1 - 20120921
#
# Full Backup for Zabbix w/MySQL
#
# Author: Ricardo Santos (rsantos at gmail.com)
# http://zabbixzone.com
#
MYSQLUSER=&quot;YOURUSER&quot;
MYSQLPASS=&quot;YOURPASSWORD&quot;

MYSQLCNF=&quot;/etc/my.cnf&quot;
MYSQLDIR=&quot;/var/lib/mysql&quot;

BASEDIR=&quot;/var/lib/xtrabackup&quot;
BKPDIR=&quot;${BASEDIR}/lastbackup&quot;
BKPTEMPDIR=&quot;${BASEDIR}/tempbackup&quot;

# Memory used in stage 2
USEMEMORY=&quot;1GB&quot;

# create basedir
mkdir -p ${BASEDIR}

# remove temporary dir
if [ -d &quot;${BKPTEMPDIR}&quot; ]; then
        rm -rf ${BKPTEMPDIR}
fi

# do backup - stage 1
innobackupex --defaults-file=${MYSQLCNF} --user=${MYSQLUSER} --no-timestamp --password=${MYSQLPASS} ${BKPTEMPDIR}

# do backup - stage 2 (prepare backup for restore)
innobackupex --apply-log --use-memory=${USEMEMORY} ${BKPTEMPDIR}

# backup my.cnf
cp -pf ${MYSQLCNF} ${BKPTEMPDIR}/my.cnf

# keep only the lastbackup
if [ -d &quot;${BKPDIR}&quot; ]; then
      if [ -d &quot;${BKPDIR}.old&quot; ]; then
              rm -rf ${BKPDIR}.old
      fi
      rm -rf ${BKPDIR}
fi
chown -R mysql: ${BKPTEMPDIR}
mv ${BKPTEMPDIR} ${BKPDIR}</pre><p></p>
<p>Adjust the permissions:</p><pre class="crayon-plain-tag">chmod +x /var/lib/xtrabackup/mysql-fullbackup.sh</pre><p></p>
<p>Configure your crontab to backup every day at 04:15am:</p><pre class="crayon-plain-tag">15 04 * * * root /var/lib/xtrabackup/mysql-fullbackup.sh &gt;/var/lib/xtrabackup/lastrun.log 2&gt;&amp;1</pre><p></p>
<p>So if you need a restore, it&#8217;s very simple:</p><pre class="crayon-plain-tag"># stop MySQL
service mysql stop

# move backuped files
cd /var/lib
mv mysql mysqlcrashed
mv xtrabackup/lastbackup mysql

# start MySQL
service mysql start</pre><p></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/" rel="bookmark" class="crp_title">Backuping only the Zabbix Configuration</a></li><li><a href="http://zabbixzone.com/zabbix/partitioning-tables/" rel="bookmark" class="crp_title">Partitioning Tables</a></li><li><a href="http://zabbixzone.com/zabbix/mysql-performance-tips-for-zabbix/" rel="bookmark" class="crp_title">MySQL performance tips for Zabbix</a></li><li><a href="http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/" rel="bookmark" class="crp_title">Easy Update on Custom Scripts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/backuping-full-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One day in Zabbix HQ</title>
		<link>http://zabbixzone.com/zabbix/one-day-in-zabbix-hq/</link>
		<comments>http://zabbixzone.com/zabbix/one-day-in-zabbix-hq/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 09:25:43 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[social]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[latvia]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[riga]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=282</guid>
		<description><![CDATA[I had the opportunity to stay for one day inside Zabbix HQ (Riga, Latvia) before the Zabbix Conference 2012 and I would like to share some impressions. Zabbix Office is located in a large office building, only 15 minutes far from downtown Riga. http://goo.gl/maps/CoK4c According to Alexei, CEO of Zabbix SIA, the decision about the [...]]]></description>
			<content:encoded><![CDATA[<p>I had the opportunity to stay for one day inside Zabbix HQ (Riga, Latvia) before the Zabbix Conference 2012 and I would like to share some impressions.</p>
<p><a href="http://zabbixzone.com/wp-content/uploads/2012/09/227894_4252813474480_1076061127_n1.jpg"><img src="http://zabbixzone.com/wp-content/uploads/2012/09/227894_4252813474480_1076061127_n1-300x224.jpg" alt="" title="Zabbix Office in Riga, Latvia" width="300" height="224" class="aligncenter size-medium wp-image-295" /></a></p>
<p>Zabbix Office is located in a large office building, only 15 minutes far from downtown Riga. <a href="http://goo.gl/maps/CoK4c">http://goo.gl/maps/CoK4c</a></p>
<p>According to Alexei, CEO of Zabbix SIA, the decision about the place is to improve the quality of life of employees reducing transportation time.</p>
<p>The reception was very good, even though I am from a different culture (brazilian), they made ​​me feel me home, like I was part of that team.</p>
<p><a href="http://zabbixzone.com/wp-content/uploads/2012/09/403987_4252814914516_2063115628_n.jpg"><img src="http://zabbixzone.com/wp-content/uploads/2012/09/403987_4252814914516_2063115628_n-300x224.jpg" alt="" title="Kitchen in Zabbix Office" width="300" height="224" class="aligncenter size-medium wp-image-284" /></a></p>
<p>People work very focused on their work, although there are also moments of fun.</p>
<p><a href="http://zabbixzone.com/wp-content/uploads/2012/09/263998_4252815994543_1408203124_n.jpg"><img src="http://zabbixzone.com/wp-content/uploads/2012/09/263998_4252815994543_1408203124_n-300x224.jpg" alt="" title="Table Tennis in Zabbix Office" width="300" height="224" class="aligncenter size-medium wp-image-286" /></a></p>
<p>The table tennis and kitchen are very important features in the Zabbix environment, because it keeps people free from stress and makes working relationships stronger.</p>
<p>During the conversations they typically use the Latvian (language of Latvia), since most of the employees are from Latvia. But this characteristic can create in the future a natural barrier to the integration of individuals from other languages.</p>
<p>At some times of the year, employees are invited to travel with the goal of improving the integration between people. Take a look into this album from March 2012:</p>
<p><a href="http://www.flickr.com/photos/divizaki/sets/72157629617791751/" target="_blank">http://www.flickr.com/photos/divizaki/sets/72157629617791751/</a></p>
<p>In short, this is my point of view and I can see a family all working together in one purpose, without wasting time with hierarchies and bureaucracies.</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/zabbix-on-social-media/" rel="bookmark" class="crp_title">Zabbix on Social Media</a></li><li><a href="http://zabbixzone.com/zabbix/new-colors-on-frontend/" rel="bookmark" class="crp_title">New Colors on Frontend</a></li><li><a href="http://zabbixzone.com/zabbix/queue-explained/" rel="bookmark" class="crp_title">Queue Explained</a></li><li><a href="http://zabbixzone.com/zabbix/mysql-database-is-the-most-used-for-zabbix/" rel="bookmark" class="crp_title">MySQL database is the most used for Zabbix</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/one-day-in-zabbix-hq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZabbixZone Repository</title>
		<link>http://zabbixzone.com/zabbix/zabbixzone-repository/</link>
		<comments>http://zabbixzone.com/zabbix/zabbixzone-repository/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 12:11:07 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[installation]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix1.8]]></category>
		<category><![CDATA[zabbix2.0]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[el5]]></category>
		<category><![CDATA[el6]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[squeeze]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=260</guid>
		<description><![CDATA[I&#8217;d like to announce the ZabbixZone Repository, a Zabbix package repository, where the main goal is provide an easy way to install and keep Zabbix installations. Packages are available for CentOS 5, CentOS 6 and Debian 6 (Squeeze): http://repo.zabbixzone.com/ All packages were built by Kodai Terashima, an IT Engineer from Zabbix SIA, I take this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to announce the <a href="http://repo.zabbixzone.com" target="_blank"><strong>ZabbixZone Repository</strong></a>, a Zabbix package repository, where the main goal is provide an easy way to install and keep Zabbix installations.</p>
<p>Packages are available for <strong>CentOS 5</strong>, <strong>CentOS 6</strong> and <strong>Debian 6</strong> (Squeeze):</p>
<blockquote><p><a title="ZabbixZone Repository" href="http://repo.zabbixzone.com/" target="_blank">http://repo.zabbixzone.com/</a></p></blockquote>
<p>All packages were built by <a href="http://www.kodai74.net/" target="_blank">Kodai Terashima</a>, an IT Engineer from <a href="http://www.zabbix.com" target="_blank">Zabbix SIA</a>, I take this opportunity to thank you for the excellent work.</p>
<p>Feel free to ask any question.</p>
<p>Installing ZabbixZone Repository on <strong>CentOS</strong>:</p><pre class="crayon-plain-tag"># Importing GPG key
rpm --import http://repo.zabbixzone.com/centos/RPM-GPG-KEY-zabbixzone

# Install release package
rpm -Uv http://repo.zabbixzone.com/centos/zabbixzone-release-0.0-1.noarch.rpm</pre><p>Installing ZabbixZone Repository on <strong>Debian</strong>:</p><pre class="crayon-plain-tag"># Importing GPG key
wget -O - http://repo.zabbixzone.com/debian/zabbixzone.gpg.key | sudo apt-key add -

# Adding repository
echo 'deb http://repo.zabbixzone.com/debian squeeze main' &gt;&gt;/etc/apt/sources.list

# Update local cache
sudo apt-get update</pre><p>&nbsp;</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/zabbix-git-repositor/" rel="bookmark" class="crp_title">Zabbix Git Repository</a></li><li><a href="http://zabbixzone.com/zabbix/making-your-frontend-faster/" rel="bookmark" class="crp_title">Making your Frontend Faster</a></li><li><a href="http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/" rel="bookmark" class="crp_title">Easy Update on Custom Scripts</a></li><li><a href="http://zabbixzone.com/zabbix/backuping-full-database/" rel="bookmark" class="crp_title">Backuping Full Database</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/zabbixzone-repository/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zabbix 2.0 &#8211; Reloaded</title>
		<link>http://zabbixzone.com/zabbix/zabbix-2-0-reloaded/</link>
		<comments>http://zabbixzone.com/zabbix/zabbix-2-0-reloaded/#comments</comments>
		<pubDate>Tue, 22 May 2012 11:47:12 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix2.0]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=248</guid>
		<description><![CDATA[May 22nd 2012 will be forever in the Zabbix history like the moment when the project hit a higher point of maturity and stability. With this new version, came a new Release Policy making Zabbix more reliable for large environments. In Minor Versions, no new features, no changes in database structure, bug fixing only focus. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>May 22nd 2012</strong> will be forever in the Zabbix history like the moment when the project hit a higher point of <strong>maturity</strong> and <strong>stability</strong>.</p>
<p>With this new version, came a new <strong>Release Policy</strong> making Zabbix more reliable for large environments. In <strong>Minor Versions</strong>, no new features, no changes in database structure, bug fixing only focus. Planning for release a <strong>Major Version</strong> every <strong>9 months</strong>.</p>
<p>A great improvement in Development is the <strong>Zero Bug Policy</strong> which all bugs (stable, trunk) are treated with the highest priority. The goal is keep <strong>no open bugs</strong>.</p>
<p><span id="result_box" lang="en"><span class="hps">In this new era</span><span>, I wish</span> <span class="hps">Zabbix</span><span>:</span> <span class="hps atn">&#8220;</span><span>Live long and prosper</span><span>&#8220;</span></span></p>
<p><strong>Server Improvements</strong></p>
<ul>
<li>Performance improvements using cached data</li>
<li>Much faster processing of escalations</li>
<li>Database integrity</li>
<li>Support of SQLite3 for use on server-side</li>
<li>Not supported items are handled nicely by Proxies</li>
</ul>
<p><strong>Monitoring/Collection Improvements</strong></p>
<ul>
<li>Low level discovery</li>
<li>Multiple network interfaces</li>
<li>WEB monitoring by proxies</li>
<li>Automatic filling of DNS name for discovered devices</li>
<li>Added direct SNMP trap monitoring</li>
<li>Automatic collection of host profile data</li>
<li>Support of vm.memory.size</li>
<li>Enhanced auto-discovery</li>
<li>Remote commands (Agent, IPMI and SSH based) can be configured in a more flexible yet easier way</li>
<li>Remote JMX monitoring</li>
<li>Boolean data type can be used for monitoring of two state metrics and JMX counters having boolean type</li>
<li>Auto-registration with passive checks</li>
<li>Nanosecond resolution for historical data</li>
<li>Support of user scripts on Zabbix Agent and IPMI-based commands</li>
</ul>
<p><strong>Frontend Improvements</strong></p>
<ul>
<li>New set of default templates</li>
<li>Support of visible host and template name</li>
<li>Better translation framework for WEB interface</li>
<li>Host profiles were renamed to a more standard &#8220;host inventory&#8221;</li>
<li>Unified host profiles</li>
<li>Re-design of unknown events and triggers</li>
<li>Custom trigger severities</li>
<li>Templated host-level screens</li>
<li>Optional graph legends</li>
<li>New login screen</li>
<li>New design for all configuration forms</li>
<li>Export of events to CSV</li>
<li>Advanced filtering supported by Zabbix API</li>
<li>Support of disabling media types</li>
<li>More flexible dependencies from template to host</li>
<li>Added support for {IPADDRESS}, {HOST.DNS} and {HOST.CONN} macros in trigger names</li>
<li>Support of automatic selection of map icons</li>
<li>Optional expanding of macros in map editing</li>
<li>Added new option in map configuration which enables macros expanding</li>
<li>New set of map icons is available for creation of great looking maps</li>
<li>Multiple URLs for map elements</li>
<li>Advanced labels setting for maps</li>
<li>Remembering of map grid options</li>
<li>Host area functionality for maps</li>
<li>All host group elements can be displayed in a map area</li>
</ul>
<p>See the complete <a href="http://www.zabbix.com/rn2.0.0.php" target="_blank">Release Notes</a><br />
<strong></strong></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/about/" rel="bookmark" class="crp_title">About Me</a></li><li><a href="http://zabbixzone.com/zabbix/making-your-frontend-faster/" rel="bookmark" class="crp_title">Making your Frontend Faster</a></li><li><a href="http://zabbixzone.com/zabbix/history-and-trends/" rel="bookmark" class="crp_title">History and Trends</a></li><li><a href="http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/" rel="bookmark" class="crp_title">Backuping only the Zabbix Configuration</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/zabbix-2-0-reloaded/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL database is the most used for Zabbix</title>
		<link>http://zabbixzone.com/zabbix/mysql-database-is-the-most-used-for-zabbix/</link>
		<comments>http://zabbixzone.com/zabbix/mysql-database-is-the-most-used-for-zabbix/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 11:20:25 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=231</guid>
		<description><![CDATA[In March 2011, I create a poll in Zabbix Forum with this question: It received 92 votes and MySQL was the most voted with 71.74% followed by PostgreSQL with 21.74% Personally I found many problems with Oracle 11g when reach more than 1000 nvps (new values per second). My results with MySQL was very good [...]]]></description>
			<content:encoded><![CDATA[<p>In March 2011, I create a poll in <a href="http://www.zabbix.com/forum/showthread.php?t=21420" target="_blank">Zabbix Forum</a> with this question:</p>
<p><a href="http://www.zabbix.com/forum/showthread.php?t=21420" target="_blank"><img src="http://zabbixzone.com/wp-content/uploads/2012/02/zabbixdatabasepoll.png" alt="" title="Zabbix Databases" width="562" height="178" class="aligncenter size-full wp-image-234" /></a></p>
<p>It received 92 votes and <strong>MySQL</strong> was the most voted with <strong>71.74%</strong> followed by <strong>PostgreSQL</strong> <strong>with 21.74%</strong></p>
<p>Personally I found many problems with <strong>Oracle 11g</strong> when reach more than <strong>1000 nvps</strong> (new values per second).</p>
<p>My results with <strong>MySQL</strong> was very good reaching more than <strong>3500 nvps</strong>.</p>
<p>Unfortunately I still could not test <strong>PostgreSQL</strong>, but there are many positive posts in Forum.</p>
<p>And you, which database are you using?</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/new-colors-on-frontend/" rel="bookmark" class="crp_title">New Colors on Frontend</a></li><li><a href="http://zabbixzone.com/zabbix/zabbix-on-social-media/" rel="bookmark" class="crp_title">Zabbix on Social Media</a></li><li><a href="http://zabbixzone.com/zabbix/one-day-in-zabbix-hq/" rel="bookmark" class="crp_title">One day in Zabbix HQ</a></li><li><a href="http://zabbixzone.com/zabbix/queue-explained/" rel="bookmark" class="crp_title">Queue Explained</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/mysql-database-is-the-most-used-for-zabbix/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Zabbix on Social Media</title>
		<link>http://zabbixzone.com/zabbix/zabbix-on-social-media/</link>
		<comments>http://zabbixzone.com/zabbix/zabbix-on-social-media/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 02:01:08 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[social]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=220</guid>
		<description><![CDATA[I always dreamed of seeing the Zabbix spreading in all social networks, because it&#8217;s fundamental for an Open Source project. Is very difficult bring some serious TI guys to this social world, but this tools can be very powerful when wisely used. Finally Zabbix annunciated in February&#8217;s Newsletter the Zabbix page on Facebook: https://www.facebook.com/zabbix Over [...]]]></description>
			<content:encoded><![CDATA[<p>I always dreamed of seeing the Zabbix spreading in all social networks, because it&#8217;s fundamental for an Open Source project. Is very difficult bring some serious TI guys to this social world, but this tools can be very powerful when wisely used.</p>
<p>Finally Zabbix annunciated in <a href="http://www.zabbix.com/newsletters/2012/newsletter_february_15.html" target="_blank">February&#8217;s Newsletter</a> the <strong>Zabbix page on Facebook</strong>: <a href="https://www.facebook.com/zabbix" target="_blank">https://www.facebook.com/zabbix</a></p>
<p><a href="https://www.facebook.com/zabbix" target="_blank"><img src="http://zabbixzone.com/wp-content/uploads/2012/02/zabbixonfacebook.jpg" alt="" title="Zabbix page on Facebook" width="500" height="402" class="aligncenter size-full wp-image-221" /></a></p>
<p>Over <strong>1100 people follow</strong> the Zabbix on Twitter: <a href="https://twitter.com/zabbix" target="_blank">https://twitter.com/zabbix</a></p>
<p><a href="https://twitter.com/zabbix" target="_blank"><img src="http://zabbixzone.com/wp-content/uploads/2012/02/zabbixontwitter.jpg" alt="" title="Zabbix on Twitter" width="500" height="404" class="aligncenter size-full wp-image-225" /></a></p>
<p><strong>Linkedin</strong> also has an expressive <strong>Zabbix Group</strong> with <strong>643 members</strong>: <a href="http://linkedin.com/groups?gid=161448" target="_blank">http://linkedin.com/groups?gid=161448</a></p>
<p><a href="http://linkedin.com/groups?gid=161448" target="_blank"><img src="http://zabbixzone.com/wp-content/uploads/2012/02/zabbixonlinkedin.jpg" alt="" title="Zabbix on Linkedin" width="500" height="316" class="aligncenter size-full wp-image-223" /></a></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/one-day-in-zabbix-hq/" rel="bookmark" class="crp_title">One day in Zabbix HQ</a></li><li><a href="http://zabbixzone.com/about/" rel="bookmark" class="crp_title">About Me</a></li><li><a href="http://zabbixzone.com/zabbix/new-colors-on-frontend/" rel="bookmark" class="crp_title">New Colors on Frontend</a></li><li><a href="http://zabbixzone.com/zabbix/mysql-database-is-the-most-used-for-zabbix/" rel="bookmark" class="crp_title">MySQL database is the most used for Zabbix</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/zabbix-on-social-media/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL performance tips for Zabbix</title>
		<link>http://zabbixzone.com/zabbix/mysql-performance-tips-for-zabbix/</link>
		<comments>http://zabbixzone.com/zabbix/mysql-performance-tips-for-zabbix/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 20:24:14 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=121</guid>
		<description><![CDATA[Most of these tips is useful for many application, but I&#8217;ll keep focus on Zabbix. Use a Dedicated Server Database is the main bottleneck from Zabbix. Try to use a Dedicated Server for MySQL and make sure that server has great resources (CPU, memory and fast disks). This is the specs for an environment with [...]]]></description>
			<content:encoded><![CDATA[<p>Most of these tips is useful for many application, but I&#8217;ll keep focus on Zabbix.</p>
<ol>
<li><strong>Use a Dedicated Server</strong>
<p>Database is the main bottleneck from Zabbix. Try to use a Dedicated Server for MySQL and make sure that server has great resources (CPU, memory and fast disks).</p>
<p>This is the specs for an environment with <strong>3000 values per second</strong>:</p>
<p><strong>Dell PowerEdge R610</strong><br />
CPU: Intel Xeon L5520 2.27GHz (16 cores)<br />
Memory: 24GB RAM<br />
Disks: 6x SAS 10k with RAID10 by hardware
	</li>
<li><strong>Create one file per table</strong>
<p></p><pre class="crayon-plain-tag">innodb_file_per_table=1</pre><p></p>
<p>By default, InnoDB creates all tables inside an unique datafile. With this option the <strong>new tables</strong> will have your own datafile. So after the change, You&#8217;ll need recreate the tables.</p>
<p>It opens some possibilities like put your tables in different filesystems and makes backup with more consistency.</p>
<blockquote><p>
<strong>Peter Zaitsev</strong> &#8211; <a href="http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/" target="_blank">http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/</a><br />
innodb_file_per_table &#8211; If you do not have too many tables use this option, so you will not have uncontrolled innodb main tablespace growth which you can&#8217;t reclaim.</p></blockquote>
<blockquote><p>
<strong>Tristan &#8211; cPanel Staff</strong> &#8211; <a href="http://forums.cpanel.net/f43/innodb_file_per_table-converting-per-table-data-innodb-167942.html" target="_blank">http://forums.cpanel.net/f43/innodb_file_per_table-converting-per-table-data-innodb-167942.html</a><br />
<strong>Issue with shared InnoDB /var/lib/mysql/ibdata1 storage</strong><br />
InnoDB tables currently store data and indexes into a shared tablespace (/var/lib/mysql/ibdata1). Due to the shared tablespace, data corruption for one InnoDB table can result in MySQL failing to start up on the entire machine. Repairing InnoDB corruption can be extremely difficult to perform and can result in data loss for tables that were not corrupted originally during that repair process.</p></blockquote>
<p>Some discussions about this:<br />
<a href="http://dom.as/2009/05/21/innodb-tablespace/" target="_blank">http://dom.as/2009/05/21/innodb-tablespace/</a><br />
<a href="http://code.openark.org/blog/mysql/reasons-to-use-innodb_file_per_table" target="_blank">http://code.openark.org/blog/mysql/reasons-to-use-innodb_file_per_table</a></p>
<p>Personally I lost all my data because the ibdata file crashed (all data inside one file). </p>
<p>Ref.: <a target="_blank" href="http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html">http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html</a>
	</li>
<li><strong>Percona vs Community Edition</strong>
<p><a target="_blank" href="http://www.percona.com/software/percona-server/">Percona Server</a> is a modified version from <a href="http://www.mysql.com/products/community/">MySQL Community Edition</a>.</p>
<p>Some benchmarks show us about Percona performance advantages:<br />
<a target="_blank" href="http://www.percona.com/software/percona-server/benchmarks/">http://www.percona.com/software/percona-server/benchmarks/</a>
	</li>
<li><strong>Use partitioning tables and disable the Housekeeper</strong>
<p>Housekeeper reduces the MySQL performance (see <a href="http://zabbixzone.com/zabbix/history-tables-housekeeper/" title="History Tables – Housekeeper" target="_blank">History Tables – Housekeeper</a>). So a simple alternative is use the Partitioning native resource from MySQL.</p>
<p>In this blog there is another article about it: <a href="http://zabbixzone.com/zabbix/partitioning-tables/" title="Partitioning Tables" target="_blank">Partitioning Tables</a>
	</li>
<li><strong>Use tmpfs filesystem for Temporary Files</strong>
<p>Using memory instead of local disks will allow a much faster creation of temporary tables on MySQL.</p>
<p>First, create the mountpoint:</p><pre class="crayon-plain-tag">mkdir /tmp/mysqltmp</pre><p></p>
<p>Add this line in your <strong>/etc/fstab</strong>:</p><pre class="crayon-plain-tag">tmpfs /tmp/mysqltmp tmpfs rw,uid=mysql,gid=mysql,size=1G,nr_inodes=10k,mode=0700 0 0</pre><p></p>
<p>Make sure to adjust the <strong>size parameter</strong>. For reference, use 08~10% from physical memory.</p>
<p>Finally, you need to define this path in <strong>/etc/my.cnf</strong> and restart MySQL:</p><pre class="crayon-plain-tag">tmpdir = /tmp/mysqltmp</pre><p>
	</li>
<li><strong>Set your Buffer Pool properly</strong>
<p>This is one of most important parameters in <strong>/etc/my.cnf</strong>. It defines how much memory InnoDB can use.</p>
<p>I recommend something like 70~80% from physical memory:</p><pre class="crayon-plain-tag">innodb_buffer_pool_size=14G</pre><p></p>
<p>Ref.: <a href="http://www.mysqlperformanceblog.com/2007/11/03/choosing-innodb_buffer_pool_size/" target="_blank">http://www.mysqlperformanceblog.com/2007/11/03/choosing-innodb_buffer_pool_size/</a>
	</li>
</ol>
<p>It&#8217;s the <strong>/etc/my.cnf</strong> sample for a server with 24GB RAM:</p><pre class="crayon-plain-tag">[mysqld]
# paths
datadir                         = /var/lib/mysql/data
tmpdir                          = /tmp/mysqltmp

# network
connect_timeout                 = 60
wait_timeout                    = 28800
max_connections                 = 2048
max_allowed_packet              = 64M
max_connect_errors              = 1000

# limits
tmp_table_size                  = 512M
max_heap_table_size             = 256M
table_cache                     = 512

# logs
log_error                       = /var/log/mysql/mysql-error.log
slow_query_log_file             = /var/log/mysql/mysql-slow.log
slow_query_log                  = 1
long_query_time                 = 20

# innodb
innodb_data_home_dir            = /var/lib/mysql/data
innodb_data_file_path           = ibdata1:128M;ibdata2:128M:autoextend:max:4096M
innodb_file_per_table           = 1
innodb_status_file              = 1
innodb_additional_mem_pool_size = 128M
innodb_buffer_pool_size         = 14G
innodb_flush_method             = O_DIRECT
innodb_io_capacity              = 2000
innodb_flush_log_at_trx_commit  = 2
innodb_support_xa               = 0
innodb_log_file_size            = 512M
innodb_log_buffer_size          = 128M

# experimental
innodb_stats_update_need_lock   = 0

# other stuff
event_scheduler                 = 1
query_cache_type                = 0</pre><p></p>
<p>If you need, there are some references about MySQL parameters:<br />
<a href="http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html" target="_blank">http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html</a><br />
<a href="http://www.mysqlperformanceblog.com/" target="_blank">http://www.mysqlperformanceblog.com/</a></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/backuping-full-database/" rel="bookmark" class="crp_title">Backuping Full Database</a></li><li><a href="http://zabbixzone.com/zabbix/history-tables-housekeeper/" rel="bookmark" class="crp_title">History Tables &#8211; Housekeeper</a></li><li><a href="http://zabbixzone.com/zabbix/partitioning-tables/" rel="bookmark" class="crp_title">Partitioning Tables</a></li><li><a href="http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/" rel="bookmark" class="crp_title">Easy Update on Custom Scripts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/mysql-performance-tips-for-zabbix/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Backuping only the Zabbix Configuration</title>
		<link>http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/</link>
		<comments>http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/#comments</comments>
		<pubDate>Tue, 31 May 2011 02:38:31 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=126</guid>
		<description><![CDATA[This script is a simple way to backup all configuration tables (eg. templates, hostgroups, hosts, triggers&#8230;) without the history data. If you need do a full backup (history included) I recommend you this post: http://zabbixzone.com/zabbix/backuping-full-database/ As the result is very small (around 30 MB), is possible run this backup many times per day. https://github.com/xsbr/zabbixzone/blob/master/zabbix-mysql-backupconf.sh [crayon-508029bd23793/] [...]]]></description>
			<content:encoded><![CDATA[<p>This script is a simple way to backup all configuration tables (eg. templates, hostgroups, hosts, triggers&#8230;) without the history data.</p>
<p>If you need do a full backup (history included) I recommend you this post: <a href="http://zabbixzone.com/zabbix/backuping-full-database/">http://zabbixzone.com/zabbix/backuping-full-database/</a></p>
<p>As the result is very small (around 30 MB), is possible run this backup many times per day.</p>
<p><a title="Configuration Backup Script for Zabbix 1.8 with MySQL" href="http://pastebin.com/vkP3pW5X" target="_blank">https://github.com/xsbr/zabbixzone/blob/master/zabbix-mysql-backupconf.sh</a></p><pre class="crayon-plain-tag">#!/bin/bash
#
# zabbix-mysql-backupconf.sh
# v0.2 - 20111105
#
# Configuration Backup for Zabbix 1.8 w/MySQL
#
# Author: Ricardo Santos (rsantos at gmail.com)
# http://zabbixzone.com
#
# Thanks for suggestions from:
# - Oleksiy Zagorskyi (zalex)
# - Petr Jendrejovsky
#

# mysql config
DBHOST=&quot;localhost&quot;
DBNAME=&quot;zabbix&quot;
DBUSER=&quot;zabbix&quot;
DBPASS=&quot;YOURMYSQLPASSWORDHERE&quot;

# some tools
MYSQLDUMP=&quot;`which mysqldump`&quot;
GZIP=&quot;`which gzip`&quot;
DATEBIN=&quot;`which date`&quot;
MKDIRBIN=&quot;`which mkdir`&quot;

# target path
MAINDIR=&quot;/var/lib/zabbix/backupconf&quot;
DUMPDIR=&quot;${MAINDIR}/`${DATEBIN} +%Y%m%d%H%M`&quot;
${MKDIRBIN} -p ${DUMPDIR}

# configuration tables
CONFTABLES=( actions applications autoreg_host conditions config dchecks dhosts \
drules dservices escalations expressions functions globalmacro graph_theme \
graphs graphs_items groups help_items hostmacro hosts hosts_groups \
hosts_profiles hosts_profiles_ext hosts_templates housekeeper httpstep \
httpstepitem httptest httptestitem ids images items items_applications \
maintenances maintenances_groups maintenances_hosts maintenances_windows \
mappings media media_type node_cksum nodes opconditions operations \
opmediatypes profiles proxy_autoreg_host proxy_dhistory proxy_history regexps \
rights screens screens_items scripts service_alarms services services_links \
services_times sessions slides slideshows sysmaps sysmaps_elements \
sysmaps_link_triggers sysmaps_links timeperiods trigger_depends triggers \
user_history users users_groups usrgrp valuemaps )

# tables with large data
DATATABLES=( acknowledges alerts auditlog_details auditlog events \
history history_log history_str history_str_sync history_sync history_text \
history_uint history_uint_sync trends trends_uint )

# CONFTABLES
for table in ${CONFTABLES[*]}; do
        DUMPFILE=&quot;${DUMPDIR}/${table}.sql&quot;
        echo &quot;Backuping table ${table}&quot;
        ${MYSQLDUMP} -R --opt --extended-insert=FALSE \
                -h ${DBHOST} -u ${DBUSER} -p${DBPASS} ${DBNAME} --tables ${table} &gt;${DUMPFILE}
        ${GZIP} -f ${DUMPFILE}
done

# DATATABLES
for table in ${DATATABLES[*]}; do
        DUMPFILE=&quot;${DUMPDIR}/${table}.sql&quot;
        echo &quot;Backuping schema table ${table}&quot;
        ${MYSQLDUMP} -R --opt --no-data	\
                -h ${DBHOST} -u ${DBUSER} -p${DBPASS} ${DBNAME} --tables ${table} &gt;${DUMPFILE}
        ${GZIP} -f ${DUMPFILE}
done

echo
echo &quot;Backup Completed - ${DUMPDIR}&quot;</pre><p></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/backuping-full-database/" rel="bookmark" class="crp_title">Backuping Full Database</a></li><li><a href="http://zabbixzone.com/zabbix/partitioning-tables/" rel="bookmark" class="crp_title">Partitioning Tables</a></li><li><a href="http://zabbixzone.com/zabbix/history-and-trends/" rel="bookmark" class="crp_title">History and Trends</a></li><li><a href="http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/" rel="bookmark" class="crp_title">Easy Update on Custom Scripts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Partitioning Tables</title>
		<link>http://zabbixzone.com/zabbix/partitioning-tables/</link>
		<comments>http://zabbixzone.com/zabbix/partitioning-tables/#comments</comments>
		<pubDate>Wed, 18 May 2011 05:09:21 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=101</guid>
		<description><![CDATA[Many performance problems on Zabbix are related to the database and it became visible only when we have thousands of items. On another side, we have to handle enormous tables and it makes impossible operational routines like housekeeping and backup. Use all information and scripts at your own risk. Make backups! My suggestion is disable [...]]]></description>
			<content:encoded><![CDATA[<p>Many <strong>performance problems</strong> on Zabbix are <strong>related to the database</strong> and it became visible only when we have thousands of items. On another side, we have to handle <strong>enormous tables</strong> and it makes impossible operational routines like housekeeping and backup.</p>
<p><strong>Use all information and scripts at your own risk. Make backups!<br />
</strong></p>
<p>My suggestion is <a title="History Tables – Housekeeper" href="http://zabbixzone.com/zabbix/history-tables-housekeeper/" target="_blank">disable housekeeping</a> and to partition some tables based on <strong>clock</strong>, an <a href="http://en.wikipedia.org/wiki/Unix_time" target="_blank">unix timestamp</a> field. If you wanna know more about partitioning access the <a href="http://dev.mysql.com/doc/refman/5.5/en/partitioning-overview.html" target="_blank">MySQL Reference Manual &#8211; Partitioning Overview</a>.</p>
<p>&nbsp;</p>
<p><strong>The Concept</strong></p>
<p><a href="http://zabbixzone.com/wp-content/uploads/2011/05/partitioning.png"><img class="size-full wp-image-102 alignright" title="Partitioning Concept" src="http://zabbixzone.com/wp-content/uploads/2011/05/partitioning.png" alt="" width="247" height="257" /></a>An easy way to handle partitioning is splitting the tables into <strong>two groups</strong> based on <strong>their growth</strong>:</p>
<p><strong>Daily</strong> &#8211; basically the largest tables</p>
<ul>
<li>history</li>
<li>history_log</li>
<li>history_str</li>
<li>history_text</li>
<li>history_uint</li>
</ul>
<p>See more information about <a title="History and Trends" href="http://zabbixzone.com/zabbix/history-and-trends/">history tables</a>.</p>
<p><strong>Monthly</strong> &#8211; other huge tables</p>
<ul>
<li>acknowledges</li>
<li>alerts</li>
<li>auditlog</li>
<li>events</li>
<li>service_alarms</li>
<li>trends</li>
<li>trends_unit</li>
</ul>
<p>&nbsp;</p>
<p><strong>Step 1 &#8211; Preparing the Tables</strong></p>
<p>To partition a table using the <strong>clock</strong>, the field needs belong to the primary key or not have one. So we need make some key changes on this tables:</p><pre class="crayon-plain-tag">ALTER TABLE `acknowledges` DROP PRIMARY KEY, ADD KEY `acknowledgedid` (`acknowledgeid`);
ALTER TABLE `alerts` DROP PRIMARY KEY, ADD KEY `alertid` (`alertid`);
ALTER TABLE `auditlog` DROP PRIMARY KEY, ADD KEY `auditid` (`auditid`);
ALTER TABLE `events` DROP PRIMARY KEY, ADD KEY `eventid` (`eventid`);
ALTER TABLE `service_alarms` DROP PRIMARY KEY, ADD KEY `servicealarmid` (`servicealarmid`);
ALTER TABLE `history_log` DROP PRIMARY KEY, ADD PRIMARY KEY (`itemid`,`id`,`clock`);
ALTER TABLE `history_log` DROP KEY `history_log_2`;
ALTER TABLE `history_text` DROP PRIMARY KEY, ADD PRIMARY KEY (`itemid`,`id`,`clock`);
ALTER TABLE `history_text` DROP KEY `history_text_2`;</pre><p>&nbsp;</p>
<p><strong>Step 2 &#8211; Setup Monthly Partitions</strong></p>
<p>Repeat this step with each table (see above) with appropriate months.</p>
<p>In this example, we&#8217;ll create the monthly partitions to <strong>events table</strong> since <strong>May 2011</strong> until <strong>December 2011</strong>:</p><pre class="crayon-plain-tag">ALTER TABLE `events` PARTITION BY RANGE( clock ) (
PARTITION p201105 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-06-01 00:00:00&quot;)),
PARTITION p201106 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-07-01 00:00:00&quot;)),
PARTITION p201107 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-08-01 00:00:00&quot;)),
PARTITION p201108 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-09-01 00:00:00&quot;)),
PARTITION p201109 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-10-01 00:00:00&quot;)),
PARTITION p201110 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-11-01 00:00:00&quot;)),
PARTITION p201111 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-12-01 00:00:00&quot;)),
PARTITION p201112 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2012-01-01 00:00:00&quot;))
);</pre><p>&nbsp;</p>
<p><strong>Step 3 &#8211; Setup Daily Partitions</strong></p>
<p>Repeat this step with each table (see above) with appropriate days.</p>
<p>In this example, we&#8217;ll create the daily partitions to <strong>history_uint table</strong> since <strong>15th May </strong>until <strong>22th May</strong>:</p><pre class="crayon-plain-tag">ALTER TABLE `history_uint` PARTITION BY RANGE( clock ) (
PARTITION p20110515 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-16 00:00:00&quot;)),
PARTITION p20110516 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-17 00:00:00&quot;)),
PARTITION p20110517 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-18 00:00:00&quot;)),
PARTITION p20110518 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-19 00:00:00&quot;)),
PARTITION p20110519 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-20 00:00:00&quot;)),
PARTITION p20110520 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-21 00:00:00&quot;)),
PARTITION p20110521 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-22 00:00:00&quot;)),
PARTITION p20110522 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-23 00:00:00&quot;))
);</pre><p>&nbsp;</p>
<p><strong>Maintaining the Partitions Manually<br />
</strong></p>
<p>Adding new partitions:</p><pre class="crayon-plain-tag">ALTER TABLE `history_uint` ADD PARTITION (
PARTITION p20110523 VALUES LESS THAN (UNIX_TIMESTAMP(&quot;2011-05-24 00:00:00&quot;))
);</pre><p>Dropping partitions (Housekeeping):</p><pre class="crayon-plain-tag">ALTER TABLE `history_uint` DROP PARTITION p20110515;</pre><p>&nbsp;</p>
<p><strong>Step 4 &#8211; Auto </strong><strong>Daily </strong><strong>Partitioning<br />
</strong></p>
<p>Make sure that you created the partitioning correctly on the history tables (Step 3)</p>
<p>This script drops and creates automatically the daily partitioning.</p>
<p>The default is keep only last 3 days, if you wanna more days change @mindays variable.</p>
<p>Don&#8217;t forget to put it on cron:</p><pre class="crayon-plain-tag">mysql -B -h localhost -u zabbix -pPASSWORD zabbix -e &quot;CALL create_zabbix_partitions();&quot;</pre><p><strong> </strong><strong>Procedures</strong><a href="https://github.com/xsbr/zabbixzone/blob/master/zabbix-mysql-autopartitioning.sql" target="_blank"></p>
<p>https://github.com/xsbr/zabbixzone/blob/master/zabbix-mysql-autopartitioning.sql</a></p>
<p></p><pre class="crayon-plain-tag">/**************************************************************
  MySQL Auto Partitioning Procedure for Zabbix 1.8
  http://zabbixzone.com/zabbix/partitioning-tables/

  Author:  Ricardo Santos (rsantos at gmail.com)
  Version: 20110518
**************************************************************/
DELIMITER //
DROP PROCEDURE IF EXISTS `zabbix`.`create_zabbix_partitions` //
CREATE PROCEDURE `zabbix`.`create_zabbix_partitions` ()
BEGIN
	CALL zabbix.create_next_partitions(&quot;zabbix&quot;,&quot;history&quot;);
	CALL zabbix.create_next_partitions(&quot;zabbix&quot;,&quot;history_log&quot;);
	CALL zabbix.create_next_partitions(&quot;zabbix&quot;,&quot;history_str&quot;);
	CALL zabbix.create_next_partitions(&quot;zabbix&quot;,&quot;history_text&quot;);
	CALL zabbix.create_next_partitions(&quot;zabbix&quot;,&quot;history_uint&quot;);
	CALL zabbix.drop_old_partitions(&quot;zabbix&quot;,&quot;history&quot;);
	CALL zabbix.drop_old_partitions(&quot;zabbix&quot;,&quot;history_log&quot;);
	CALL zabbix.drop_old_partitions(&quot;zabbix&quot;,&quot;history_str&quot;);
	CALL zabbix.drop_old_partitions(&quot;zabbix&quot;,&quot;history_text&quot;);
	CALL zabbix.drop_old_partitions(&quot;zabbix&quot;,&quot;history_uint&quot;);
END //
DROP PROCEDURE IF EXISTS `zabbix`.`create_next_partitions` //
CREATE PROCEDURE `zabbix`.`create_next_partitions` (SCHEMANAME varchar(64), TABLENAME varchar(64))
BEGIN
	DECLARE NEXTCLOCK timestamp;
	DECLARE PARTITIONNAME varchar(16);
	DECLARE CLOCK int;
	SET @totaldays = 7;
	SET @i = 1;
	createloop: LOOP
		SET NEXTCLOCK = DATE_ADD(NOW(),INTERVAL @i DAY);
		SET PARTITIONNAME = DATE_FORMAT( NEXTCLOCK, 'p%Y%m%d' );
		SET CLOCK = UNIX_TIMESTAMP(DATE_FORMAT(DATE_ADD( NEXTCLOCK ,INTERVAL 1 DAY),'%Y-%m-%d 00:00:00'));
		CALL zabbix.create_partition( SCHEMANAME, TABLENAME, PARTITIONNAME, CLOCK );
		SET @i=@i+1;
		IF @i &gt; @totaldays THEN
			LEAVE createloop;
		END IF;
	END LOOP;
END //
DROP PROCEDURE IF EXISTS `zabbix`.`drop_old_partitions` //
CREATE PROCEDURE `zabbix`.`drop_old_partitions` (SCHEMANAME varchar(64), TABLENAME varchar(64))
BEGIN
	DECLARE OLDCLOCK timestamp;
	DECLARE PARTITIONNAME varchar(16);
	DECLARE CLOCK int;
	SET @mindays = 3;
	SET @maxdays = @mindays+4;
	SET @i = @maxdays;
	droploop: LOOP
		SET OLDCLOCK = DATE_SUB(NOW(),INTERVAL @i DAY);
		SET PARTITIONNAME = DATE_FORMAT( OLDCLOCK, 'p%Y%m%d' );
		CALL zabbix.drop_partition( SCHEMANAME, TABLENAME, PARTITIONNAME );
		SET @i=@i-1;
		IF @i &lt;= @mindays THEN
			LEAVE droploop;
		END IF;
	END LOOP;
END //
DROP PROCEDURE IF EXISTS `zabbix`.`create_partition` //
CREATE PROCEDURE `zabbix`.`create_partition` (SCHEMANAME varchar(64), TABLENAME varchar(64), PARTITIONNAME varchar(64), CLOCK int)
BEGIN
	DECLARE RETROWS int;
	SELECT COUNT(1) INTO RETROWS
		FROM `information_schema`.`partitions`
		WHERE `table_schema` = SCHEMANAME AND `table_name` = TABLENAME AND `partition_name` = PARTITIONNAME;
	
	IF RETROWS = 0 THEN
		SELECT CONCAT( &quot;create_partition(&quot;, SCHEMANAME, &quot;,&quot;, TABLENAME, &quot;,&quot;, PARTITIONNAME, &quot;,&quot;, CLOCK, &quot;)&quot; ) AS msg;
     		SET @sql = CONCAT( 'ALTER TABLE `', SCHEMANAME, '`.`', TABLENAME, '`',
				' ADD PARTITION (PARTITION ', PARTITIONNAME, ' VALUES LESS THAN (', CLOCK, '));' );
		PREPARE STMT FROM @sql;
		EXECUTE STMT;
		DEALLOCATE PREPARE STMT;
	END IF;
END //
DROP PROCEDURE IF EXISTS `zabbix`.`drop_partition` //
CREATE PROCEDURE `zabbix`.`drop_partition` (SCHEMANAME varchar(64), TABLENAME varchar(64), PARTITIONNAME varchar(64))
BEGIN
	DECLARE RETROWS int;
	SELECT COUNT(1) INTO RETROWS
		FROM `information_schema`.`partitions`
		WHERE `table_schema` = SCHEMANAME AND `table_name` = TABLENAME AND `partition_name` = PARTITIONNAME;
	
	IF RETROWS = 1 THEN
		SELECT CONCAT( &quot;drop_partition(&quot;, SCHEMANAME, &quot;,&quot;, TABLENAME, &quot;,&quot;, PARTITIONNAME, &quot;)&quot; ) AS msg;
     		SET @sql = CONCAT( 'ALTER TABLE `', SCHEMANAME, '`.`', TABLENAME, '`',
				' DROP PARTITION ', PARTITIONNAME, ';' );
		PREPARE STMT FROM @sql;
		EXECUTE STMT;
		DEALLOCATE PREPARE STMT;
	END IF;
END //
DELIMITER ;</pre><p></p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/history-tables-housekeeper/" rel="bookmark" class="crp_title">History Tables &#8211; Housekeeper</a></li><li><a href="http://zabbixzone.com/zabbix/backuping-full-database/" rel="bookmark" class="crp_title">Backuping Full Database</a></li><li><a href="http://zabbixzone.com/zabbix/history-and-trends/" rel="bookmark" class="crp_title">History and Trends</a></li><li><a href="http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/" rel="bookmark" class="crp_title">Backuping only the Zabbix Configuration</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/partitioning-tables/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>History Tables &#8211; Housekeeper</title>
		<link>http://zabbixzone.com/zabbix/history-tables-housekeeper/</link>
		<comments>http://zabbixzone.com/zabbix/history-tables-housekeeper/#comments</comments>
		<pubDate>Fri, 13 May 2011 01:08:54 +0000</pubDate>
		<dc:creator>Ricardo Santos</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://zabbixzone.com/?p=90</guid>
		<description><![CDATA[First, I recommend to you read about the differences between the history and trends table. Each item on Zabbix can have your own housekeeper value. But this feature turns housekeeping process a performance killer, because delete_history() function executes a DELETE per item every turn. If you have 100k items, 100k DELETE queries will be executed. [...]]]></description>
			<content:encoded><![CDATA[<p>First, I recommend to you read about the <a title="History and Trends" href="http://zabbixzone.com/zabbix/history-and-trends/">differences between the history and trends table</a>.</p>
<p>Each item on Zabbix can have your own housekeeper value. But this feature turns housekeeping process a performance killer, because <a href="http://git.zabbixzone.com/zabbix1.8/.git/blob/HEAD:/src/zabbix_server/housekeeper/housekeeper.c#l261" target="_blank">delete_history() function</a> executes a DELETE per item every turn. If you have 100k items, 100k DELETE queries will be executed.</p>
<p>This can be a big problem using InnoDB engine on MySQL, because <a href="http://www.linkedin.com/answers/technology/information-technology/databases/TCH_ITS_DBS/563096-12145587?browseCategory=TCH_ITS" target="_blank">DELETE is extremelly slow on large tables</a> and <a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-file-space.html" target="_blank">deleted rows doesn&#8217;t release space</a> on disk.</p>
<p>My proposed and tested solution is <strong>disable housekeeping</strong> and partitioning some tables.</p>
<p>To know more about it. read my post <a title="Partitioning Tables" href="http://zabbixzone.com/zabbix/partitioning-tables/">Partitioning Tables</a>.</p>
<div class="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://zabbixzone.com/zabbix/history-and-trends/" rel="bookmark" class="crp_title">History and Trends</a></li><li><a href="http://zabbixzone.com/zabbix/mysql-performance-tips-for-zabbix/" rel="bookmark" class="crp_title">MySQL performance tips for Zabbix</a></li><li><a href="http://zabbixzone.com/zabbix/partitioning-tables/" rel="bookmark" class="crp_title">Partitioning Tables</a></li><li><a href="http://zabbixzone.com/zabbix/zabbix-git-repositor/" rel="bookmark" class="crp_title">Zabbix Git Repository</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://zabbixzone.com/zabbix/history-tables-housekeeper/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 10/64 queries in 0.925 seconds using disk: basic
Object Caching 2019/2235 objects using disk: basic

Served from: zabbixzone.com @ 2012-10-18 13:09:35 -->