Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stress test a mongodb?

I like to run simulated test-clients that act as if e.g. 1000 clients execute tasks at the same time on a mongodb and see how the server stands. Together with profiling tools I like to be able to identify bottlenecks and fix them before they become a problem.

What tool would you to suggest to run simulated tests on an API Level? What profiling tool would you suggest to identify bottlenecks, free tools are currently preferred.

like image 404
Michael Hoeller Avatar asked Sep 05 '16 14:09

Michael Hoeller


People also ask

Can we connect MongoDB with JMeter?

JMeter allows teams to do MongoDB performance testing with the MongoDB Sampler, to send a query to the MongoDB instance. However, its implementation locks the database access when one query is being executed. This limits you to one request at a time, and is not enough for sufficient software performance testing.

How does MongoDB measure performance?

Use MongoDB's built-in free monitoring feature to get information on Operation Execution Times and Operation Counts. Once you connect via compass to your instance, you can use the MongoDB Compass Performance Tab, which is similar to Atlas RealTime Performance panel.

What is database stress test?

Stress testing is performed to identify the system breakpoint. Here the application is loaded in such a way that the system fails at one point. This point is called the breakpoint of the database system. Stress testing is also known as Fatigue Testing.


1 Answers

After quite some research I came to the point to use jmeter to do massive REST calls. That way I can create a controlled load on the database. The profiling I do with node-inspector and native mongodb profiling.

For those who like to do a more "direct" test to the DB John Page's POCDriver (simulated client): https://github.com/johnlpage/POCDriver might be interesting.

Profile visualisation (from log files) can be done with: https://github.com/rueckstiess/mtools

Hope that helps :-)

like image 179
Michael Hoeller Avatar answered Oct 01 '22 12:10

Michael Hoeller