Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to performance/benchmark testing a Rails app with real world database?

I would like to performance testing a Rails app.

The real world data is 100 MB in size.

But Rails always rebuilds the test database, which overwrites the real world data.

So how to the performance testing?

like image 878
Cheng Avatar asked Apr 12 '10 14:04

Cheng


1 Answers

I would create a new environment called "performance". You need this to replicate the production settings of your app (class caching, templates etc) and then load the database. In the past I have created a DB specifically for performance testing, created a rake task that executes the necessary migrations/loading and then called the rails performance script.

You can also turn the fixture behaviour off in your tests - depends on which test framework you are using.

I also found this useful post on Running Rails performance tests on real data that has some details on this approach.

like image 139
Toby Hede Avatar answered Oct 16 '22 19:10

Toby Hede