简体   繁体   English

SQL Server性能问题

[英]SQL Server Performances Issue

I am running 7 XML Parsers (grabbing data from 3rd party websites) on my server. 我在服务器上运行7个XML解析器(从第三方网站获取数据)。

When I am running each XML Parser separately, it takes around 1 minute to go thru 15MB XML (which is pretty huge). 当我分别运行每个XML Parser时,经过15MB XML(这非常大)大约需要1分钟。

When I running all the 7 together, it takes around 10 minutes each to finish running. 当我一起运行所有这7个程序时,每个程序大约需要10分钟才能完成运行。

Each XML is adding a lot of information to the DB, and running around 50,000 queries. 每种XML都在数据库中添加了大量信息,并运行大约50,000个查询。

The server I am running my parsers on is: 我运行解析器的服务器是:

  • Server type: Hp Dl180 g6 服务器类型:HP Dl180 g6
  • Processor type: Intel Xeon E5504 处理器类型:Intel Xeon E5504
  • Processor speed: 2000 Mhz 处理器速度:2000 Mhz
  • Number of CPU's: 2 CPU数量:2
  • Number of cores: 4 核心数:4
  • RAM: 16 GB 内存:16 GB

Running SQL Server Web Edition on 2 CPU's 在2个CPU上运行SQL Server Web Edition

The problem comes when all the parsers run parallel, the SQL Server's CPU goes to 100%. 当所有解析器并行运行时,问题就来了,SQL Server的CPU变为100%。

And the really big issue, is that I need to have around 50 XML Parsers in the future :( 真正的大问题是,将来我需要大约50个XML解析器:(

What do you advice guys? 您对男人有何建议? should I upgrade the XML server maybe? 我应该升级XML服务器吗? or the server itself? 还是服务器本身?

Maybe the SQL Server is running on 1 CPU and not on 2 CPU's? 也许SQL Server在1个CPU而不是2个CPU上运行? how can I check that? 我该如何检查?

Any advice would help... 任何建议都会有所帮助...

Had the same problem. 有同样的问题。 i had 600,000 lines of XML which didn't finish processing even after an hour. 我有60万行XML,即使一个小时后也没有完成处理。 What worked for me was to break the XML into smaller chunks and insert the chunks to a temp table (my XML described TV shoes so i broke it to 200 different channels) and now it takes 1 minute for the entire XML 对我有用的是将XML分解为较小的块并将这些块插入到临时表中(我的XML描述了电视鞋子,所以我将其分解为200个不同的通道),现在整个XML需要1分钟

Even though the CPU is at 100%, I think your bottleneck here is I/O. 即使CPU达到100%,我认为您的瓶颈是I / O。 Specially because you said that you have several process reading and writing data to the disk at the same time. 特别是因为您说过您有多个进程同时将数据读取和写入磁盘。 Can you check the I/O on your server? 您可以检查服务器上的I / O吗?

If the processes are hitting different tables there may be somethings you can do, like using Filegroups to split your DB into different HD. 如果进程访问的是不同的表,则可以执行某些操作,例如使用“文件组”将数据库拆分为不同的HD。

If they are hitting the same tables, you probably have a blocking issue where parser A tries to read data to the same table parser B is writing. 如果它们命中相同的表,则可能是解析器A尝试将数据读取到解析器B正在写入的同一表时出现的阻塞问题。 I would recommend, JUST TO TEST and find out if this is really the problem, running your process with isolation level read uncommited. 我建议进行测试,找出这是否真的是问题,并以未提交的隔离级别运行您的进程。 If it runs fine, you'll know what the issue was. 如果运行正常,您将知道问题出在哪里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM