[英]How to Stress Test Sql Server Performance vs Number Requests per Second
I want to do a stress test of my sql server by calling the server by a simple query in a loop. 我想通过循环中的一个简单查询调用服务器来对我的sql服务器进行压力测试。 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.
假设我有x个客户端在循环中调用服务器10000次,我将测量y秒,直到最后一个查询完成。 I will measure how y and x behaves.
我将测量y和x的行为。
Does this test make sense? 这个测试有意义吗?
I only have one PC and one dev database server. 我只有一台PC和一台dev数据库服务器。 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?
如何在多线程上下文中运行查询-知道sql服务器具有连接池并可以缓存我的查询,我有什么需要记住的吗?
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))
. (id int, query nvarchar(max))
。 populate your table with different queries, simple to complicated, fast to time consuming. different
queries. different
查询。 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. 注意 :您应该将SQL Server与程序放在不同的计算机上,否则测试不是很有效,因为在现实世界中,数据是通过网络传输的。
Please "Mark as Answer" if a post has answered the question 如果帖子回答了问题,请“标记为答案”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.