Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-10-17 Thread Hisashi T Fujinaka

Just to follow up on this, I was looking at the wrong log file and I was
certainly running out of file descriptors.

The default config from squid-3.3.9 also didn't have a cache_dir
statement which I was used to having. Not sure if this affected anything
but it was another issue.

On Tue, 17 Sep 2013, Brett Lymn wrote:



(sorry if this messes up the threading I just joined the list to respone
to this thread)

Firstly, I have been using squid on NetBSD for many years and it works
fine for me.  I am running squid 3.3.8 on a recent-ish NetBSD-current
without issue.  I wouldn't totally rule out a problem with squid and
NetBSD but there are many many things that can impact the performance of
squid which need to be looked at first.

As a general note, if you are going to post your squid.conf to a mailing
list, please do everyone a favour and do something like:

grep -v '^\(#\|[ ]*$\)' /usr/pkg/etc/squid/squid.conf

and post that output - this will strip the comments and blank lines
leaving a more readable summary of what you actually have in the
configuration file (BTW there is a tab and a space between the square
brackets above).

One thing that can help a lot in working out what is going on with squid
is to look in the cache.log file, sometimes slowness and cpu utilisation
can be caused by squid restarting which can happen if its child
processes (redirector, authenticators, external acl and so on) are
exiting, if these processes exit too often/quickly then squid will
restart.  Similarly, if too many requests waiting to be serviced by
the helpers then squid will restart.  You should see indications of
these restarts and the reasons why in the cache.log.

Another thing it may be is squid running out of file descriptors, again,
this will be mentioned in the cache.log, try adding:

ulimit -n 3000

near the top of /etc/rc.d/squid and restarting squid.  This probably
should be added to the sample start up script as squid has recently
stopped managing the limit itself and now expects a suitable file handle
limit.

Also, it may be unrealistic expectations - one common problem is that
people configure a large disk cache on a memory limited machine.  Squid
requires around 10 - 14MB or memory per GB of cache you specify simply
for managing the cache contents.. it will use more on top of that.  So,
for example, trying to configure squid with a 100GB cache will result in
squid needing more than 1 - 1.4GB of RAM.  If you try that on a machine
with only 2GB of memory then performance will be poor because the
machine will be paging to try and keep up with squid and everything else
as well.

HTH - if not, please look in the cache.log and post any errors you find,
they may provide some clues... also a stripped squid.conf can help.




--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte


Re: [Fwd: Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time]

2013-10-11 Thread S.P.Zeidler
Thus wrote Adrian Immanuel Kieß (adr...@kiess.at):

 No comment.

I've considered this a yes and have acted accordingly.

regards,
spz


Re: [Fwd: Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time]

2013-10-10 Thread Hauke Fath
On Wed, 09 Oct 2013 19:01:22 +0200, Adrian Immanuel Kieß wrote:
 No comment.

Publishing private mail... so, yes, you are a troll.

hauke

-- 
 The ASCII Ribbon CampaignHauke Fath
() No HTML/RTF in emailInstitut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
 Respect for open standards  Ruf +49-6151-16-3281


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-17 Thread Adrian Immanuel Kieß
I guess there are many trolls around here these days.

Gosh!

Adrian Immanuel KIESS


On Tue, 2013-09-17 at 21:10 +0930, Brett Lymn wrote:
 (sorry if this messes up the threading I just joined the list to respone
 to this thread)
 
 Firstly, I have been using squid on NetBSD for many years and it works
 fine for me.  I am running squid 3.3.8 on a recent-ish NetBSD-current
 without issue.  I wouldn't totally rule out a problem with squid and
 NetBSD but there are many many things that can impact the performance of
 squid which need to be looked at first.
 
 As a general note, if you are going to post your squid.conf to a mailing
 list, please do everyone a favour and do something like:
 
 grep -v '^\(#\|[   ]*$\)' /usr/pkg/etc/squid/squid.conf
 
 and post that output - this will strip the comments and blank lines
 leaving a more readable summary of what you actually have in the
 configuration file (BTW there is a tab and a space between the square
 brackets above).
 
 One thing that can help a lot in working out what is going on with squid
 is to look in the cache.log file, sometimes slowness and cpu utilisation
 can be caused by squid restarting which can happen if its child
 processes (redirector, authenticators, external acl and so on) are
 exiting, if these processes exit too often/quickly then squid will
 restart.  Similarly, if too many requests waiting to be serviced by
 the helpers then squid will restart.  You should see indications of
 these restarts and the reasons why in the cache.log.
 
 Another thing it may be is squid running out of file descriptors, again,
 this will be mentioned in the cache.log, try adding:
 
 ulimit -n 3000
 
 near the top of /etc/rc.d/squid and restarting squid.  This probably
 should be added to the sample start up script as squid has recently
 stopped managing the limit itself and now expects a suitable file handle
 limit.
 
 Also, it may be unrealistic expectations - one common problem is that
 people configure a large disk cache on a memory limited machine.  Squid
 requires around 10 - 14MB or memory per GB of cache you specify simply
 for managing the cache contents.. it will use more on top of that.  So,
 for example, trying to configure squid with a 100GB cache will result in
 squid needing more than 1 - 1.4GB of RAM.  If you try that on a machine
 with only 2GB of memory then performance will be poor because the
 machine will be paging to try and keep up with squid and everything else
 as well.
 
 HTH - if not, please look in the cache.log and post any errors you find,
 they may provide some clues... also a stripped squid.conf can help.
  

-- 
With greetings from Leipzig, Germany.
Adrian Immanuel Kieß 

Administrator  programmer
Unix / Perl / LaTeX

mail: adrian (at) kiess.at
www: http://www.kiess.at


signature.asc
Description: This is a digitally signed message part


[Fwd: Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time]

2013-09-17 Thread Adrian Immanuel Kieß
Have to dispense here. :-D

-- 
With greetings from Leipzig, Germany.
Adrian Immanuel Kieß 

Administrator  programmer
Unix / Perl / LaTeX

mail: adrian (at) kiess.at
www: http://www.kiess.at
---BeginMessage---
On Tue, Sep 17, 2013 at 02:43:43PM +0200, Adrian Immanuel Kie? wrote:
 I guess there are many trolls around here these days.
 

oh, ok - sorry for feeding you then.

-- 
Brett Lymn
Staple Guns: because duct tape doesn't make that KerCHUNK sound - xkcd.com
---End Message---


signature.asc
Description: This is a digitally signed message part


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-15 Thread matthew sporleder
ktrace is a command, look it up.

also testing dns time was a very good suggestion, as well.


On Sun, Sep 15, 2013 at 7:12 AM, Adrian Immanuel Kieß adr...@kiess.atwrote:

 Dear List, Metthew and Matthias,

 I don't know how to trace a application within NetBSD -- and yes it must
 be cache related. After migrating, if I remeber right, I even tried to
 rebuild the cache by hand to check if everything is OK.

 I guess it loops around somewhere with wrong OPENDEV command for the
 network interface. My second guess it is busy scanning the HTML file or
 something. I just can guess. :-)

 I even added max_filedescriptors 4096 in squid.conf because I've
 stumbled across something with the open file limit in NetBSD already.
 ^_^

 As I already noted it worked under Debian.

 But under NetBSD 6.1 I now have the high CPU usage.

 I attached my squid.conf file.

 Adrian Immanuel KIESS

 On Sat, 2013-09-14 at 14:24 -0400, matthew sporleder wrote:
 
  On Thu, Sep 12, 2013 at 11:22 PM, Adrian Immanuel Kieß
  adr...@kiess.at wrote:
  Dear list,
 
  since several months and upgrades I encountered the problem
  that squid
  uses too much CPU time under NetBSD 6.1 and my proxy server is
  nearly to
  unusable now.
 
  I installed the default squid from /usr/pkgsrc/www/squid using
  pkgsrc-2013-Q2. Every HTTP webpage request lets squid meditate
  for
  several seconds until the page is served. The network download
  itself
  seems comparatively fast.
 
  Maybe someone seen this behavior of squid too and give me a
  hint? I
  moved my squid installation from GNU/Debian to this NetBSD box
  and I
  remember -- there I did not have this problem with nearly the
  same
  configuration.
 
  Thank you very much!
 
  Sincerely,
 
  Adrian Immanuel KIESS
 
  --
  With greetings from Leipzig, Germany.
  Adrian Immanuel Kieß
 
  Administrator  programmer
  Unix / Perl / LaTeX
 
  mail: adrian (at) kiess.at
  www: http://www.kiess.at
 
 
 
  Have you tried ktrace-ing squid to see what it's doing during these
  pauses?
 
  It sounds like it's probably scanning/writing the cache?
 

 --
 With greetings from Leipzig, Germany.
 Adrian Immanuel Kieß

 Administrator  programmer
 Unix / Perl / LaTeX

 mail: adrian (at) kiess.at
 www: http://www.kiess.at



Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-15 Thread Matthias Scheler
On Sun, Sep 15, 2013 at 01:39:33PM +0200, Adrian Immanuel Kieß wrote:
 I thank you for your suggestions but testing the DNS time is nonsense
 because my DNS server runs on another boxen and the IPNAT configuration
 on this NetBSD boxen works very fine because without the squid proxy I
 can connect very much faster to the outer world.

You are making the assumption here that the behaviour you observe in
a browser allows conclusion to Squid's behaviour.

So please humour me and run those two commands. It will only take
a few seconds.

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-15 Thread Matthias Scheler
On Sun, Sep 15, 2013 at 08:44:42AM -0700, Hisashi T Fujinaka wrote:
 On Sun, 15 Sep 2013, Matthias Scheler wrote:
 
 On Sun, Sep 15, 2013 at 01:39:33PM +0200, Adrian Immanuel Kie? wrote:
 I thank you for your suggestions but testing the DNS time is nonsense
 because my DNS server runs on another boxen and the IPNAT configuration
 on this NetBSD boxen works very fine because without the squid proxy I
 can connect very much faster to the outer world.
 
 You are making the assumption here that the behaviour you observe in
 a browser allows conclusion to Squid's behaviour.
 
 So please humour me and run those two commands. It will only take
 a few seconds.
 
 There does appear to be something that uses a lot of CPU in squid. I've
 just been restarting it several times a day.

Okay.

 ktrace and what was the other command you wanted him to run? I'll look
 into this as well.

My commands were related to the big delays in page loads. If you don't
experience those it is not related.

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-15 Thread Hisashi T Fujinaka

On Sun, 15 Sep 2013, Matthias Scheler wrote:


On Sun, Sep 15, 2013 at 08:44:42AM -0700, Hisashi T Fujinaka wrote:

On Sun, 15 Sep 2013, Matthias Scheler wrote:


On Sun, Sep 15, 2013 at 01:39:33PM +0200, Adrian Immanuel Kie? wrote:

I thank you for your suggestions but testing the DNS time is nonsense
because my DNS server runs on another boxen and the IPNAT configuration
on this NetBSD boxen works very fine because without the squid proxy I
can connect very much faster to the outer world.


You are making the assumption here that the behaviour you observe in
a browser allows conclusion to Squid's behaviour.

So please humour me and run those two commands. It will only take
a few seconds.


There does appear to be something that uses a lot of CPU in squid. I've
just been restarting it several times a day.


Okay.


ktrace and what was the other command you wanted him to run? I'll look
into this as well.


My commands were related to the big delays in page loads. If you don't
experience those it is not related.


I usually see the delays, and then check to see if I'm using 100% CPU
(which I am). I'm guessing it's some weird spin lock, but I haven't
looked into it yet. I probably have time today.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-14 Thread matthew sporleder
On Thu, Sep 12, 2013 at 11:22 PM, Adrian Immanuel Kieß adr...@kiess.atwrote:

 Dear list,

 since several months and upgrades I encountered the problem that squid
 uses too much CPU time under NetBSD 6.1 and my proxy server is nearly to
 unusable now.

 I installed the default squid from /usr/pkgsrc/www/squid using
 pkgsrc-2013-Q2. Every HTTP webpage request lets squid meditate for
 several seconds until the page is served. The network download itself
 seems comparatively fast.

 Maybe someone seen this behavior of squid too and give me a hint? I
 moved my squid installation from GNU/Debian to this NetBSD box and I
 remember -- there I did not have this problem with nearly the same
 configuration.

 Thank you very much!

 Sincerely,

 Adrian Immanuel KIESS

 --
 With greetings from Leipzig, Germany.
 Adrian Immanuel Kieß

 Administrator  programmer
 Unix / Perl / LaTeX

 mail: adrian (at) kiess.at
 www: http://www.kiess.at



Have you tried ktrace-ing squid to see what it's doing during these pauses?

It sounds like it's probably scanning/writing the cache?


Re: netbsd-6.1: squid from pkgsrc-2013-Q2 uses too much CPU time

2013-09-14 Thread Matthias Scheler
On Fri, Sep 13, 2013 at 05:22:47AM +0200, Adrian Immanuel Kieß wrote:
 I installed the default squid from /usr/pkgsrc/www/squid using
 pkgsrc-2013-Q2. Every HTTP webpage request lets squid meditate for
 several seconds until the page is served. The network download itself
 seems comparatively fast.

Can you please run the following two commands and tell us the output?

time host -t  www.google.com.
time host -t a www.google.com.

Thanks in advance

-- 
Matthias Scheler  http://zhadum.org.uk/