Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have question to get clarified myself before a proposal.

We have a software which is already storing a data of elements in WMI (single file logging). When it is doing - observed the actual time for a transaction is about 28 Sec. I would like to increase the speed ..ideal time is 15 secs for a complete transaction. If I introduce Sqlite logging, will it be better ? I will do roll over the size check like 100 MB before log.

Will sqlite gives performance improvement than WMI ?

Regards,
Subbu.
Posted
Updated 3-Nov-13 7:27am
v2

1 solution

WMI for logging? Worst idea I ever heard. If WMI is what it means to me in Windows environment, Windows Management Instrumentation[^], than it is not meant for logging whatsoever kind. I am pretty sure sqlite is much better option.
If logging is event logging and not data acquisition (like SCADA historical data), than I suggest you use a logging library like NLog[^], which has several event writes like text file, but you can also log to SQLite (see: http://softwarelounge.co.uk/archives/1611[^]).
SQLite is really powerful for both targets, and you can fine-tune it to meet your overall requirements.
 
Share this answer
 
Comments
thatraja 4-Nov-13 2:19am    
Right, 5!
I use NLog.
SKOTAJI 5-Nov-13 0:41am    
Hi,

I want to mention one thing here is - this logs main object is to store a metric information to collect for a period of 365 days of 365 records. So, NLog is mainly suitable for logging Debug or Trance information. So I believe Sqlite gives good performance.

In my project there is an hardware interaction and those areas already logging the various metric informations in WMI. So, from .Net point of view this is not correct I believe and I am going opposite to Senior Management's aspect and not to store towards WMI.

I have observed for a transaction with WMI - its taken 33 sec. and without WMI it is 28 sec. As a design change to improve this I am proposing Sqlite Metrics logging. Hope this works. I did POC on this - its take for a record to enter is 8 m.sec. for a transaction complete is 30 sec. Some improvement is there. Metrics object will have an employee record type of 6 fields at max.

Hope this works good. Suggest me.
Zoltán Zörgő 5-Nov-13 3:29am    
WMI is an interface collection towards object that mainly work as "server" objects, as data sources. Thus hardware drivers and other performance counter data sources are well positioned in this concept. But only as event sources not as event consumers. WMI architecture itself is really complex, not for time-critical applications. Those 5 seconds are really much, 28-33 seconds even more - it looks like a huge a design flaw, even is your boss thinks that it is a good approach. Still, it is your decision what you propose to him. I would rather move all logging to SQLite from WMI.
NLog itself is indeed not needed in your case (based on your clarification).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900