John MacIntyre
John MacIntyre

Reputation: 13021

How do you simulate frequent database activity for realistic testing?

I'm building a web app against a database where a small number of records (about 5000) are active at the same time. Each active working record probably experiences 50-300 changes by 30 users over a 4 hour period ... which is thousands of changes per minute.

Because our testing environment is so static, testing is not realistic, and some issues do not arise until we hit the production database.

I had the idea to Run Profiler, collect the DML statements, then replay them on the test server while debugging the app ... Assuming I can replay them in the same time intervals as the original was run. But even this wouldn't be a valid test, since tester changes could corrupt future DML statements being replayed.

Does anybody know how to simulate real time database changes for realistic testing?

Thanks.

BTW-Our problems are not concurrency issues.

Upvotes: 3

Views: 1291

Answers (3)

luvieere
luvieere

Reputation: 37494

Perhaps use something along the lines of a database stress-testing tool like the mysqlslap load-emulator. Here's a link explaining use-cases and specific examples.

Upvotes: 0

Brent Ozar
Brent Ozar

Reputation: 13274

There's a few commercial packages that do this. I work for Quest Software, makers of one of the packages, but I'm going to list three because I've worked with all of 'em before I came to work for Quest:

  • Microsoft Visual Studio Test Edition - it has load testing tools added on. It lets you design tests inside Visual Studio like simulating browsers hitting your web app. Recording the initial macros is kind of a pain, but when you've done it, it's easy to replay. It also has agents that you can deploy across multiple desktops to drive more load. For example, we installed it on several developers' desktops, and when we needed to do load testing after hours, we could throw a ton of computing power at the servers. The downside is that the setup and ongoing maintenance is kinda painful.
  • HP Quality Center (used to be Mercury Test Director and some other software) - also has load testing tools, but it's designed from the ground up for testers. If your testers don't have Visual Studio experience, this is an easier choice.
  • Quest Benchmark Factory - this tool focuses exclusively on the database server, not the web and app servers. It captures load on your production server and then can replay it on your dev/test servers, or it can generate synthetic transactions too. There's a freeware version you can use to get started.

If you know and love Visual Studio, and if you want to test your web servers and app servers, then go with Visual Studio Test Edition. If you just want to focus on the database, then go with Benchmark Factory.

Upvotes: 0

Sergey Galashyn
Sergey Galashyn

Reputation: 6956

Maybe this Selenium-based service is what you need: browsermob

Few people recommended it.

And yes, this is not an ad :)

Upvotes: 1

Related Questions