views:

76

answers:

4

I am finishing off testing a multi-threaded application that seems to work fine until I put it under heavy load and then stress the machine it is running on as well. Then I start seeing some of the stranger edge-cases that I did not foresee produce some unexpected/unforeseen conditions. The way I am stressing the machine is by running a vacuum on a very large sqlite database. Does anyone have any other good ways of inducing this type of heavy-load scenario?

+1  A: 

Might be of interest to you - Unit testing a mutlithreaded application

James
+2  A: 

You could use CHESS.

winSharp93
It's license procludes it from beeing used it my environment.
My Other Me
+1  A: 

Threading problems due to improper locking tend to reveal themselves under heavy load because the timing changes. It isn't actually the heavy load that produces the problem, it is the changed timing due to random scheduling delays. You can repro the problems without heavy loads by introducing random delays in the thread's execution. This is the approach Chess uses.

Hans Passant
+1  A: 

What kind of stress are you referring to? Memory, CPU, full thread pool, or file I/O?

I'd write a simple app that has a thread that consumes memory, a thread that consumes CPU cycles, a thread that ties up the thread pool, and a thread that thrashes the disk. Hang a UI on it to control each thread's appetite and adjust the "knobs" to honk with your app.

ebpower
Thanks for the idea. I think I'll get the most milage out of doing something like this.
My Other Me