<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hey Alex, <br />
<br />
Thank you for your reply.<br /></div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 5px; padding-left: 10px; border-left-width: thin; border-left-style: solid;">Your syslog or cache.log might<br />
contain more info. Analyzing the timing/schedule of these problems may<br />
also be helpful in identifying the trigger.</blockquote>
<div dir="auto"><br />
After following this advice, I could easily see that this happens due to disk space running out on my server,<br />
it seems that the logs has filled over 100GB of log data, since I made a configuration mistake (I think?) by setting this:</div>
<blockquote style="border: none; margin: 0px 0px 0px 25px; padding: 0px;">
<div style="indent-level: 1">logfile_rotate 0</div>
<div style="indent-level: 1"><br /></div>
</blockquote>
<div dir="auto">If I remember and read correctly, this means that the rotation of the files is disabled and they will just keeping increasing<br />
in size if left unchecked.<br />
<br />
I have now gone ahead and changed all the configuration file to this setting:</div>
<blockquote style="border: none; margin: 0px 0px 0px 25px; padding: 0px;">
<div style="indent-level: 1">logfile_rotate 1</div>
<div style="indent-level: 1"><br /></div>
</blockquote>
<div dir="auto">So now it should rotate once daily, and on the next rotation it should be deleted, and this is all handled by logrotate on Debian-based machines?<br />
<br />
This is my / cat /etc/logrotate.d/squid:<br />
➜ / cat /etc/logrotate.d/squid <br />
#<br />
# Logrotate fragment for squid.<br />
#<br />
/var/log/squid/*.log {<br />
daily<br />
compress<br />
delaycompress<br />
rotate 2<br />
missingok<br />
nocreate<br />
sharedscripts<br />
prerotate<br />
test ! -x /usr/sbin/sarg-reports || /usr/sbin/sarg-reports daily<br />
endscript<br />
postrotate<br />
test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate<br />
endscript<br />
}<br />
<br />
Is there a way for me to set it so it just get deleted every 24 or 12 hours without the archive first?<br />
<br />
Thanks,<br />
Roee</div>
</div>
<div name="messageReplySection">On 6 Sep 2022, 16:28 +0300, Alex Rousskov <rousskov@measurement-factory.com>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">On 9/6/22 07:41, roee klinger wrote:<br />
<br />
<blockquote type="cite">It is also important to know that I am running multiple Squid instances<br />
on the same machine, they are all getting the error at the same time<br /></blockquote>
<br />
What external event(s) happen at that time? Something is probably<br />
sending a signal to the logging daemon process. It would be good to know<br />
what that something (and that signal) is. Your syslog or cache.log might<br />
contain more info. Analyzing the timing/schedule of these problems may<br />
also be helpful in identifying the trigger.<br />
<br />
<br />
<blockquote type="cite">Is a possible workaround that might be just replacing the line with<br />
this?<br /></blockquote>
<br />
<blockquote type="cite">access_log /var/log/squid/access2.log<br /></blockquote>
<br />
As you know, this configuration (in this deprecated spelling or with and<br />
explicit "stdio:" prefix) will result in Squid workers writing to the<br />
log file directly instead of asking the logging daemon. This will,<br />
naturally, get rid of the pipe between workers and their daemons, and<br />
the associated broken pipe error.<br />
<br />
<blockquote type="cite">or will this cause a problem?<br /></blockquote>
<br />
Impossible to say for sure without knowing whether your workers benefit<br />
from the anticipated performance advantages of avoiding blocking file<br />
I/O _and_ whether those advantages are real (in your environment). Too<br />
many variables and too many unknowns. I would treat this as an important<br />
(and potentially disruptive) configuration change and carefully test the<br />
outcome.<br />
<br />
<br />
HTH,<br />
<br />
Alex.<br />
<br />
<br />
<blockquote type="cite">INFO -<br />
Versions:<br />
<br />
Squid Cache: Version 4.10<br />
Ubuntu 20.04.4 LTS<br />
<br />
<br />
Example squid.conf:<br />
<br />
visible_hostname squid2<br />
<br />
access_log daemon:/var/log/squid/access2.log squid<br />
<br />
cache_log /var/log/squid/cache2.log<br />
<br />
pid_filename /var/run/squid2.pid<br />
<br />
<br />
acl localnet src 0.0.0.1-0.255.255.255# RFC 1122 "this" network (LAN)<br />
<br />
acl localnet src 10.0.0.0/8 <http://10.0.0.0/8> # RFC 1918 local<br />
private network (LAN)<br />
<br />
acl localnet src 100.64.0.0/10 <http://100.64.0.0/10># RFC 6598<br />
shared address space (CGN)<br />
<br />
acl localnet src 169.254.0.0/16 <http://169.254.0.0/16> # RFC 3927<br />
link-local (directly plugged) machines<br />
<br />
acl localnet src 172.16.0.0/12 <http://172.16.0.0/12># RFC 1918<br />
local private network (LAN)<br />
<br />
acl localnet src 192.168.0.0/16 <http://192.168.0.0/16> # RFC 1918<br />
local private network (LAN)<br />
<br />
acl localnet src fc00::/7 # RFC 4193 local private network range<br />
<br />
acl localnet src fe80::/10# RFC 4291 link-local (directly plugged)<br />
machines<br />
<br />
acl SSL_ports port 443<br />
<br />
acl Safe_ports port 80# http<br />
<br />
acl Safe_ports port 21# ftp<br />
<br />
acl Safe_ports port 443 # https<br />
<br />
acl Safe_ports port 70# gopher<br />
<br />
acl Safe_ports port 210 # wais<br />
<br />
acl Safe_ports port 1025-65535# unregistered ports<br />
<br />
acl Safe_ports port 280 # http-mgmt<br />
<br />
acl Safe_ports port 488 # gss-http<br />
<br />
acl Safe_ports port 591 # filemaker<br />
<br />
acl Safe_ports port 777 # multiling http<br />
<br />
acl CONNECT method CONNECT<br />
<br />
http_access deny !Safe_ports<br />
<br />
http_access deny CONNECT !SSL_ports<br />
<br />
http_access allow localhost manager<br />
<br />
http_access deny manager<br />
<br />
# include /etc/squid/conf.d/*<br />
<br />
http_access allow localhost<br />
<br />
acl aws src *censored*<br />
<br />
http_access allow aws<br />
<br />
# http_access deny all<br />
<br />
tcp_outgoing_address *censored*<br />
<br />
http_port 10002<br />
<br />
coredump_dir /var/spool/squid<br />
<br />
refresh_pattern ^ftp: 144020% 10080<br />
<br />
refresh_pattern ^gopher:14400%1440<br />
<br />
refresh_pattern -i (/cgi-bin/|\?) 0 0%0<br />
<br />
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0<br />
refresh-ims<br />
<br />
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims<br />
<br />
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims<br />
<br />
refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims<br />
<br />
refresh_pattern . 0 20% 4320<br />
<br />
<br />
shutdown_lifetime 1 seconds<br />
<br />
logfile_rotate 0<br />
<br />
max_filedescriptors 16384<br />
<br />
dns_nameservers 8.8.8.8 8.8.4.4 1.1.1.1<br />
<br />
cache deny all<br />
<br />
cache_dir null /tmp<br />
<br />
via off<br />
<br />
forwarded_for off<br />
<br />
request_header_access From deny all<br />
<br />
request_header_access Server deny all<br />
<br />
request_header_access WWW-Authenticate deny all<br />
<br />
request_header_access Link deny all<br />
<br />
request_header_access Cache-Control deny all<br />
<br />
request_header_access Proxy-Connection deny all<br />
<br />
request_header_access X-Cache deny all<br />
<br />
request_header_access X-Cache-Lookup deny all<br />
<br />
request_header_access Via deny all<br />
<br />
request_header_access X-Forwarded-For deny all<br />
<br />
request_header_access Pragma deny all<br />
<br />
request_header_access Keep-Alive deny all<br />
<br />
dns_v4_first on<br />
<br />
<br />
Example service file:<br />
<br />
## Copyright (C) 1996-2020 The Squid Software Foundation and<br />
contributors<br />
<br />
##<br />
<br />
## Squid software is distributed under GPLv2+ license and includes<br />
<br />
## contributions from numerous individuals and organizations.<br />
<br />
## Please see the COPYING and CONTRIBUTORS files for details.<br />
<br />
##<br />
<br />
<br />
[Unit]<br />
<br />
Description=Squid Web Proxy Server<br />
<br />
Documentation=man:squid(8)<br />
<br />
After=network.target network-online.target nss-lookup.target<br />
<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
PIDFile=/var/run/squid2.pid<br />
<br />
ExecStartPre=/usr/sbin/squid --foreground -z -f /etc/squid/squid2.conf<br />
<br />
ExecStart=/usr/sbin/squid -sYC -f /etc/squid/squid2.conf<br />
<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
<br />
KillMode=mixed<br />
<br />
<br />
[Install]<br />
<br />
WantedBy=multi-user.target<br />
<br />
<br />
<br />
Permissions:<br />
<br />
➜ ls -alt /etc/squid/<br />
total 128<br />
drwxr-xr-x 2 root root 4096 Sep 6 11:33 .<br />
-rw-r--r-- 1 root root 2831 Sep 6 11:33 squid7.conf<br />
drwxr-xr-x 116 root root 4096 Sep 6 11:33 ..<br />
-rw-r--r-- 1 root root 2830 Sep 6 11:33 squid2.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:33 squid13.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:32 squid23.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:32 squid19.conf<br />
-rw-r--r-- 1 root root 2832 Sep 6 11:32 squid1.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:32 squid17.conf<br />
-rw-r--r-- 1 root root 2832 Sep 6 11:31 squid4.conf<br />
-rw-r--r-- 1 root root 2834 Sep 6 11:31 squid21.conf<br />
-rw-r--r-- 1 root root 2833 Sep 6 11:31 squid25.conf<br />
-rw-r--r-- 1 root root 2834 Sep 6 11:31 squid12.conf<br />
-rw-r--r-- 1 root root 2832 Sep 6 11:31 squid3.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:30 squid10.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:30 squid11.conf<br />
-rw-r--r-- 1 root root 2833 Sep 6 11:30 squid18.conf<br />
-rw-r--r-- 1 root root 2830 Sep 6 11:30 squid8.conf<br />
-rw-r--r-- 1 root root 2830 Sep 6 11:30 squid6.conf<br />
-rw-r--r-- 1 root root 2833 Sep 6 11:30 squid28.conf<br />
-rw-r--r-- 1 root root 2830 Sep 6 11:25 squid9.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:25 squid24.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:25 squid22.conf<br />
-rw-r--r-- 1 root root 2837 Sep 6 11:25 squid20.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:25 squid16.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:25 squid15.conf<br />
-rw-r--r-- 1 root root 2836 Sep 6 11:25 squid14.conf<br />
-rw-r--r-- 1 root root 2831 Sep 6 11:25 squid5.conf<br />
-rw-r--r-- 1 root root 2833 Sep 6 11:25 squid27.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:25 squid26.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:25 squid30.conf<br />
-rw-r--r-- 1 root root 2835 Sep 6 11:25 squid29.conf<br />
<br />
<br />
_______________________________________________<br />
squid-users mailing list<br />
squid-users@lists.squid-cache.org<br />
http://lists.squid-cache.org/listinfo/squid-users<br /></blockquote>
<br />
_______________________________________________<br />
squid-users mailing list<br />
squid-users@lists.squid-cache.org<br />
http://lists.squid-cache.org/listinfo/squid-users<br /></blockquote>
</div>
</body>
</html>