| MEMORY tables are very slow due to swapping [message #766] |
Thu, 22 February 2007 01:30  |
mcdavies Messages: 4 Registered: February 2007 |
Junior Member |
|
|
Hi.
I have such a problem: one large MEMORY table and mysqld with memlock enabled ("show status" shows "locked_in_memory ON"). When I start mysqld everything seems like OK: "select ..." from the table is very fast and mysqld process SWAP size is 9-10 mb. And at this moment I have about 200-300 mb of free memory (I use top to find it out). But in some time mysqld SWAP size is increasing up to 300-500 mb, and queries to the MEMORY table get very slow. Stopping other services like httpd on this server can help sometimes, but not very much, anyway, mysqld SWAP size is increasing and the performance is awful.
The OS on the server is RHEL 4. Mysql version is non rpm 5.1.15 (I also tried 5.1.14 and 5.0.27).
|
|
|
|
|
|
|
|
|
| Re: MEMORY tables are very slow due to swapping [message #786 is a reply to message #776 ] |
Fri, 23 February 2007 19:35   |
Peter Messages: 405 Registered: August 2006 |
Senior Member Super Guru |
|
|
Well,
MySQL is normally started under root and memlock should be done before it changes user to mysql.
I do not think memory locking is bad idea if it is limited to proper size and if MySQL is configured not to hog all the memory
Way to often VM will try to be smarter than you are by swapping out things in case of active IO which can be hard to control.
Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
|
|
|
| Re: MEMORY tables are very slow due to swapping [message #787 is a reply to message #786 ] |
Fri, 23 February 2007 19:37   |
Peter Messages: 405 Registered: August 2006 |
Senior Member Super Guru |
|
|
Well,
Sinisa tells memlock is unreliable on Linux... but it is not the question in this particular case.
At least on Some Linux versions in some configuration it works reasonably well. For some other is may not as people reply problems with it.
It is always hard with general statements.
Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
|
|
|
| Re: MEMORY tables are very slow due to swapping [message #788 is a reply to message #787 ] |
Sat, 24 February 2007 01:46  |
mcdavies Messages: 4 Registered: February 2007 |
Junior Member |
|
|
|
Thanks everyone for answer. I'll try other OS with mysqld locked in memory.
|
|
|