FBSD 5.2.CURRENT-p4 and mysqld problems
Ganbold
ganbold at micom.mng.net
Thu Apr 15 22:51:13 PDT 2004
Dan, Julian, Petri and Alexander,
Thank you for your great help. Before I was using kernel SCHED_ULE and
BUILD_STATIC option to build mysql.
I switched back to SCHED_4BSD and patched mysql with Dan's patch.
Mysql is dynamically linked and compiled with libpthread. Let us see what
will happen.
Below are outputs of ldd and ps:
backend2# ldd /usr/local/libexec/mysqld
/usr/local/libexec/mysqld:
libpthread.so.1 => /usr/lib/libpthread.so.1 (0x48357000)
libz.so.2 => /lib/libz.so.2 (0x4837a000)
libcrypt.so.2 => /lib/libcrypt.so.2 (0x48387000)
libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x4839f000)
libm.so.2 => /lib/libm.so.2 (0x48451000)
libc.so.5 => /lib/libc.so.5 (0x48469000)
backend2# ps axlHwww | grep mysql
88 764 672 1 4 0 451940 450128 sbwait
SL ?? 0:37.47 (mysqld)
88 764 672 0 20 0 451940 450128 ksesig
SL ?? 0:37.47 (mysqld)
88 764 672 1 4 0 451940 450128 sbwait
SL ?? 0:37.47 (mysqld)
88 764 672 1 96 0 451940 450128 select
SL ?? 0:37.47 (mysqld)
88 764 672 1 20 0 451940 450128 kserel
SL ?? 0:37.47 (mysqld)
88 764 672 1 20 0 451940 450128 kserel
SL ?? 0:37.47 (mysqld)
88 764 672 1 4 0 451940 450128 sbwait
SL ?? 0:37.47 (mysqld)
88 764 672 1 20 0 451940 450128 kserel
SL ?? 0:37.47 (mysqld)
88 764 672 1 4 0 451940 450128 sbwait
SL ?? 0:37.47 (mysqld)
88 764 672 1 20 0 451940 450128 kserel
SL ?? 0:37.47 (mysqld)
0 777 772 0 5 0 3512 3008 ttyin SL+ p0 0:00.06 mysql -p
0 672 1 532 8 0 1616 1168 wait IL con- 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
If there will be a problem again, I will continue to experiment with other
threading libraries.
Thanks a lot again,
Ganbold
At 11:46 AM 16.04.2004, you wrote:
>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