From root@morzine.ciger.be  Mon Jul 29 08:31:58 2002
Return-Path: <root@morzine.ciger.be>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3312F37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jul 2002 08:31:58 -0700 (PDT)
Received: from morzine.ciger.be (morzine.ciger.be [193.74.104.226])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4430D43E42
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jul 2002 08:31:57 -0700 (PDT)
	(envelope-from root@morzine.ciger.be)
Received: from morzine.ciger.be (localhost.ciger.be [127.0.0.1])
	by morzine.ciger.be (8.12.5/8.12.5) with ESMTP id g6TFVt8g012597
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jul 2002 17:31:55 +0200 (CEST)
Received: (from root@localhost)
	by morzine.ciger.be (8.12.5/8.12.5/Submit) id g6TFVsbl012596;
	Mon, 29 Jul 2002 17:31:54 +0200 (CEST)
Message-Id: <200207291531.g6TFVsbl012596@morzine.ciger.be>
Date: Mon, 29 Jul 2002 17:31:54 +0200 (CEST)
From: Henri Hennebert <hlh@ciger.be>
Reply-To: Henri Hennebert <hlh@ciger.be>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: squid-2.4.STABLE7 loop on poll() - SMP kernel
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41125
>Category:       kern
>Synopsis:       squid-2.4.STABLE7 loop on poll() - SMP kernel
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    adrian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 29 08:40:01 PDT 2002
>Closed-Date:    Wed Jun 23 12:23:20 GMT 2004
>Last-Modified:  Wed Jun 23 12:23:20 GMT 2004
>Originator:     Henri Hennebert <hlh@ciger.be>
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
CIGER sa
>Environment:
System: FreeBSD morzine.ciger.be 4.6-STABLE FreeBSD 4.6-STABLE #0: Fri Jul 12 17:38:36 CEST 2002 root@morzine.ciger.be:/usr/obj/usr/src/sys/MORZINE i386

>Description:
I'm running squid 2.4.STABLE7 (configured and compiled 'by hand' - not from
ports) on a SMP configuration. All seems normal until squid start to loop
and use 100% of a CPU. After a while, all return to normal and top shows
squid in poll state. Then 100% again...

I truss squid several times for 4-5 secs when in 100% CPU and get
the following result:

--- snip ---
poll(0xbfbfc13c,0x4b,0x0)			 = 2 (0x2)
read(0x43,0x961f000,0xfff)			 = 0 (0x0)
read(0x71,0x96e1000,0xfff)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
poll(0xbfbfc13c,0x4b,0x0)			 = 2 (0x2)
read(0x43,0x961f000,0xfff)			 = 0 (0x0)
read(0x71,0x96e1000,0xfff)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
poll(0xbfbfc13c,0x4b,0x0)			 = 2 (0x2)
read(0x43,0x961f000,0xfff)			 = 0 (0x0)
read(0x71,0x96e1000,0xfff)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
poll(0xbfbfc13c,0x4b,0x0)			 = 2 (0x2)
read(0x43,0x961f000,0xfff)			 = 0 (0x0)
read(0x71,0x96e1000,0xfff)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
SIGNAL 27
SIGNAL 27
gettimeofday(0x8164efc,0x0)			 = 0 (0x0)
gettimeofday(0x281c282c,0x0)			 = 0 (0x0)
sigprocmask(0x3,0x281c28b8,0x0)			 = 0 (0x0)
sigaltstack(0x281de9e0,0x0)			 = 0 (0x0)
sigreturn(0x81f6064)				 = 0 (0x0)
poll(0xbfbfbf14,0x1,0x0)			 = 0 (0x0)
poll(0xbfbfc13c,0x4b,0x0)			 = 2 (0x2)
read(0x43,0x961f000,0xfff)			 = 0 (0x0)
read(0x71,0x96e1000,0xfff)			 = 0 (0x0)
--- snip ---

During the same 100% period, the other truss sampling show
poll call return 3, 4, 3, 2, ...

Squid is using 3 cache dirs with async io (aufs). I try
sync io (ufs) and disk daemon (diskd) to no avail.

It seems that it's not related to the squid load (average 120 req/min).
The 100% period is at least 4-5 minutes long.

I never encounter this situation when running squid on a mono-
processor config (at least since FreeBSD 3.2 and squid-2.2).

Is it a problem with SMP / poll() ?

>How-To-Repeat:
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->adrian 
Responsible-Changed-By: tom 
Responsible-Changed-When: Mon Aug 5 10:10:47 PDT 2002 
Responsible-Changed-Why:  
Over to squid Port MAINTAINER - this problem may not be due to Squid itself, 
but it seems like a good place to start 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41125 

From: "Henri Hennebert" <HLH@CIGER.BE>
To: <freebsd-gnats-submit@FreeBSD.org>,
	"Henri Hennebert" <HLH@CIGER.BE>
Cc:  
Subject: Re: kern/41125: squid-2.4.STABLE7 loop on poll() - SMP kernel
Date: Thu, 8 Aug 2002 10:38:54 +0200

 HOOPS - SORRY -
 
 I find somthing similar in the Squid Bugzilla (Bug #354).
 
 I turn half_closed_clients to off in squid.conf
 
 The problem seems to be solved - I'll post a follow-up
 Tomorrow.
 
 Sorry for the disturbance.
 
 Henri

From: "Henri Hennebert" <HLH@CIGER.BE>
To: <freebsd-gnats-submit@FreeBSD.org>, <adrian@FreeBSD.org>
Cc:  
Subject: Re: kern/41125: squid-2.4.STABLE7 loop on poll() - SMP kernel
Date: Fri, 9 Aug 2002 15:30:45 +0200

 Afer One day with parameter
 
 half_closed_clients off
 
 The problem has disappeared
 
 Henri

From: Adrian Chadd <adrian@freebsd.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/41125: squid-2.4.STABLE7 loop on poll() - SMP kernel
Date: Fri, 31 Jan 2003 16:52:23 +0800

 You shouldn't run aufs under freebsd _at all_ - unless there's been
 a big change lately wrt threading aufs will run on a single CPU.
 
 Please run diskd - at least the disk processes will be scheduleable
 on the other CPU. It'll handle load quite a lot better.
 
 Also, yes, turn half_closed_clients off - I believe we'll be attacking
 that in squid-3 but thats a way off being production-ready.
 
 
 
 
 Adrian
 

From: "Jon Noack" <noackjr@alumni.rice.edu>
To: freebsd-gnats-submit@FreeBSD.org, hlh@ciger.be
Cc:  
Subject: Re: kern/41125: squid-2.4.STABLE7 loop on poll() - SMP kernel
Date: Mon, 15 Sep 2003 17:38:04 -0500 (CDT)

 A fix was reported to have resolved the issue and there haven't been any
 further reports in over a year.  Please close...
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Wed Jun 23 12:22:58 GMT 2004 
State-Changed-Why:  
Fixed very long time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41125 
>Unformatted:
