<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Transition Technology: Ticket #591: Move MySQL temporary directory to tmpfs</title>
    <link>http://localhost:8080/trac/ticket/591</link>
    <description>&lt;p&gt;
Chris, please read: &lt;a class="ext-link" href="http://2bits.com/articles/reduce-your-servers-resource-usage-moving-mysql-temporary-directory-ram-disk.html"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://2bits.com/articles/reduce-your-servers-resource-usage-moving-mysql-temporary-directory-ram-disk.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I think we could easily drop a little MySQL memory to give it some in-memory disk space to do the temporary table munching Drupal is causing it. I see there are already some mounted tmpfs partitions.
&lt;/p&gt;
&lt;p&gt;
Related to &lt;a class="assigned ticket" href="http://localhost:8080/trac/ticket/590" title="defect: Drupal performance improvements (assigned)"&gt;#590&lt;/a&gt; (proposal L: Review slow query log, explain queries, tweak as necessary/flag poorly behaving modules)
&lt;/p&gt;
&lt;p&gt;
What do you think? Worth doing?
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>Transition Technology</title>
      <url>/trac/chrome/site/TransitionNetwork-Logo-Web-Small.jpg</url>
      <link>http://localhost:8080/trac/ticket/591</link>
    </image>
    <generator>Trac 0.12.5</generator>
    <item>
      
        <dc:creator>ed</dc:creator>

      <pubDate>Wed, 11 Sep 2013 10:15:43 GMT</pubDate>
      <title>type changed</title>
      <link>http://localhost:8080/trac/ticket/591#comment:1</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/591#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;type&lt;/strong&gt;
                changed from &lt;em&gt;task&lt;/em&gt; to &lt;em&gt;maintenance&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 11 Sep 2013 19:15:00 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/591#comment:2</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/591#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.4&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Debian Squeeze has a RAM disk already:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 4.0G   12K  4.0G   1% /dev/shm
&lt;/pre&gt;&lt;p&gt;
So I have added this to &lt;tt&gt;/etc/rc.local&lt;/tt&gt; to create a directory for !MySQL on boot:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir /dev/shm/mysql ; chown mysql:mysql /dev/shm/mysql ; chmod 700 /dev/shm/mysql
&lt;/pre&gt;&lt;p&gt;
And I have edited &lt;tt&gt;/etc/mysql/my.cnf&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;tmpdir                  = /dev/shm/mysql
&lt;/pre&gt;&lt;p&gt;
One thing we will have to remember is that &lt;tt&gt;/dev/shm&lt;/tt&gt; will become &lt;tt&gt;/run/shm&lt;/tt&gt; when we upgrade to Wheezy on &lt;a class="closed ticket" href="http://localhost:8080/trac/ticket/535" title="maintenance: Upgrade Puffin, Penguin and Parrot from Debian Squeeze to Wheezy (closed: fixed)"&gt;ticket:535&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 11 Sep 2013 19:33:10 GMT</pubDate>
      <title>hours, status, totalhours changed; resolution set</title>
      <link>http://localhost:8080/trac/ticket/591#comment:3</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/591#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.4&lt;/em&gt; to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
And check it's set:
&lt;/p&gt;
&lt;pre class="wiki"&gt;MariaDB [(none)]&amp;gt; SHOW VARIABLES LIKE 'tmpdir';
+---------------+----------------+
| Variable_name | Value          |
+---------------+----------------+
| tmpdir        | /dev/shm/mysql |
+---------------+----------------+
1 row in set (0.01 sec)
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 03 Oct 2013 09:43:43 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/591#comment:4</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/591#comment:4</guid>
      <description>
        &lt;p&gt;
I have added a link to this ticket from &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer#MariaDB"&gt;wiki:PuffinServer#MariaDB&lt;/a&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 14 Jan 2014 12:31:06 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/591#comment:5</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/591#comment:5</guid>
      <description>
        &lt;p&gt;
There is a crontab entry to create and chown the directory on the ram disk, see &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer#Cron"&gt;wiki:PuffinServer#Cron&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>