Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysqld dies on connection close
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
fimbultyr
n00b
n00b


Joined: 01 Jan 2009
Posts: 1

PostPosted: Thu Jan 01, 2009 4:55 pm    Post subject: mysqld dies on connection close Reply with quote

Hi there!

Recently, I noticed some strange CPU load on one of my gentoo servers. A short investigation turned out that several mysqld threads were struggling for CPU time.
I restarted MySQL and everything looked normal again, but after a few minutes one of the mysqld threads was using 100% CPU time on one core again.

After an entire afternoon of error searching this is what I came up with:
As soon as any client (I've tried the mysql command line client, php and telnet) closes a connection to the mysql server the mysqld thread which handled the connection starts to spinlock somehow. It doesn't matter whether I connect via TCP/IP or an UNIX domain socket, but while the connection is alive everything works fine. I can issue querys, create/drop tables and databases, etc.
So obviously something with the socket handling is broken.
Since I've encountered strange software failures before running a hardened gentoo system I suspected the hardened toolchain or the kernel for causing the problems.

Here is what I tried so far:

  • Switched to a non ~amd64 masked mysql version
  • Compiled mysql with a non-hardened toolchain
  • Disabled IPv6 networking
  • Booted a kernel without any Grsecurity / PaX features
  • Re-emerged all mysql dependencies (emerge -ave dev-db/mysql)
  • Tested a completely empty database by killing /var/lib/mysql
  • Countless combinations of the above...

Unfortunately nothing helped to resolve the issue and therefore I hope that somebody here who has more experience with mysql will be able to help.

Kind regards,
fimbultyr

emerge --info:
Code:
Portage 2.1.6.4 (hardened/amd64, gcc-3.4.6, glibc-2.6.1-r0, 2.6.27-hardened-r3 x86_64)
=================================================================
System uname: Linux-2.6.27-hardened-r3-x86_64-AMD_Athlon-tm-_64_Processor_3700+-with-glibc2.3.2
Timestamp of tree: Thu, 01 Jan 2009 02:35:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS=" -pipe -march=athlon64 -mtune=athlon64 -Os"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS=" -pipe -march=athlon64 -mtune=athlon64 -Os"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.mesh-solutions.com/gentoo ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo http://distfiles.gentoo.org"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS=""
LINGUAS="en"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 apache2 authdaemond bash-completion berkdb bzip2 caps crypt curl dlloader erandom expat fam gdbm glibc-omitfp gmp gzip hardened hash iconv idn imap ipv6 ithreads libwww linuxthreads-tls logrotate maildir memlimit mhash mime mmap mysql ncurses nls no-old-linux nocd nomac nptl nptlonly pcre perl pic posix pwdb python readline sharedmem sockets ssl symlink sysfs sysvipc tcpd threads ucs2 udev unicode urandom userlocales utf8 valias vhosts xml xml2 xsl zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x    ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3        trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="auth_basic filter authz_host authn_dbm authn_anon auth_digest alias file_cache charset_lite cache disk_cache mem_cache ext-filter deflate mime_magic cern_meta expires headers usertrack unique_id proxy proxy_connect proxy_ftp proxy_http info include dav dav_fs vhost_alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir actions userdir" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 intel mach64       mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis       sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


eix -I dev-db/mysql:
Code:
[I] dev-db/mysql
     Available versions:  [M]*3.23.58-r1 4.0.27-r1 4.1.22-r1 [M](~)4.1.23_alpha20070101-r61 5.0.26-r2 (~)5.0.32 (~)5.0.34 5.0.38 5.0.40 5.0.42 (~)5.0.44 5.0.44-r1 5.0.44-r2 5.0.54 (~)5.0.56 (~)5.0.60 5.0.60-r1 5.0.70 5.0.70-r1 (~)5.0.72 (~)5.0.72-r1 {berkdb big-tables cluster debug embedded extraengine innodb latin1 max-idx-128 minimal perl raid readline selinux ssl static tcpd}
     Installed versions:  5.0.72-r1(03:31:48 PM 01/01/2009)(perl ssl -berkdb -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal -selinux -static)
     Homepage:            http://www.mysql.com/
     Description:         A fast, multi-threaded, multi-user SQL database server.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Mon Jan 19, 2009 1:32 pm    Post subject: Reply with quote

Do logs contain any MySQL error?
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum