homepage Welcome to WebmasterWorld Guest from 54.145.182.50
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Using RAMdisk to speed up MySQL? Can I?
tntpower

10+ Year Member



 
Msg#: 3825740 posted 11:26 pm on Jan 13, 2009 (gmt 0)

Can I use Ram Disk to load entire db file into memory to speed up database?

Thanks

 

GaryK

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3825740 posted 11:31 pm on Jan 13, 2009 (gmt 0)

A quick Google search on mysql +"ram disk" shows it's indeed possible and that lots of folks are doing it.

Morgenhund

10+ Year Member



 
Msg#: 3825740 posted 11:45 pm on Jan 15, 2009 (gmt 0)

Hmmm... what happens after server reboot?

MySQL allows in-memory tables, that should be a better option.

IMHO one should speed-up database by good database design and preventing program from using it whenewer possible (i.e. use disk-level cache for rarely-changing pages).

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3825740 posted 12:14 am on Jan 16, 2009 (gmt 0)

Morgenhund is bringing up good discussion ... why exactly are you looking at RAMdisk to speed up your database? What are the issues, exactly?

arjenm

5+ Year Member



 
Msg#: 3825740 posted 2:02 pm on Jan 17, 2009 (gmt 0)

I doubt you see any performance benefit from using a RAM-disk if your table-engine is InnoDB. If you're using MyISAM for the relevant table, you may see some benefits, but its still very likely that your hottest tables indexes are in the key cache and the data in the system's disk cache.

Apart from that, you may find that MySQL's memory-table also doesn't provide any noticable performance benefit, or even some degredation if you're going to store dynamic rows in it.

If you can cache the (processed) data, I'd look at that. Especially a system like memcached or similar environments are quite easy to use and can be very fast. Also keep in mind that a cache can already be beneficial if you have to reproduce your data every second... Which is, normally, quite rare, you can normally get away with at least one minute.

Frank_Rizzo

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3825740 posted 3:02 pm on Jan 17, 2009 (gmt 0)

Definitely not worth doing for continuously writable databases - read only databases will only see a benefit.

But wait. Mysql and your O/S should be caching the files in ram anyway so there is no need for a ramdrive here. All you need to do is ensure you have plenty of ram and tune with something like

MySQLTuner by Major Hayden

Ramdrives should be used for storing legacy databases, processing of temporary files and indexes, session files, files you want to permanently cache which may not be cachable via the o/s or apache.

A few more inexpensive ways of increasing performance (assuming linux / apache / mysql)

Have two disks but don't mirror them. One disk is used for the o/s and the other just for the database files.

Set log files to absolute minimum. Don't log image files, .js etc.

Remove all unecessary services from starting up.

Turn off noatime on the volumes.

Set disk acoustic level to fast / loud.

tntpower

10+ Year Member



 
Msg#: 3825740 posted 8:37 pm on Jan 17, 2009 (gmt 0)

Many thanks for all of you.

Yes, it is basically a read only database. WRITE occurs only if administrators (3 persons) do that.

If I do not see big benefits by loading database file into memory, I will then load all static files used by the application to memory, hopefully that makes some difference.

Thank you!

jeffatrackaid

5+ Year Member



 
Msg#: 3825740 posted 6:46 pm on Jan 28, 2009 (gmt 0)

You may want to check into memcached. This was designed for this purpose. It has many APIs and runs well on several clusters I work on.

[danga.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved