question

Bhupendra99 avatar image
Bhupendra99 asked

Multithreading script

We had a transaction table in which every day around 100000 records are getting inserted It is being used concurrently by many application and around 1000 users They want to add Identity in that table So I was told to add an Identity in that table but before that I have to do POC to figure out that adding identity on a such transaction table will it cause any issues I was told to create Multithreding script or use powershell so It can resemble multiple users at a same time can any one suggest how can I achieve it
scriptstress-testing
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
This web site runs off of votes. Can you please indicate all helpful answers below by clicking on the thumbs up next to those answers. If any one answer lead to a solution, please indicate that by clicking on the check mark next to that one answer.
0 Likes 0 ·
Kev Riley avatar image
Kev Riley answered
I use Adam Machanic's SQLQueryStress tool ( http://www.datamanipulation.net/sqlquerystress/) whenever I want to quickly spin up multiple threads.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
Here's a good post explaining how [multi-threading in Powershell][1] works. You just have to then write multiple connections to your server and run queries through the Powershell. But, if you have access to SQL Server 2012 or 2014, you might want to look into the [Distributed Replay][2] utility. That's going to be a lot easier to set up and will require a lot less coding on your part. You can either capture Trace events and then replay them from multiple machines, or you can just write some queries on your own and then replay them. Either way, this is the method I prefer to simulate a production load. [1]: http://blog.isaacblum.com/2010/01/22/powershell-multithreading-omg/ [2]: http://msdn.microsoft.com/en-us/library/ff878183.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.