# mysql ndb cluster - poor performance, hanging queries, I'm lost

**URL:** <https://forums.percona.com/t/mysql-ndb-cluster-poor-performance-hanging-queries-im-lost/2370>\
**Category:** Other MySQL® Questions\
**Created:** [March 21, 2007, 3:59pm UTC](https://forums.percona.com/t/mysql-ndb-cluster-poor-performance-hanging-queries-im-lost/2370 "2007-03-21T15:59:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pesx](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pesx](https://forums.percona.com/u/pesx)\
**Post date:** [March 21, 2007, 3:59pm UTC](https://forums.percona.com/t/mysql-ndb-cluster-poor-performance-hanging-queries-im-lost/2370/1 "2007-03-21T15:59:44Z")

</div>

Hi,

I’ve installed 2-node cluster for highly visited web application in php. I’m using memcached for caching, I’m caching whole pages, every page changes two times a day but needs lots of queries to build.

I thought it doesn’t matter of mysql performance, because pages are not generated very often.

But I have big problems when page cache is cleared at once. Many pages are generated at the same time and mysql starts to hold some queries. When I look at show processlist, it shows something like that:

±----±-----------±--------------------±-------±-------- ±-----±-------------±------------------------------------ ------------------------+  
| Id | User | Host | db | Command | Time | State | Info |  
±----±-----------±--------------------±-------±-------- ±-----±-------------±------------------------------------ ------------------------+  
| 273 | php-app | localhost | phpapp | Query | 146 | Sending data | select model\_name from (select im\_model\_id as mid from issues\_d gro |  
| 274 | php-app | localhost | phpapp | Query | 146 | NULL | SELECT file\_name FROM files JOIN data\_file on file\_id=df\_fileder by |  
| 275 | php-app | localhost | phpapp | Query | 144 | NULL | SELECT site\_id FROM sites WHERE site\_name='[example.com](http://example.com) |  
… many same rows  
| 276 | php-app | localhost | phpapp | Query | 144 | NULL | SELECT site\_id FROM sites WHERE site\_name='[example.com](http://example.com) |  
| 277 | php-app | localhost | phpapp | Query | 142 | NULL | SELECT site\_id FROM sites WHERE site\_name='[example.com](http://example.com) |  
| 278 | php-app | localhost | phpapp | Query | 141 | NULL | SELECT site\_id FROM sites WHERE site\_name='[example.com](http://example.com)

and database goes out of connections. No more client can connect any more and these hanging queries in null state are there until manual server restart.

I have ubuntu edgy server with mysql 5.0.24a-9 from standard package, 64bit.

Anyone has any idea, how to get rid of these hanging queries or how to improve cluster performance? Thanks for any idea!

(edit - I also find these lines in syslog, on both machines, so it’s probably not hardware issue):

mysqld got signal 11;  
This could be because you hit a bug. It is also possible that this binary  
or one of the libraries it was linked against is corrupt, improperly built,  
or misconfigured. This error can also be caused by malfunctioning hardware.  
We will try our best to scrape up some info that will hopefully help diagnose  
the problem, but since we have already crashed, something is definitely wrong  
and this may fail.

key\_buffer\_size=16777216  
read\_buffer\_size=131072  
max\_used\_connections=5  
max\_connections=150  
threads\_connected=1  
It is possible that mysqld could use up to  
key\_buffer\_size + (read\_buffer\_size + sort\_buffer\_size)\*max\_connections = 342782 K  
bytes of memory  
Hope that’s ok; if not, decrease some variables in the equation.

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [March 21, 2007, 7:33pm UTC](https://forums.percona.com/t/mysql-ndb-cluster-poor-performance-hanging-queries-im-lost/2370/2 "2007-03-21T19:33:09Z")

</div>

You “sites” table seem to be part of most of the faulty connections.  
Test reparing the sites table and see if that works.

Otherwise you can have a problem with PHP’s pooling of mysql connections.  
Try setting down the mysql server “wait\_timeout” parameter so that mysqld is garbage collecting inactive query threads.

---

<div class="post-metadata">

**Author:** ![pesx](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pesx](https://forums.percona.com/u/pesx)\
**Post date:** [March 22, 2007, 2:52am UTC](https://forums.percona.com/t/mysql-ndb-cluster-poor-performance-hanging-queries-im-lost/2370/3 "2007-03-22T02:52:29Z")

</div>

Thanks for your advice, I’ve recreated sites table and set that wait\_timeout. It looks promising!
