{"id":4616,"date":"2026-12-01T14:11:38","date_gmt":"2026-12-01T19:11:38","guid":{"rendered":"https:\/\/increasec.com\/?p=4616"},"modified":"2026-12-01T14:20:57","modified_gmt":"2026-12-01T19:20:57","slug":"linux-kernal-logging-makes-system-slow","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=4616","title":{"rendered":"Linux Kernal Logging makes system slow"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Why<br>UFW loggs to the console, which is a bottleneck <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How to Fix It<br>To prevent this from happening, you need to decouple kernel logging from synchronous console printing.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Rate-Limit UFW\/IPTables Logging (Immediate Fix)If you must log packets, strictly limit how fast the kernel can write them.Modify your underlying iptables rules used by UFW to include a limit match:bash-A UFW-BLOCK -m limit &#8211;limit 3\/min &#8211;limit-burst 10 -j LOG &#8211;log-prefix &#8220;[UFW BLOCK] &#8220;<br>Use code with caution.<\/li>\n\n\n\n<li>Disable Console Logging for Packet DropsAvoid printing noisy packet logs to the physical or graphical console (\/dev\/console). They should only go to system logs (like journald or \/var\/log\/kern.log).Lower your console log level so informational packet logs don&#8217;t hit the screen:bashsysctl -w kernel.printk=&#8221;3 4 1 3&#8243;<br>Use code with caution.(This keeps critical errors on the console but filters out standard informational\/warning logs).<\/li>\n\n\n\n<li>Enable Asynchronous printk (Kernel-Level Fix)Modern Linux kernels offer a way to offload printk writing to a dedicated background kernel thread, preventing the CPU handling the event from locking up.Pass printk.synchronous=0 as a kernel boot parameter (on supported kernels), or ensure CONFIG_PRINTK_INDEX and asynchronous printk features are enabled in your kernel configuration.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Running sysctl -w kernel.printk=&#8221;3 4 1 3&#8243; does not require a restart.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How to make it permanent<br>echo &#8220;kernel.printk = 3 4 1 3&#8221; | sudo tee \/etc\/sysctl.d\/10-console-messages.conf<br>sudo sysctl -p \/etc\/sysctl.d\/10-console-messages.conf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WhyUFW loggs to the console, which is a bottleneck How to Fix ItTo prevent this from happening, you need to decouple kernel logging from synchronous console printing. Running sysctl -w&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10,245],"class_list":["post-4616","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-linux","tag-performance"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/4616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4616"}],"version-history":[{"count":4,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/4616\/revisions"}],"predecessor-version":[{"id":4620,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/4616\/revisions\/4620"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}