Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am doing Performance evaluation of my application. The size of database is around 20GB. I am using jMeter as a performance evaluation tool. Here each performance test (ie., Each jMeter run) there is some number of records are inserted. Here is my testing sequence.

  1. Run jMeter and check the time taken to complete an action
  2. Finetune the code for performance.
  3. Re-Run the same scenario and check the timing.

For example. Before run :

Id      Name
1       XXXX
2       YYYY
3       ZZZZ

After Step 1, My table data look likes

Id      Name
1       XXXX
2       YYYY
3       ZZZZ
4       AAAA
5       BBBB
6       CCCC

Now I wants to revert my table like the first ie.,

Id      Name
1       XXXX
2       YYYY
3       ZZZZ

Here what my problem is the DB size is growing for each test run.

Is there any way to maintain some benchmark (if the DB size is 20GB means, It must be maintain the size as 20GB till end of my test). Any one please guide me how to achieve my requirement.

share|improve this question
This question is hard to understand. You're likely to get better replies if you can rewrite it in a clearer way. Some more specific details about what you're testing and what you're trying to achieve might also be helpful. – James Lupolt Jun 28 '13 at 9:50
Normally benchmarking is done with rolling back all changes after the run is finished, that is, the last statement of the test script is ROLLBACK;. Of course, you have to write BEGIN; as the very first one. – dezso Jun 28 '13 at 10:19
@dezso, Thanks for your reply. When i run jmeter the data which is inserted are automatically committed then how can i rollback the transactions?? – Bathakarai Jun 28 '13 at 11:52
Can you turn off autocommit? When committed, you can't roll back anymore. – dezso Jun 28 '13 at 13:56
Is all your data InnoDB ? Do you have innodb_file_per_table enabled? Please run SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table'; – RolandoMySQLDBA Jun 28 '13 at 15:49

I don't really have the possibility to try jMeter now, so I don't know how following the below advice would affect your tests.

Normally benchmarking is done so that after the tests the original database state is restored. This is achieved by rolling back all changes.

In the case of jMeter you have to set AutoCommit to false in the JDBC configuration, then issue a ROLLBACK as the very last command in your test script.

share|improve this answer
I am using rails application. So i am couldn't use Rollback or savepoint. – Bathakarai Jun 28 '13 at 16:45
@Bathakarai well any framework that won't allow you to control your transactions sounds like something that you should run away from ... quickly. – swasheck Jun 28 '13 at 19:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.