From owner-freebsd-threads@FreeBSD.ORG Thu Apr 15 19:46:20 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 ED9F516A4CE for ; Thu, 15 Apr 2004 19:46:20 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66D1543D2F for ; Thu, 15 Apr 2004 19:46:20 -0700 (PDT) (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 i3G2kItf008382; Thu, 15 Apr 2004 22:46:19 -0400 (EDT) Date: Thu, 15 Apr 2004 22:46:18 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Ganbold In-Reply-To: <6.0.3.0.2.20040416111531.02b719e8@202.179.0.80> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Alexander Leidinger cc: kenm@icarz.com cc: threads@freebsd.org Subject: Re: FBSD 5.2.CURRENT-p4 and mysqld problems 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: Fri, 16 Apr 2004 02:46:21 -0000 On Fri, 16 Apr 2004, Ganbold wrote: > I compiled mysqld with default threading library in FreeBSD 5.2-CURRENT. > > ps axlHwww shows: > > backend2# ps axlHwww | grep mysql > 0 15417 1 0 8 0 1616 1088 wait SL p0 0:00.02 /bin/sh > /usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/mysql > --pid-file=/var/db/mysql/backend2.pid --log-slow-queries=slow.log > --log=general.log --log-update=update.log --default-character-set=latin1 > 88 15457 15417 0 20 0 450316 449244 kserel > SL p0 0:09.69 (mysqld) > 88 15457 15417 0 20 0 450316 449244 kserel [ ... ] > 88 15457 15417 0 20 0 450316 449244 kserel > SL p0 0:09.69 (mysqld) > 0 15546 778 0 -8 0 1412 820 piperd SL+ p0 0:00.00 grep mysql > 0 13232 796 0 4 0 3472 2664 sbwait SL+ p1 0:00.07 mysql -p > > And I don't see any difference when mapping between different threading > libraries libpthread, libc_r, libkse, libthr. Then you are not doing it correctly. You should only see references to kserel when using libpthread (nee libkse). Please read /usr/src/UPDATING 20040130 and see the -threads archives for related mysql discussions. Unless you rebuild all your ports on that system, you should always use a libmap.conf entry that maps libc_r to your desired thread library as well as mapping libpthread to your desired thread library. To use libpthread, use: libc_r.so.5 libpthread.so.1 libc_r.so libpthread.so To use libc_r, use: libc_r.so.5 libc_r.so.5 libc_r.so libc_r.so libpthread.so.1 libc_r.so.5 libpthread.so libc_r.so To use libthr, use: libc_r.so.5 libthr.so.1 libc_r.so libthr.so libpthread.so.1 libthr.so.1 libpthread.so libthr.so Also, mysql uses scope system threads. I have a patch that makes it use scope process threads and it behaves much better: http://people.freebsd.org/~deischen/mysql40-server.diffs Also, mysql doesn't seem to work correctly when built with --with-libwrap support. It has something to do with compiler flags; see the -threads archives for more info. Also, there are built-in default limits for threads under libpthread. See the output of `sysctl -a | grep kern.threads`. All of the above information can be found in the -threads archives; please use it :-) > > I tried switching all threading libraries in libmap.conf. However output of > the ps axlH command shows always the same and > I'm bit confused. If it worked as it supposed to mysqld with all threading > libs hangs after some time when I run some query. Probably because you are mixing threading libraries. -- Dan Eischen