[CentOS] MySQL on tmpfs?

Thu Jul 27 19:26:54 UTC 2006
Alexander Dalloz <ad+lists at uni-x.org>

Mike Kercher schrieb:

>>On Thu, 2006-07-27 at 19:58 +0200, Alexander Dalloz wrote:
>>    
>>
>>>Mike Kercher schrieb:
>>>
>>>      
>>>
>>>>Has anyone ever mounted their /var/lib/mysql on a tmpfs or ramfs?  
>>>>Are there any performance gains to be made doing this?
>>>>
>>>>        
>>>>
>>>A foolish idea to me. You imagine what happens if the 
>>>      
>>>
>>machine hangs up?
>>
>>I wasn't going to say anything because he used "mount", not 
>>"create", "generate", "make", etc. I presummed he just wanted 
>>to mount the directory there. No harm, but no goin either. In 
>>fact, a very smal teensy-weensy loss probably, due to the 
>>extra step to get to things.
>>
>>    
>>
>>>Alexander
>>>
>Thanks for the input folks!
>
>Mike
>  
>
Besides the usual optimization like using best perfomance SQL statements 
and a good database layout you should take care for the [mysqld] 
key_buffer setting (/etc/my.cnf). This is RAM usage of MySQL and the 
place where the database engine tries to put as much of the indexes into 
it as possible. Ideally MySQL can get all indicies into the buffer. 
Using the STATUS variables key_read_requests and key_reads you can test 
whether the key_buffer is big enough: key_read_requests should be at 
least 100 to 1000 as big as the key_reads. It is reasonable to give the 
key_buffer 20% of the RAM you want to let MySQL use in total.

Alexander

http://dev.mysql.com/tech-resources/presentations/presentation-oscon2000-20000719/index.html