public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Matthias Fischer <matthias.fischer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] BUG 11786 - squid: Remove setting for filter processes the number of Squid processes
Date: Tue, 30 Oct 2018 15:37:14 +0100	[thread overview]
Message-ID: <357c1cbd-36f5-e711-6cea-544ed00b5244@ipfire.org> (raw)
In-Reply-To: <f3054cf6d49ca8404eea960913d2617c5a9c6722.camel@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 5923 bytes --]

On 30.10.2018 15:03, Michael Tremer wrote:
> Hey,

Hello,

> do you have any idea why the redirector is busy?

Sorry: no. Long time ago, I searched for an optimal value but didn't
find any useful links. Right now, I'm testing 'squid 4.4" and its always
the same. Too few redirectors => warning.

I only found something like "If you see this warning, you should
increase the number of child processes and restart (or reconfigure)
Squid. If the queue size becomes twice the number of redirectors, Squid
aborts with a fatal message."

Taken from:
http://etutorials.org/Server+Administration/Squid.+The+definitive+guide/Chapter+11.+Redirectors/11.4+Configuring+Squid/

So my current "40"-value was found through "try and look if the warning
comes again"...

Best,
Matthias


> -Michael
> 
> On Tue, 2018-10-30 at 14:54 +0100, Matthias Fischer wrote:
>> Hi,
>> 
>> I tested this patch today and I fear the resulting value is too low.
>> 
>> For me, its leads to:
>> 
>> ***SNIP***
>> ...
>> 2018/10/30 14:42:43 kid1| WARNING: All 2/2 redirector processes are busy.
>> 2018/10/30 14:42:43 kid1| WARNING: 4 pending requests queued
>> 2018/10/30 14:42:43 kid1| WARNING: Consider increasing the number of
>> redirector processes in your config file.
>> ...
>> 
>> Current setting is "40" (Duo box, 2 Cores, 'squidclamav, squidguard)
>> 
>> Best,
>> Matthias
>> 
>> On 30.10.2018 12:06, Daniel Weismüller wrote:
>> > I added a function to determine the number of cores.
>> > Now the number of squid processes will be equal to the number of logical
>> > cores.
>> > Further I removed the possibility of changing the number
>> > of squid processes in the proxy.cgi
>> > 
>> > Signed-off-by: Daniel Weismüller <daniel.weismueller(a)ipfire.org>
>> > ---
>> >  config/cfgroot/general-functions.pl |  7 +++++++
>> >  html/cgi-bin/proxy.cgi              | 16 ++--------------
>> >  2 files changed, 9 insertions(+), 14 deletions(-)
>> > 
>> > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-
>> > functions.pl
>> > index 0577afe28..e8495e885 100644
>> > --- a/config/cfgroot/general-functions.pl
>> > +++ b/config/cfgroot/general-functions.pl
>> > @@ -1165,5 +1165,12 @@ sub dnssec_status() {
>> >  
>> >  	return $status;
>> >  }
>> > +sub number_cpu_cores() {
>> > +	open my $cpuinfo, "/proc/cpuinfo" or die "Can't open cpuinfo: $!\n";
>> > +	my $cores = scalar (map /^processor/, <$cpuinfo>);
>> > +	close $cpuinfo;
>> > +
>> > +	return $cores;
>> > +}
>> >  
>> >  1;
>> > diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi
>> > index 738425b9a..92bebfe18 100644
>> > --- a/html/cgi-bin/proxy.cgi
>> > +++ b/html/cgi-bin/proxy.cgi
>> > @@ -287,7 +287,6 @@ $proxysettings{'IDENT_USER_ACL'} = 'positive';
>> >  $proxysettings{'ENABLE_FILTER'} = 'off';
>> >  $proxysettings{'ENABLE_UPDXLRATOR'} = 'off';
>> >  $proxysettings{'ENABLE_CLAMAV'} = 'off';
>> > -$proxysettings{'CHILDREN'} = '10';
>> >  
>> >  $ncsa_buttontext = $Lang::tr{'advproxy NCSA create user'};
>> >  
>> > @@ -437,11 +436,6 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) ||
>> > ($proxysettings{'ACTION'}
>> >  		$errormessage = $Lang::tr{'invalid maximum incoming size'};
>> >  		goto ERROR;
>> >  	}
>> > -		if (!($proxysettings{'CHILDREN'} =~ /^\d+$/) ||
>> > ($proxysettings{'CHILDREN'} < 1))
>> > -	{
>> > -		$errormessage = $Lang::tr{'advproxy invalid num of children'};
>> > -		goto ERROR;
>> > -	}
>> >  	if ($proxysettings{'ENABLE_BROWSER_CHECK'} eq 'on')
>> >  	{
>> >  		$browser_regexp = '';
>> > @@ -1034,12 +1028,8 @@ print <<END
>> >  </table>
>> >  <hr size='1'>
>> >  <table width='100%'>
>> > -<tr><td class='base' colspan='4'><b>$Lang::tr{'advproxy redirector
>> > children'}</b></td></tr>
>> > -<tr><td class='base' >$Lang::tr{'processes'}:&nbsp;<img src='/blob.gif'
>> > alt='*' /><input type='text' name='CHILDREN'
>> > value='$proxysettings{'CHILDREN'}' size='5' /></td>
>> >  END
>> >  ;
>> > -my $count = `ip n| wc -l`;
>> > -if ( $count < 1 ){$count = 1;}
>> >  if ( -e "/usr/bin/squidclamav" ) {
>> >  	print "<td class='base'><b>".$Lang::tr{'advproxy squidclamav'}."</b><br
>> > />";
>> >  	if ( ! -e "/var/run/clamav/clamd.pid" ){
>> > @@ -1048,18 +1038,16 @@ if ( -e "/usr/bin/squidclamav" ) {
>> >  		}
>> >  	else {
>> >  		print $Lang::tr{'advproxy enabled'}."<input type='checkbox'
>> > name='ENABLE_CLAMAV' ".$checked{'ENABLE_CLAMAV'}{'on'}." /><br />";
>> > -		print "+ ".int(( $count**(1/3)) * 8);}
>> > +}
>> >  	print "</td>";
>> >  } else {
>> >  	print "<td></td>";
>> >  }
>> >  print "<td class='base'><a href='/cgi-
>> > bin/urlfilter.cgi'><b>".$Lang::tr{'advproxy url filter'}."</a></b><br />";
>> >  print $Lang::tr{'advproxy enabled'}."<input type='checkbox'
>> > name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'}." /><br />";
>> > -print "+ ".int(($count**(1/3)) * 6);
>> >  print "</td>";
>> >  print "<td class='base'><a href='/cgi-
>> > bin/updatexlrator.cgi'><b>".$Lang::tr{'advproxy update
>> > accelerator'}."</a></b><br />";
>> >  print $Lang::tr{'advproxy enabled'}."<input type='checkbox'
>> > name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'}." /><br />";
>> > -print "+ ".int(($count**(1/3)) * 5);
>> >  print "</td></tr>";
>> >  print <<END
>> >  </table>
>> > @@ -4095,7 +4083,7 @@ END
>> >  	if (($proxysettings{'ENABLE_FILTER'} eq 'on') ||
>> > ($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on') ||
>> > ($proxysettings{'ENABLE_CLAMAV'} eq 'on'))
>> >  	{
>> >  		print FILE "url_rewrite_program /usr/sbin/redirect_wrapper\n";
>> > -		print FILE "url_rewrite_children
>> > $proxysettings{'CHILDREN'}\n\n";
>> > +		print FILE "url_rewrite_children ",
>> > &General::number_cpu_cores(), "\n\n";
>> >  	}
>> >  
>> >  	# Include file with user defined settings.
>> > 
>> 
>> 
> 
> 


  reply	other threads:[~2018-10-30 14:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 11:06 Daniel Weismüller
2018-10-30 13:54 ` Matthias Fischer
2018-10-30 14:03   ` Michael Tremer
2018-10-30 14:37     ` Matthias Fischer [this message]
2018-10-30 16:05       ` Michael Tremer
2018-10-30 17:12         ` Matthias Fischer
2018-11-02 14:13           ` Daniel Weismüller
2018-11-02 17:07             ` Michael Tremer
2018-11-02 17:34               ` Matthias Fischer
2018-12-15 13:24         ` Matthias Fischer
2018-12-17 19:05           ` Matthias Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=357c1cbd-36f5-e711-6cea-544ed00b5244@ipfire.org \
    --to=matthias.fischer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox