MySQL Stress test


Before anything else, we test how much load MySQL can sustain. As a first test, we have MySQL installed on a Pentium II 450 MHz with 256 MB. We have a table filled with slightly more than 1 million entries. The test is repeated multiple time, and goes like this:

  1. Wait for the database server to go to a non stress condition (wait for the buffers to empty)
  2. Start a process that inserts record (using INSERT DELAYED) as fast as it is possible
  3. Wait some time, and stop the process
  4. Measure the number of queries per second

The queries per seconds will depend on how long the process inserting the query will last. At first, the database will cache the queries, without actually executing them. After a while, it won't be able to cache them anymore and it will have to start writing them to disk.

Here are the results

As one might expected, MySQL is able to handle greater loads for a short time: the queries are cached and executed later. That is essentially what the delayed is for. Under continous load, MySQL stabilizes around 80/90 inserts per seconds. Given our requirements, a single server less powerful of what we have in production, and not finely tuned, is able to satisfy them.


Gabriele Carcassi - page was last modified