Latency Issues when Logging firewall

I'm using OpenWrt (25.12.6) on a Fortinet FortiGate 50E and have noticed some latency issues when enabling ANY logging. I originally thought this issue was my ISP, but when I started seeing latency spikes to my gateway, the OpenWrt router, I thought the issue might be my hardware.

I've narrowed it down to logging. If I enable any firewall zone to have logging enabled (including zones with no traffic) or any single firewall traffic rule to have logging enabled, I will see fairly regular latency spikes of 50ms - 150ms+ to the router which ultimately affects traffic to the internet. This shows up as significant jitter and latency on applications that want a constant low latency connection.

I'm guessing the answer isn't to turn off all logging, so I'm hoping there's something I can add or configure to get logging without the latency spikes.

Logging doesn't create these kind of latency problem in general.
Do you send the logs to any log server on the network?

At one point I was, but I have since removed that setting in LuCI (System > Logging > External system log server). It should only be using the in memory system log buffer. I removed it long before noticing these latency issues, so I don't believe it's related. The router has been restarted after removing that setting.

I've found a pretty easy way to replicate this:

  1. Turn on filter logging on any zone with some sort of reject/drop rule
    1. For example, a guest zone with forwarding only to wan
  2. On a device in that zone, try to ping a host that will get rejected
    1. For example, ping -i 0.2 host.in.lan.zone

In this senario, with logging enabled, only to the memory with a default size of 128KB, my router will slow to a crawl. Pings to the router from a device on my lan will climb to 5000+ms.

Obviously this is a worst case scenario, but it seems like the default logging options will start to affect the performance of this router with any slight burst of filtered traffic.

Maybe logging on this router is just particularly problematic?