From owner-freebsd-questions@FreeBSD.ORG Tue May 5 21:04:32 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45B37106566B for ; Tue, 5 May 2009 21:04:32 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 107328FC0A for ; Tue, 5 May 2009 21:04:31 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 547557E837; Tue, 5 May 2009 13:04:30 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Tue, 5 May 2009 23:04:27 +0200 User-Agent: KMail/1.11.2 (FreeBSD/8.0-CURRENT; KDE/4.2.2; i386; ; ) References: <2cd0a0da0904280122x5416837re97255dc37283dc5@mail.gmail.com> <2cd0a0da0904301202n1edaea1du5bba7e8b34266d70@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905052304.28141.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: VeeJay Subject: Re: Where am I wasting resources? How to fix this problem? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2009 21:04:32 -0000 On Thursday 30 April 2009 21:49:13 Chuck Swiger wrote: > Hi, VeeJay-- > > On Apr 30, 2009, at 12:02 PM, VeeJay wrote: > > Guys, I am not very good on freebsd, its you guys who help me to > > keeping my > > server up... I hope you can spare a few minutes to sort this > > problem... > > > > last pid: 19656; load averages: 1.00, 1.00, > > 1.00 > > up 2+05:00:12 19:18:47 > > 3049 processes:2 running, 3047 sleeping > > CPU: 12.5% user, 0.0% nice, 0.1% system, 0.0% interrupt, 87.4% idle > > Mem: 6253M Active, 3810M Inact, 921M Wired, 128K Cache, 214M Buf, > > 4683M Free > > Swap: 32G Total, 32G Free > > > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > > COMMAND > > 830 mysql 1500 44 0 1670M 813M ucond 1 0:00 100.00% > > mysqld > > It sure looks like you're running into a system limit with the maximum > # of threads available to the mysql process. There's no such limit, see pthread_create(3) and pthread.h: #define PTHREAD_THREADS_MAX __ULONG_MAX but the 1500 is suspicious. Suspicious enough to be a MySQL configuration value or compile time option. The only way to get to the bottom of it, is to watch the number of threads in the mysql process and attach ktrace to it the moment it approaches 1500, to see if pthread_create actually does return EAGAIN and get a hint as to where. My suspicion however is that the thread abstraction of MySQL sets EAGAIN. A my.cnf certainly would help. -- Mel