<?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>Server Archives : vedmant.com : coding blog</title>
	<atom:link href="https://vedmant.com/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>https://vedmant.com/tag/server/</link>
	<description>Sharing my personal experience in web development</description>
	<lastBuildDate>Sat, 18 Jun 2016 21:46:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>
	<item>
		<title>MySql (MariaDB) crashes on small RAM VPS, what to do</title>
		<link>https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/</link>
					<comments>https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/#comments</comments>
		
		<dc:creator><![CDATA[vedmant]]></dc:creator>
		<pubDate>Sat, 18 Jun 2016 21:34:25 +0000</pubDate>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Server]]></category>
		<guid isPermaLink="false">https://vedmant.com/?p=113</guid>

					<description><![CDATA[<p>Recently I encountered one weird problem, my MariaDB database started to crash from time to time on one of my small RAM (512mb) virtual private servers. After some short googling I found out what what is potential problem with MariaDB on small RAM machines and how to fix it. First of all, if you have this &#8230; <a href="https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/" class="more-link">Continue reading <span class="screen-reader-text">MySql (MariaDB) crashes on small RAM VPS, what to do</span></a></p>
<p>The post <a href="https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/">MySql (MariaDB) crashes on small RAM VPS, what to do</a> appeared first on <a href="https://vedmant.com">vedmant.com :: coding blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I encountered one weird problem, my MariaDB database started to crash from time to time on one of my small RAM (512mb) virtual private servers. After some short googling I found out what what is potential problem with MariaDB on small RAM machines and how to fix it.</p>
<p>First of all, if you have this kind of problem, check MariaDB logs </p>
<pre class="brush: bash; title: ; notranslate">
tail -n 100 /var/log/mariadb/mariadb.log
</pre>
<p>you may find something like this:</p>
<pre class="brush: plain; title: ; notranslate">
160608 12:08:05 InnoDB: Completed initialization of buffer pool
160608 12:08:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160608 12:08:05 &#x5B;ERROR] Plugin 'InnoDB' init function returned error.
160608 12:08:05 &#x5B;ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160608 12:08:05 &#x5B;ERROR] mysqld: Out of memory (Needed 128917504 bytes)
</pre>
<p>After some research I figured out that mysql require a lot resources for performance schema, and disabling it will help on small memory machines. <a href="https://mariadb.com/blog/starting-mysql-low-memory-virtual-machines">source</a></p>
<pre class="brush: bash; title: ; notranslate">
sudo vim /etc/my.cnf
</pre>
<p>add</p>
<pre class="brush: bash; title: ; notranslate">
performance_schema = off
</pre>
<p>to section</p>
<pre class="brush: plain; title: ; notranslate">
&#x5B;mysqld]
</pre>
<p>To ensure that database server will restart on crash, on OS with Systemd like CentOS 7 you need to do following</p>
<p>Open following file for edit</p>
<pre class="brush: bash; title: ; notranslate">
sudo vim /etc/systemd/system/mariadb.service
</pre>
<p>and add following lines</p>
<pre class="brush: plain; title: ; notranslate">
.include /lib/systemd/system/mariadb.service

&#x5B;Service]
Restart=always
RestartSec=3
</pre>
<p>Then you need to restart reload Systemd configuration</p>
<pre class="brush: bash; title: ; notranslate">
sudo systemctl daemon-reload
</pre>
<p>and restart MariaDB service</p>
<pre class="brush: bash; title: ; notranslate">
systemctl restart mariadb
</pre>
<p>To ensure that Systemd restarts service you can do following:</p>
<pre class="brush: bash; title: ; notranslate">
ps -ef|grep maria
</pre>
<p>You will see something like this</p>
<pre class="brush: bash; title: ; notranslate">
mysql    26647 26368  0 Jun12 ?        00:06:22 /usr/libexec/mysqld ....
</pre>
<p>Try to kill the process using</p>
<pre class="brush: bash; title: ; notranslate">
kill 26647
</pre>
<p>Wait 3 seconds and check if MariaDB started again</p>
<pre class="brush: bash; title: ; notranslate">
ps -ef|grep maria
</pre>
<p>The post <a href="https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/">MySql (MariaDB) crashes on small RAM VPS, what to do</a> appeared first on <a href="https://vedmant.com">vedmant.com :: coding blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vedmant.com/mysql-mariadb-crashes-small-ram-vps/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
