<?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>PlanetMysql.ru - информация о СУБД MySQL &#187; restart</title>
	<atom:link href="http://planetmysql.ru/category/restart/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Fri, 10 Feb 2012 22:53:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Adding pre/post hooks into MySQL init scripts</title>
		<link>http://blog.wl0.org/2011/09/adding-prepost-hooks-into-mysql-init-scripts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-prepost-hooks-into-mysql-init-scripts</link>
		<comments>http://blog.wl0.org/2011/09/adding-prepost-hooks-into-mysql-init-scripts/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 08:40:19 +0000</pubDate>
		<dc:creator>Simon Mudd</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[init scripts]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL Administration]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[start]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[tasks]]></category>

		<guid isPermaLink="false">http://blog.wl0.org/?p=483</guid>
		<description><![CDATA[On several occasions it may be necessary to do some tasks around the process of starting or stopping a MySQL server such as:

Perform a warmup of the database using custom scripts and external information that the init_file configuration may not have access to.
Change configuration settings such as innodb_log_file_size and adjust the on disk files that this needs
Change configuration settings such as log_bin (I try to use a relative paths to ensure that different instances use a common setting even if datadir is different, and changing from an absolute to relative path often requires adjusting the binlog index file)
Shutting down MySQL may need to be delayed if the SQL thread has open temporary tables or open transactions are still being processed
etc&#8230;

You may have others and many of these are likely to be site specific. I could ask Oracle to add lots of configuration options to cover many of these special cases but that is likely to not work as my needs may not match others. However asking them to add hooks to allow me to put in the infrastructure that I need, especially if those hooks are normally disabled and require minimal changes to the current init scripts, might be acceptable. That&#8217;s why I&#8217;m curious as to what others think about this.
Some may be asking: why do you need this at all? I have certainly seen several issues such as those indicated above which I need to resolve. Also the DBA is not the only person who may have to restart a server. Sometimes this may be done by a system administrator, and on some servers a by developer. These people are not necessarily expected to know about the specifics of one MySQL server compared to another or to know the server&#8217;s current state. It is also true that often a server may go for a long time without needing to be restarted, so many configuration changes may be pending. They only need to be done when the server is restarted.
So I was considering the idea of some hooks which would work in a similar way to a system init script, probably composed of the following parts:

An /etc/mysql/init.d directory containing any scripts that might need to be run. they can be placed there manually or by system configuration tools
An /etc/mysql/rc-start and /etc/mysql/rc-stop directory which would have files named: PRE-nn-scriptname, and POST-nn-scriptname linked to the ../init.d/scriptname file. Again similar to the system init scripts. the nn would like the init script define the relative ordering of the execution of any scripts in that directory
A modification to /etc/init.d/mysql so that these scripts would be run (if present) at 4 stages:

pre-start: before starting mysqld
post-start: after starting mysqld
pre-stop: before stopping msyqld
post-stop: after stopping mysqld


Not absolutely necessary but for completeness a tool which would manage the linking / unlinking of these files

I can certainly see the use of something like this for my work, but do not see that someone like Oracle will take this unless they see a clear business sense to that, or technical advantage. If you have a single mysqld to manage this may seem like overkill. That&#8217;s fine: by default it would not be used. However, as MySQL is gradually being used in larger sites I believe this sort of functionality could be quite helpful.
Have you solved the problem already? If so how? If not does this seem like a reasonable idea?]]></description>
			<content:encoded><![CDATA[<p>On several occasions it may be necessary to do some tasks around the process of starting or stopping a MySQL server such as:</p>
<ul>
<li>Perform a warmup of the database using custom scripts and external information that the <code>init_file</code> configuration may not have access to.</li>
<li>Change configuration settings such as <code>innodb_log_file_size</code> and adjust the on disk files that this needs</li>
<li>Change configuration settings such as <code>log_bin</code> (I try to use a relative paths to ensure that different instances use a common setting even if <code>datadir</code> is different, and changing from an absolute to relative path often requires adjusting the binlog index file)</li>
<li>Shutting down MySQL may need to be delayed if the SQL thread has open temporary tables or open transactions are still being processed</li>
<li>etc&#8230;</li>
</ul>
<p>You may have others and many of these are likely to be site specific. I could ask Oracle to add lots of configuration options to cover many of these special cases but that is likely to not work as my needs may not match others. However asking them to add hooks to allow me to put in the infrastructure that I need, especially if those hooks are normally disabled and require minimal changes to the current init scripts, might be acceptable. That&#8217;s why I&#8217;m curious as to what others think about this.</p>
<p>Some may be asking: <em>why do you need this at all?</em> I have certainly seen several issues such as those indicated above which I need to resolve. Also the DBA is not the only person who may have to restart a server. Sometimes this may be done by a system administrator, and on some servers a by developer. These people are not necessarily expected to know about the specifics of one MySQL server compared to another or to know the server&#8217;s current <em>state</em>. It is also true that often a server may go for a long time without needing to be restarted, so many configuration changes may be pending. They only need to be done when the server is restarted.</p>
<p>So I was considering the idea of some hooks which would work in a similar way to a system init script, probably composed of the following parts:</p>
<ul>
<li>An /etc/mysql/init.d directory containing any scripts that might need to be run. they can be placed there manually or by system configuration tools</li>
<li>An /etc/mysql/rc-start and /etc/mysql/rc-stop directory which would have files named: PRE-nn-scriptname, and POST-nn-scriptname linked to the ../init.d/scriptname file. Again similar to the system init scripts. the nn would like the init script define the relative ordering of the execution of any scripts in that directory</li>
<li>A modification to /etc/init.d/mysql so that these scripts would be run (if present) at 4 stages:
<ul>
<li>pre-start: before starting mysqld</li>
<li>post-start: after starting mysqld</li>
<li>pre-stop: before stopping msyqld</li>
<li>post-stop: after stopping mysqld</li>
</ul>
</li>
<li>Not absolutely necessary but for completeness a tool which would manage the linking / unlinking of these files</li>
</ul>
<p>I can certainly see the use of something like this for my work, but do not see that someone like Oracle will take this unless they see a clear business sense to that, or technical advantage. If you have a single mysqld to manage this may seem like overkill. That&#8217;s fine: by default it would not be used. However, as MySQL is gradually being used in larger sites I believe this sort of functionality could be quite helpful.</p>
<p>Have you solved the problem already? If so how? If not does this seem like a reasonable idea?</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=30085&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=30085&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2011/09/24/adding-prepost-hooks-into-mysql-init-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Cluster Data Node restart times</title>
		<link>http://www.clusterdb.com/mysql-cluster/mysql-cluster-data-node-restart-times/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-cluster-data-node-restart-times</link>
		<comments>http://www.clusterdb.com/mysql-cluster/mysql-cluster-data-node-restart-times/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 12:46:00 +0000</pubDate>
		<dc:creator>Andrew Morgan</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Cluster 7.0]]></category>
		<category><![CDATA[Cluster Database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[MySQL Cluster 7.0]]></category>
		<category><![CDATA[MySQL Cluster CGE]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[restart]]></category>

		<guid isPermaLink="false">http://www.clusterdb.com/?p=365</guid>
		<description><![CDATA[Restarts are required for certain, infrequent maintenance activities. Note that there is no loss of service while a single node restarts.
When a data node restarts, it first attempts to load the data into memory from the local log files and then it will catch up with any subsequent changes by retrieveing them from the surviving node(s) in its node group.
 Based on this, you would expect the time taken to restart a data node to be influenced by:

The amount of data that was stored on the data node before the restart
Rate of updates being made to the data during the restart
Network performance (assuming the data is being updated during recovery)

The times will also be influenced bycertain configuration parameters, performance of the host machine and whether the multi-threaded data node (ndbmtd) is being used.
To provide some insight into how these factors impact restart times, tests have been performed where the following factors are varied:

Database size (Each Gbyte is made up of 1,000,000 tuples in each of 5 tables)
Whether traffic is running or not (a single thread using the NDB API to send in up to 2K tps (10K updates/second))
Whether the 2 data nodes in the node group are on the same host or separated by a Gbit Ethernet network

The following factors are kept constant:

Physical hosts: Intel Core 2 Quad Q8200@2.33 GHz; 7.7 GBytes RAM
NoOfFragmentLogFiles: 300
MaxNoOfExecutionThreads=4

Here are the observed results:
Data Node restart times
There are a couple of things to note from these results:

Using the multi-threaded data node (ndbmtd) greatly improves the restart time (in this case, 4 threads were available, improvements could be even greater on an 8 core/thread system)
Results become less predictable when heavy update traffic is being processed (in this case, up to 10,000 updated rows/second on a single node group). In the tests, no attempt was made to regulate this traffic and the test application was run on the same host as the one of the data nodes. Changes to the rate of updates will vary how long it takes for the restarting node to catch-up as it&#8217;s a moving target.

There is another recovery/restart scenario. The measurements shown above assumed that the file system on the data node&#8217;s host was intact and could be used to recover the in-memory copy &#8211; if that were not the case (or the data nodes were restarted with the &#8220;initial&#8221; option) then all of the data would have to be recovered from the surviving data node(s) in the same node group. As a comparison restarting a 6 Gbyte data node with the &#8220;initial&#8221; option took 20 minutes compared to 8 minutes without it (ndbmtd, over Gbit n/w).]]></description>
			<content:encoded><![CDATA[<p>Restarts are required for certain, infrequent maintenance activities. Note that there is no loss of service while a single node restarts.</p>
<p>When a data node restarts, it first attempts to load the data into memory from the local log files and then it will catch up with any subsequent changes by retrieveing them from the surviving node(s) in its node group.</p>
<p> Based on this, you would expect the time taken to restart a data node to be influenced by:</p>
<ol>
<li>The amount of data that was stored on the data node before the restart</li>
<li>Rate of updates being made to the data during the restart</li>
<li>Network performance (assuming the data is being updated during recovery)</li>
</ol>
<p>The times will also be influenced bycertain configuration parameters, performance of the host machine and whether the multi-threaded data node (ndbmtd) is being used.</p>
<p>To provide some insight into how these factors impact restart times, tests have been performed where the following factors are varied:</p>
<ul>
<li>Database size (Each Gbyte is made up of 1,000,000 tuples in each of 5 tables)</li>
<li>Whether traffic is running or not (a single thread using the NDB API to send in up to 2K tps (10K updates/second))</li>
<li>Whether the 2 data nodes in the node group are on the same host or separated by a Gbit Ethernet network</li>
</ul>
<p>The following factors are kept constant:</p>
<ul>
<li>Physical hosts: Intel Core 2 Quad Q8200@2.33 GHz; 7.7 GBytes RAM</li>
<li>NoOfFragmentLogFiles: 300</li>
<li>MaxNoOfExecutionThreads=4</li>
</ul>
<p>Here are the observed results:</p>
<div><a href="http://www.clusterdb.com/wp-content/uploads/2009/07/restart_times.jpg"><img class="size-full wp-image-369" title="Data Node restart times" src="http://www.clusterdb.com/wp-content/uploads/2009/07/restart_times.jpg" alt="Data Node restart times" width="587" height="168" /></a><p>Data Node restart times</p></div>
<p>There are a couple of things to note from these results:</p>
<ul>
<li>Using the multi-threaded data node (ndbmtd) greatly improves the restart time (in this case, 4 threads were available, improvements could be even greater on an 8 core/thread system)</li>
<li>Results become less predictable when heavy update traffic is being processed (in this case, up to 10,000 updated rows/second on a single node group). In the tests, no attempt was made to regulate this traffic and the test application was run on the same host as the one of the data nodes. Changes to the rate of updates will vary how long it takes for the restarting node to catch-up as it&#8217;s a moving target.</li>
</ul>
<p>There is another recovery/restart scenario. The measurements shown above assumed that the file system on the data node&#8217;s host was intact and could be used to recover the in-memory copy &#8211; if that were not the case (or the data nodes were restarted with the &#8220;initial&#8221; option) then all of the data would have to be recovered from the surviving data node(s) in the same node group. As a comparison restarting a 6 Gbyte data node with the &#8220;initial&#8221; option took 20 minutes compared to 8 minutes without it (ndbmtd, over Gbit n/w).</p>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2009/07/30/mysql-cluster-data-node-restart-times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

