Jump to content

Recommended Posts

Posted

@dasari4kntr @ramudu @konebhar @Suhaas

Mee analysis/suggestions on this please. 
Oka .net api developed on .net core 2 lo nlog was used for logging. So anyplace there was a need for logging kinda snippet lo laga program chesaru and all was good. 
the api framework has been updated to .net core 6 few months back and users noticed slowness recently in the past week.  
debug chesi chusthe log manager.flush() was taking 15 seconds. 
 

1. Is flushing the logs every time a bad idea?

2. Why did it work fine earlier?

3. Now the flush has been removed and added log manager.shutdown to the main method. 

try
{
    // execute statement

log info
}
catch (Exception e)
{
    // handle execeptions

log error
}
finally
{
    // always execute

logmanager.flush()
}

Posted

my quick guess….there must be a recursive exception which generates huge recurring log…

Posted

where you storing logs…? splunk..? check splunk logs…how huge those messages….

keep an eye on memory consumption…etc if you have datadog or similar setup

Posted
45 minutes ago, dasari4kntr said:

where you storing logs…? splunk..? check splunk logs…how huge those messages….

keep an eye on memory consumption…etc if you have datadog or similar setup

Splunk lo storing long and didn’t see any exceptions. Messages are just one liners. As soon as I removed the flush everything is back to normal. 
flush after every log entry bad aa ?

Posted

Not related to .net but flushing data out of the buffer after a new entry is made is going to cause performance degradation as disk io is expensive especially if there are multiple processes trying to access the disk at the same. That is the whole point of keep a data stream open which flushes to disk at specific intervals.I’m assuming that you have a file forwarder running on the server to push the files upstream to Splunk. In that case splunk is not going to show anything since the problem is between the application and disk io.You may want to check on disk io performance for any bottlenecks.

just my 2 cents 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...