<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[database - All your code are belong to us]]></title><description><![CDATA[Thoughts, stories and ideas on code and technology in general.<br>Blog title inspired by <a href="https://en.wikipedia.org/wiki/All_your_base_are_belong_to_us" target="_blank">this meme</a>]]></description><link>https://allurcode.com/</link><image><url>https://allurcode.com/favicon.png</url><title>database - All your code are belong to us</title><link>https://allurcode.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Tue, 09 Jun 2026 18:24:45 GMT</lastBuildDate><atom:link href="https://allurcode.com/tag/database/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[MySQL very slow without a reason]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Is your MySQL really slow without actually being too busy?<br>
Does your script take very long time to connect to the database?<br>
Do you have lots of RAM, strong CPU, just a little traffic and despite that a very long database response time?<br>
Are you seeing connections with &quot;<em>unauthenticated</em></p>]]></description><link>https://allurcode.com/mysql-very-slow-without-a-reason/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea11e</guid><category><![CDATA[database]]></category><category><![CDATA[DNS]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[slow]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Wed, 07 Apr 2010 16:39:49 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Is your MySQL really slow without actually being too busy?<br>
Does your script take very long time to connect to the database?<br>
Do you have lots of RAM, strong CPU, just a little traffic and despite that a very long database response time?<br>
Are you seeing connections with &quot;<em>unauthenticated user</em>&quot; while running <code>show processlist</code> in MySQL console?</p>
<pre><code class="language-sql">mysql&gt; show processlist;
+------+----------------------+-----------+------+---------+------+-------+------+
|  Id  |         User         |   Host    |  db  | Command | Time | State | Info |
+------+----------------------+-----------+------+---------+------+-------+------+
| 2047 | unauthenticated user | localhost | myDB | Connect |  81  |       | NULL |
| 2049 | unauthenticated user | localhost | myDB | Connect |  81  |       | NULL |
| 2050 | unauthenticated user | localhost | myDB | Connect |  76  |       | NULL |
 ... 
+------+----------------------+-----------+------+---------+------+-------+------+
131 rows in set (0.00 sec)
</code></pre>
<p>If you answered <strong>yes</strong> to any of the above questions, your MySQL might have a problem with resolving connection&#x2019;s host name.<br>
When attempt is made for a new connection, MySQL tries to resolve the host name for that request. It takes the IP address and resolves it to a host name (using <code>gethostbyaddr()</code>). It then takes that host name and resolves it back to the IP address (using <code>gethostbyname()</code>) and compares to ensure it is the original IP address.<br>
This might considerably increase connection time and slow down your whole application or produce <code>show processlist</code> results as above. You can easily solve this problem by disabling DNS host name lookups for MySQL. In order to do this you need to run your mysqld with <code>&#x2013;skip-name-resolve</code> option or add it to your <code>/etc/mysql/my.cnf</code> file like that:</p>
<pre><code>[mysqld]
skip-name-resolve
</code></pre>
<p>After that running <code>show processlist</code> will result in &quot;Host&quot; column displaying only IP addresses instead of host names and the connection speed should improve significantly.</p>
<p>Just keep in mind that also you have to change allowed hosts for your database users to proper IP addresses.</p>
<p>For additional information, check out: <a href="https://pcrevive.org/areas-we-serve/computer-repair-lake-worth-fl/">Lake Worth, Florida computer services</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>