Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Winlogbeat] Compare performance of event rendering without using XML #6585

Closed
andrewkroh opened this issue Mar 16, 2018 · 2 comments · Fixed by #16849
Closed

[Winlogbeat] Compare performance of event rendering without using XML #6585

andrewkroh opened this issue Mar 16, 2018 · 2 comments · Fixed by #16849

Comments

@andrewkroh
Copy link
Member

andrewkroh commented Mar 16, 2018

We should so a comparison test between the current implementation that receives events as XML from Windows versus a prototype implementation that receives events in a binary format. The goal is to see what the performance difference is. We can use our benchmark tests for perform the measurements (here's this last run we did of these tests).

Additionally we should check if the Windows API is thread-safe such that multiple threads can be reading batches of events concurrently.

Details

When Winlogbeat calls EvtRender it passes the EvtRenderEventXml flag. In this test we want to utilize the EvtRenderEventValues flag. Then Winlogbeat will receive a buffer containing an array of EVT_VARIANT objects that it needs to extract the event parameters from.

@JPvRiel
Copy link

JPvRiel commented Apr 5, 2019

Additionally we should check if the Windows API is thread-safe such that multiple threads can be reading batches of events concurrently.

This post looks helpful/relevant: https://stackoverflow.com/a/53439276/5472444

Note:

This gives a decent speedup of a factor 4. I needed to use some tricks to get faster because for some strange reason the class ProviderMetadataCachedInformation is not thread safe and uses internally a lock(this) around the Format method which defeats paralell reading. The key trick is to open the event log in the conversion threads again and then read a bunch of events of the query there via the event bookmark Api. That way you can format the strings independently.

@andrewkroh
Copy link
Member Author

Another thing I'd like to test/compare is using the ETW APIs to read from event logs (assuming that's possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants