I want to do a stress test of my sql server by calling the server by a simple query in a loop. I want to run this procedure in parallel. Say I have x clients calling the server in loop for 10000 times, I will measure y seconds until the last query finishes. I will measure how y and x behaves.
Does this test make sense?
I only have one PC and one dev database server. How can run the queries in a multithreading context -- knowing the sql server has connection pool and will cache my query, is there anything that I need to keep in mind?
You cannot do that using a simple query as it cache the data (as you mentioned)
You need to use different queries which take time (at least a couple of seconds to a couple of minutes). Also your query should read large amount of data and return large/small amount of data to client.
My suggestions is do it this way:
(id int, query nvarchar(max))
. populate your table with different queries, simple to complicated, fast to time consuming. You may need hundred or thousands of different
queries. Note : You should have SQL Server on a different machine than your program, otherwise your test is not very valid, because in real world, data transfers over a network.
Please "Mark as Answer" if a post has answered the question
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.