From owner-freebsd-threads@FreeBSD.ORG Tue Feb 17 19:45:18 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78FBD16A4CE for ; Tue, 17 Feb 2004 19:45:18 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37E5543D1D for ; Tue, 17 Feb 2004 19:45:18 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1I3jESQ001628; Tue, 17 Feb 2004 22:45:14 -0500 (EST) Date: Tue, 17 Feb 2004 22:45:14 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Kris Gale In-Reply-To: <49313.68.106.19.246.1077066168.squirrel@mail.asn.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: More on MySQL -- Fatal trap 12 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 03:45:18 -0000 On Tue, 17 Feb 2004, Kris Gale wrote: > >> What I seem to be seeing is a bogging down of MySQL > >> when new threads are being created in bursts. This > >> causes MySQL to temporarily become unresponsive, > >> and will sometimes crash the whole system. > > > > My first question is: > > "In what state are these threads waiting for work? > > are they in the kernel, or are they in userland? > > is there a single thread that listens on a socket and then hands the > > work to worker threads using some userland synchronisation, or do the > > threads enter the kernel and wait on the sockets themselves? > > (i.e. what does ps -H show?) " > > I'm not really sure how to answer this. During the startup > of my test script, when I'm seeing all of the connect errors, > "ps auxwH" shows a growing number of mysqld threads. > All but one have "SL" listed in the STAT column. The other > one has "RL" listed. > > > what happens if you have 1 process with X*Y threads? > > (just curious). > > No problems. 1800 threads run fine. The problem > seems to be with the child processes trying to initialize > connections simultaneously. I can also "solve" the > problem by putting a sleep in so the child processes > aren't forked at the same time. However, this is > not a workable real-world solution, since the application > I'm trying to simulate is a theoretical burst of connections > from a web cluster. I'm not sure what all the mumbo-jumbo is in your /etc/my.cnf, but commenting out this line: #set-variable = key_buffer=1024M let your perl script run with 90 children w/20 connections per. Everything seems to be running here, but I'm not sure what I'm looking for. Hmm, I also set: set-variable = thread_cache=1 set-variable = thread_concurrency=1 -- Dan Eischen