Solved

Insert Statements Load Testing

Posted on 2010-08-16
4
305 Views
Last Modified: 2012-05-10
Experts -

I'm tryng to simulate the user load testing for the following insert statement. The idea is running this in multiple sessions/threads and measuring

the various performance (CPU usage, Transaction per second, IO, etc). This is an interactive application and I'd like to create the load of 5000 or

more users as possbile to simulate the testing. I understand that it depends on the specs on the server computer it runs on of course, but assuming

you buy the best server available for around $10K?
DECLARE @row INT;
DECLARE @string VARCHAR(50), @length INT, @code INT;
SET @row = 0;
WHILE @row < 100000 BEGIN
   SET @row = @row + 1;

   -- Build the random string
   SET @length = ROUND(80*RAND(),0);
   SET @string = '';
   WHILE @length > 0 BEGIN
      SET @length = @length - 1;
      SET @code = ROUND(32*RAND(),0) - 6;
      IF @code BETWEEN 1 AND 26 
         SET @string = @string + CHAR(ASCII('a')+@code-1);
      ELSE
         SET @string = @string + ' ';
      END 


   -- Ready for the record
   SET NOCOUNT ON;
   INSERT INTO [SP].[SMSG].[TMSG VALUES (
     -- @row,
      @string,
      ROUND(2000000*RAND()-1000000,9),
      ROUND(2000000*RAND()-1000000,9),
      GETDATE(),
      CONVERT(DATETIME, ROUND(60000*RAND()-30000,9)),
      null,
      null,
      @string,
      @string,
      null,
      null   )
END

Open in new window

0
Comment
Question by:sventhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
dwkor earned 500 total points
ID: 33447077
I cannot talk about server specs but one thing I noticed - it looks like your table has identity (@row). If you have clustered index defined on that field and expect to have load > a few hundred inserts per second, I would suggest to change clustered index to something else. Otherwise you will have contention because of "hot spots" during insert.
0
 
LVL 7

Expert Comment

by:lundnak
ID: 33447470
Could you restate your question?  I'm unable to understand what you are looking for from the experts.
0
 
LVL 18

Author Comment

by:sventhan
ID: 33447816
Sure.

I Would like to measure the performance metrics during the maximum load of a certain table. To keep it simple just run the same insert stmt again and again (using various threads/users/agents) to the same table till I get 100% CPU usage. What is the maximum capacity the system can handle for just doing a multiple insert to the same table(Daily Partitioned) with clustered index on it?

This is a messaging application and this table is going to grow with the messages. I'm doing the capacity planning.

Thanks,
~sve.

0
 
LVL 18

Author Closing Comment

by:sventhan
ID: 33450998
Thanks for the help.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question