From owner-freebsd-ports Thu Apr 19 3:10:11 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 41E5C37B43E for ; Thu, 19 Apr 2001 03:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3JAA2c61232; Thu, 19 Apr 2001 03:10:02 -0700 (PDT) (envelope-from gnats) Received: from gate.qubesoft.com (gate.qubesoft.com [212.113.16.243]) by hub.freebsd.org (Postfix) with ESMTP id 22EA437B424 for ; Thu, 19 Apr 2001 03:02:16 -0700 (PDT) (envelope-from n_hibma@qubesoft.com) Received: from bluebottle.qubesoft.com (bluebottle [192.168.1.2]) by gate.qubesoft.com (8.11.3/8.11.3) with ESMTP id f3JA2Ek06531 for ; Thu, 19 Apr 2001 11:02:14 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Received: (from root@localhost) by bluebottle.qubesoft.com (8.11.1/8.11.3) id f3JA2ES59919; Thu, 19 Apr 2001 11:02:14 +0100 (BST) (envelope-from n_hibma) Message-Id: <200104191002.f3JA2ES59919@bluebottle.qubesoft.com> Date: Thu, 19 Apr 2001 11:02:14 +0100 (BST) From: n_hibma@qubesoft.com Reply-To: n_hibma@qubesoft.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/26700: [PATCH] icecast gobbling up 80% of the CPU Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 26700 >Category: ports >Synopsis: icecast gobbling up 80% of the CPU >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 19 03:10:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Nick Hibma >Release: FreeBSD 4.2-BETA i386 >Organization: Qube Software Ltd. >Environment: ports tree as of yesterday 2001/04/18. >Description: icecast uses 80% of the CPU without any encoders or clients connected. The problem is that it spins while waiting for incoming connections. The timout there is only 30 microseconds for select. Increasing this value to 30 seconds solves the problem with no adverse effects, bar the mt->ping not being set as often. But that should not be too big a problem. Other threads also set timeouts/sleeps for more then 5 seconds. >How-To-Repeat: >Fix: --- connection.c.orig Thu Apr 19 10:57:38 2001 +++ connection.c Thu Apr 19 10:57:32 2001 @@ -216,8 +216,8 @@ } maxport += 1; - tv.tv_sec = 0; - tv.tv_usec = 30; + tv.tv_sec = 30; + tv.tv_usec = 0; if (select(maxport, &rfds, NULL, NULL, &tv) > 0) { for (i = 0; i < MAXLISTEN; i++) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message