Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Insert Performance stressTool
    text
    copied!<p>*if you are to lazy to read the description you can find my question in the end...</p> <p>Hi, I build a simple database:</p> <pre><code>CREATE TABLE `users` ( `id` varchar(45) NOT NULL, `full_name` varchar(45) NOT NULL, `first_name` varchar(45) NOT NULL, `last_nmae` varchar(45) NOT NULL, `login` varchar(45) NOT NULL, `password` varchar(45) NOT NULL, PRIMARY KEY (`id`,`full_name`,`login`), UNIQUE KEY `idusers_UNIQUE` (`id`), UNIQUE KEY `login_UNIQUE` (`login`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ </code></pre> <p>Now I am testing the performance of Inserting a single row.</p> <p>I created a stress tool with C# and run it to 1M rows. This is the code if you are interested:</p> <pre><code>abstract class Job { private static object synObject = new object(); private static int _id = 0; private static DateTime startingTime = DateTime.Now; private const int JOB_PER_SIRCLE = 10; protected int id; public Job() { lock (synObject) { _id++; id = _id; } } public void run() { while (true) { for (int i = 0; i &lt; JOB_PER_SIRCLE; i++) { doJob(); } lock (synObject) { calculate(); } } } private static DateTime lastLog = DateTime.Now; private static long numOfJobsAcomplished = 0; private static long totalNumOfJobsAcomplished = 0; private static void calculate() { totalNumOfJobsAcomplished += JOB_PER_SIRCLE; numOfJobsAcomplished += JOB_PER_SIRCLE; DateTime now = DateTime.Now; TimeSpan timePass = now - lastLog; if (timePass.TotalSeconds &gt; 1) { double total = 1000000; TimeSpan speed = TimeSpan.FromMilliseconds(timePass.TotalMilliseconds / numOfJobsAcomplished * total); Console.WriteLine("Speed = " + String.Format("{0:00.0000}", speed.TotalMinutes) + " Completed " + String.Format("{0:00.000}", totalNumOfJobsAcomplished / total * 100) + "% time pass " + (now - startingTime)); lastLog = now; numOfJobsAcomplished = 0; } } protected abstract void doJob(); } </code></pre> <p>In the doJob() method I am doing the insert and I am running 16 Job's, 16 threads(I found that it is the best performance on my machine)</p> <p>Anyway my question is about the result, I am getting between 85 to 105 minutes to insert 1,000,000 rows. Is this fast or should I look for different database to work with?</p> <p>P.S * When I am inserting I also hashing with MD5Crypt algorithm</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload