FBSD 5.2.CURRENT-p4 and mysqld problems

Daniel Eischen eischen at vigrid.com
Thu Apr 15 19:46:21 PDT 2004


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



More information about the freebsd-threads mailing list