Squid can buffer logs !!!
-
Hey everyone,
If you are running the Squid package on pfSense and looking to reduce disk I/O—especially on systems running on flash storage, eMMC, or traditional HDDs—you might find this quick advanced configuration tweak useful.By default, Squid writes log lines to the disk immediately. Under heavy web traffic, this constant stream of write operations can cause noticeable disk I/O bottlenecks and accelerate storage wear.
To help mitigate this, you can enable buffered logging. This instructs Squid to buffer log writes in memory and write them in larger chunks, significantly reducing disk write frequency.How to apply this tweak:
- Navigate to Services > Squid Proxy Server > General tab.
- Scroll down to the bottom of the page and expand the Advanced Features section.
- In the Custom Options (Before Auth) or Custom Options (After Auth) text box, paste the following lines:
squid
# --- Advanced I/O and Download Buffer Adjustments --- buffered_logs on- Click Save at the bottom of the page to apply the changes and restart the Squid service.
Things to keep in mind:
Log Delay: Because logs are buffered in memory before being written, you will notice a slight delay before new traffic entries appear in your log viewer or access.log file.
Crash Risk: In the event of a sudden power failure or system crash, any log entries currently sitting in the volatile memory buffer that haven't been flushed to disk yet will be lost.
If you are trying to squeeze a bit more performance out of an older box or trying to save your SSD/eMMC from unnecessary wear, give this a shot and let me know if it helps your disk metrics! -
@JonathanLee said:
Hey everyone,
If you are running the Squid package on pfSense and looking to reduce disk I/O—especially on systems running on flash storage, eMMC, or traditional HDDs—you might find this quick advanced configuration tweak useful.By default, Squid writes log lines to the disk immediately. Under heavy web traffic, this constant stream of write operations can cause noticeable disk I/O bottlenecks and accelerate storage wear.
To help mitigate this, you can enable buffered logging. This instructs Squid to buffer log writes in memory and write them in larger chunks, significantly reducing disk write frequency.How to apply this tweak:
Navigate to Services > Squid Proxy Server > General tab.
Scroll down to the bottom of the page and expand the Advanced Features section.
In the Custom Options (Before Auth) or Custom Options (After Auth) text box, paste the following lines:
squid--- Advanced I/O and Download Buffer Adjustments ---
buffered_logs on
Click Save at the bottom of the page to apply the changes and restart the Squid service.
Things to keep in mind:
Log Delay: Because logs are buffered in memory before being written, you will notice a slight delay before new traffic entries appear in your log viewer or access.log file.
Crash Risk: In the event of a sudden power failure or system crash, any log entries currently sitting in the volatile memory buffer that haven't been flushed to disk yet will be lost.
If you are trying to squeeze a bit more performance out of an older box or trying to save your SSD/eMMC from unnecessary wear, give this a shot and let me know if it helps your disk metrics!Buffered logs are nice until you're chasing a fresh access entry and it's still sitting in RAM. For low-write boxes the tradeoff sounds pretty reasonable though.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy