usauae Posted April 5, 2024 Report Posted April 5, 2024 @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() } Quote
dasari4kntr Posted April 5, 2024 Report Posted April 5, 2024 my quick guess….there must be a recursive exception which generates huge recurring log… Quote
dasari4kntr Posted April 5, 2024 Report Posted April 5, 2024 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 Quote
usauae Posted April 5, 2024 Author Report Posted April 5, 2024 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 ? Quote
dewarist Posted April 5, 2024 Report Posted April 5, 2024 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.