EventLogReader 远程性能
我正在使用 EventLogReader 查询远程 2008 服务器的事件。在远程计算机上查询事件的性能非常糟糕(6/秒)。如果我使用只进 ManagementObjectSearch 通过 WMI 查询同一台计算机,性能会非常好(1000/秒)。我在 EventLogReader 上没有看到任何类似的选项(例如 ReturnImmediatly、Rewindable)来加快速度。我尝试关闭远程服务器上的防火墙以查看是否存在通信问题,但这并没有什么作用。
当使用 EventLogReader 从本地主机读取日志时,性能符合预期 - 只是通过网络时速度会变慢(但 WMI 不会遇到该问题)。
有什么方法可以提高 EventLogReader 在网络上的性能吗?
谢谢, 米奇
I am using the EventLogReader to query remote 2008 servers for events. The performance of querying the events on a remote machine is horrible (6/sec). If I query the same machine via WMI using a forward-only ManagementObjectSearch the performance is great (1000/sec). I don't see any similar options on the EventLogReader (e.g. ReturnImmediatly, Rewindable) to speed it up. I tried turning off the firewall on the remote server to see if there was possibly communication issues, but that didn't make a difference.
When using EventLogReader to read logs from the local host the performance is as expected -- it's only over the network that it slows down (but WMI doesn't experience the problem).
Any way to speed up the performance of EventLogReader over the network?
Thanks,
Mitch
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
做了一些测试(修改了 http://msdn.microsoft 的示例代码。 com/en-us/library/bb671200.aspx),通过我的实验,我发现性能下降来自于调用 EventRecord.FormatDescription()。
当我仅调用 EventRecord.ToXml() 时,我能够在 25 秒内以大约 170 个事件/秒的速度从 LAN 上的服务器远程拉取超过 4300 个事件。当我添加对 EventRecord.FormatDescription() 的调用时,读取所有 4300 多个事件的性能下降到几乎 1.5 分钟,每秒读取大约 52 个事件。
我很抱歉这可能不是您想要的答案,但我的建议是,如果您不需要调用 EventRecord.FormatDescription() ,它将大大提高性能。
Did a little testing (modified the sample code from http://msdn.microsoft.com/en-us/library/bb671200.aspx) and from my experimenting I found that the performance hit comes from calling EventRecord.FormatDescription().
When I only had a call to EventRecord.ToXml() I was able to pull remotely from a server on the LAN over 4300 events in 25 seconds at about 170 events/sec. When I added a call to EventRecord.FormatDescription() the performance dropped to almost 1.5 minutes to read all 4300+ events and about 52 events/sec.
I apologize this may not be the answer that you want but my advice would be if you don't need to call EventRecord.FormatDescription() it will increase performance quite a bit.