2010-02-17

Speeding up database-bound tests with MySQL

In my day job we use MySQL a lot, and we also like to pretend that we have tests.

It's a good idea to run tests using the same database you're using in production, but MySQL ain't exactly a speed demon compared to memory-backed databases like Hypersonic, H2 or even Derby.

But wait - we can have our cake and eat it, too!

The trick is to tell MySQL to store its data files in memory; more specifically, the InnoDB files should be stored on a memory-backed filesystem like tmpfs.

So, create a directory somewhere (I use /var/lib/mysql/innodb) and mount tmpfs on it (mount -t tmpfs none /var/lib/mysql/innodb, or set it up in /etc/fstab).

After that, tell MySQL to store the InnoDB files there by sticking the following lines in /etc/mysql/my.cnf:

innodb_data_home_dir=/var/lib/mysql/innodb
innodb_log_group_home_dir=/var/lib/mysql/innodb

Now restart MySQL, and run your now-speedier tests!

45 comments:

Dan Dukeson said...

Nice idea, do you have any figures on the actual speedup that you achieved?

espenhw said...

It's not really scientific, but for one set of database-bound integration tests total runtime for the test set went from 48 to 31 seconds; that's a speedup of ~35%.

Adam Monsen said...

Great idea, thanks! The "tests" for the project I'm working on (Mifos) are also insanely database-intensive, and I was able to reduce test time by placing MySQL data on a tmpfs partition.

Kayal said...

This was a very good thing and it is also a very interesting blog. I like your great post, Thanks for giving the valuable post. Do well!!!

Oracle DBA Training in Chennai
Oracle DBA Course in Chennai
Excel Training in Chennai
Oracle Training in Chennai
Spark Training in Chennai
Tableau Training in Chennai
Embedded System Course Chennai
Unix Training in Chennai
Oracle DBA Training in OMR


Lakshi said...

This post is really nice and informative. The explanation given is really comprehensive and informative..

Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery



Data Science Hyderabad said...

Awesome article with top quality information and found very interesting looking forward for next blog thank you.
Data Science Course in Hyderabad 360DigiTMG

Tech Institute said...

Top quality blog with very informative information found very useful thanks for sharing and hopping for some more informative posts.
Data Analytics Course Online

Data Science Training said...

I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most. PMP Training in Hyderabad

Data Science said...

Great article with valuable information found very resourceful and enjoyed reading it waiting for next blog updated thanks for sharing.
typeerror nonetype object is not subscriptable

Data Science Training said...

I want to thank you for your efforts in writing this article. I look forward to the same best job from you in the future. PMP Certification in Hyderabad

Cyber Security said...

Nice Information Your first-class knowledge of this great job can become a suitable foundation for these people. I did some research on the subject and found that almost everyone will agree with your blog.
Cyber Security Course in Bangalore

Cyber Security Course said...

Writing in style and getting good compliments on the article is hard enough, to be honest, but you did it so calmly and with such a great feeling and got the job done. This item is owned with style and I give it a nice compliment. Better!
Cyber Security Training in Bangalore

TECHNOLOGY said...

I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most.
unindent does not match any outer indentation level

Techprograms said...

I'm glad I found this blog! Occasionally, students want to know the keys to writing productive literary essays. Your first-class knowledge of this great job can become a suitable foundation for these people. Good
unindent does not match any outer indentation level python

EXCELR said...

Im really impressed by it.I am happy for sharing on this blog its awesome blog I really impressed. thanks for sharing. Great efforts. data science training

Excelr Tuhin said...

I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!
data science training

DataScience Specialist said...

I have to search sites with relevant information ,This is a
wonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Course in Bangalore

DataScience Specialist said...

I have to search sites with relevant information ,This is a
wonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Training in Bangalore

Huongkv said...

Aivivu mua vé máy bay, tham khảo

vé máy bay đi Mỹ hạng thương gia

ve may bay tu my ve vietnam

vé giá rẻ đi đà nẵng

vé máy bay đi đà lạt bao nhiêu tiền

đặt vé máy bay phú quốc

Pallavi reddy said...

i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
data science training in bangalore

Safia Sultana amina said...

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.


เว็บแทงบอล
ufabet
ufa
พวงหรีด
โควิด
บาคาร่า

Safia Sultana amina said...

This article is increasing the interest to learn more about this topic. Continue sharing your new updates, regularly for my future.


คาสิโนออนไลน์
ufabet
ufa
เว็บบอล
relx

Alexander Debrah said...

Movie-watching websites that are more than movie-watching websites Because we are the number 1 free movie site in Thailand for a long time, including new movies, Thai movies, Western movies, Asian movies, we have all kinds of ways for you Including new series Full of all stories without interstitial ads to keep annoying anymore. One place sa-movie.com.

Android and IOS operating systems. Watch online movies, Thai movies, Western movies, Asian movies, Cartoon movies, Netflix Movie, Action Movies, Comedy Movies, Crime Movies, Drama Movies, Horror Movies, Adventure Movies, Crash Movies and still have many new movies to watch. You can watch for free anytime, anywhere 24 hours a day at see4k.com.


GangManga read manga, read manga, read manga online for free, fast loading, clear images in HD quality, all titles, anywhere, anytime, on mobile, tablet, computer. Android and IOS operating systems. Read top comics, action dramas, comedy, adventure, horror and manga. New coming every day to watch many more. Can be read for free anytime anywhere 24 hours a day at gangmanga.com..

It is no secret that football is among the most popular and widely watched sports. Everybody who likes football tries to find the best platform for free soccer streaming. So, what are the best free sports streaming sites? We are going to answer this question. On this page, you can find a detailed overview of the most widespread soccer streaming websites. Keep on reading and make the best choice for you live24th.me.

Priya Rathod said...

The content is well acknowledged, so no one could allege that it is just one person's opinion yet it covers and justifies all the applicable points. I have read such a startling work after a long time!
Data Science Training in Hyderabad
Data Science Course in Hyderabad

Priya Rathod said...

Thanks for posting the best information and the blog is very helpful
Python Training in Hyderabad
Python Course in Hyderabad

Unknown said...

Thanks for sharing an informative post. Keep on sharing such useful information.

UiPath Training In Bangalore | UiPath Online Training

AS400 Training In Bangalore | AS400 Online Training

Docker and Kubernetes Training In Bangalore | Docker and Kubernetes Online Training

Go Language Training In Bangalore | Go Language Online Training

Oracle Apps Technical Training In Bangalore | Oracle Apps Technical Online Training

UI UX Design Training In Bangalore | UI UX Design Online Training

Pyspark Training In Bangalore | Pyspark Online Training

React Native and Redux Training In Bangalore | API Online Training

Adobe Sitecatalyst Training In Bangalore | Adobe Sitecatalyst Online Training

Python with Django Training In Bangalore | Python with Django Online Training

360DigiTMG said...

great article!! sharing these type of articles is the nice one and i hope you will share an article on data science.By giving a institute like 360DigiTMG.it is one the best institute for doing certified courses
data science malaysia

Data Analytics Courses in Bangalore said...

I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
data science in bangalore

Maradona Jons said...

With special privileges and services, UEFA BET offers opportunities for small capitalists. Together ufa with the best websites that collect the most games With a minimum deposit starting from just 100 baht, you are ready to enjoy the fun with a complete range of betting that is available within the website

ufabet , our one another option We are a direct website, not through an agent, where customers can have great confidence without deception The best of online betting sites is that our Ufa will give you the best price

หาคุณกำลังหาเกมส์ออนไลน์ที่สามารถสร้างรายได้ให้กับคุณ เรามีเกมส์แนะนำ เกมยิงปลา รูปแบบใหม่เล่นง่ายบนมือถือ คาสิโนออนไลน์ บนคอม เล่นได้ทุกอุปกรณ์รองรับทุกเครื่องมือ มีให้เลือกเล่นหลายเกมส์ เล่นได้ทั่วโลกเพราะนี้คือเกมส์ออนไลน์แบบใหม่ เกมยิงปลา

อีกทั้งเรายังให้บริการ เกมสล็อต ยิงปลา แทงบอลออนไลน์ รองรับทุกการใช้งานในอุปกรณ์ต่าง ๆ HTML5 คอมพิวเตอร์ แท็บเล็ต สมาทโฟน คาสิโนออนไลน์ และมือถือทุกรุ่น เล่นได้ตลอด 24ชม. ไม่ต้อง Downloads เกมส์ให้ยุ่งยาก ด้วยระบบที่เสถียรที่สุดในประเทศไทย

360DigiTMGAurangabad said...

Amazing blog.Thanks for sharing such excellent information with us. keep sharing...
machine learning course in aurangabad

360DigiTMGAurangabad said...

Wonderful blog. I delighted in perusing your articles. This is genuinely an incredible perused for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome!
best machine learning course in aurangabad

Marty Sockolov said...

Probably the most genuine football betting UFABET that's beyond description Find fun, excitement and excitement with slot video games, hundred totally free recognition, quick withdrawal. If you desire to have fun slots for money No need to deposit a great deal, no minimum, no need to share, squander moment for the reason that UFABET is in fact reduced, given seriously, many great offers are waiting for you. Prepared to ensure pleasurable, regardless of whether it's Joker SlotXo fruit slot, we are able to phone it an internet slot website for you personally especially. Ready to have fun Like the support staff which is going to facilitate slot formulas as well as techniques of actively playing So you will be certain that each minute of fun and pleasure We will be there for one to give your customers the best appearance as well as fulfillment.
บาคาร่า
สล็อต
ufa
แทงบอล

360DigiTMG-Pune said...

Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
data scientist course in pune

lionelmessi said...

Hi, Thanks for sharing huge content...

Python Training in Hyderabad

trainingcourses said...

I am impressed by the information that you have on this blog. It shows how well you understand this subject.
digital marketing courses in hyderabad with placement

Priya Rathod said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
DevOps Training in Hyderabad
DevOps Course in Hyderabad

trainingcourses said...

Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
data scientist certification malaysia

Priya Rathod said...

Your blogs are amazing and I am glad to read them. Thanks for sharing.
AWS Training in Hyderabad
AWS Course in Hyderabad

Priya Rathod said...

This blog was really great, never seen a great blog like this before. I think I’m going to share this to my friends.
Data Science Training in Hyderabad
Data Science Course in Hyderabad

data science said...

I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra. data science course in jaipur

trainingcourses said...

Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.
data science training

python course in delhi said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. data scientist course in delhi

Deekshitha said...

Informative blog
best digital marketing institute in hyderabad

training institute said...

I am impressed by the information that you have on this blog. It shows how well you understand this subject.
data science course


Deekshitha said...

Informative blog
ai training in hyderabad