LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2010, 02:07 PM   #1
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Rep: Reputation: 2
any way to kill/disconnect a unix domain socket?


I have described my issue in detail here: http://forums.mysql.com/read.php?24,...977#msg-297977
basically, I am having a mysql server which keeps piling up on it's unix domain socket connections.

here's a small example of netstat as it looks now (count about 80-100 connections paired with httpd):
Code:
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     3521428 12429/mysqld        /tmp/mysql.sock
unix  3      [ ]         STREAM     CONNECTED     3789674 12429/mysqld        /tmp/mysql.sock
unix  3      [ ]         STREAM     CONNECTED     3789673 25867/httpd
unix  3      [ ]         STREAM     CONNECTED     3788603 12429/mysqld        /tmp/mysql.sock
unix  3      [ ]         STREAM     CONNECTED     3788602 25841/httpd
unix  3      [ ]         STREAM     CONNECTED     3788389 12429/mysqld        /tmp/mysql.sock
This is indeed a mysql server issue as far as I managed to debug it but until a workaround/fix is found I need to have my server responsive and the first idea that comes to my mind is to somehow kill those stray connections. as described in the mysql topic mentioend above, killing from mysql will not work. I need to kill them from outside mysql.
I have setup a crontab script to kill and restart the mysql server when it cannot connect and it runs every 5 min. however this only lead to mysql being down sooner rather than later because in many cases just kill -9 and then service start mysql does not do the job (it's either part of the same issue of mysql or another issue). basically I need to manually kill mysqld instances a bunch of times until it's ok, OR, if that doesn't work, stop everything that is using mysql, wait a few minutes, and then start mysql. so I ditched that script and now I am manually restarting mysql server every ~ 24 hours.

so basically it's a pain. if I were to kill the stray connections however, I will not have to bother every day with restarting mysql. I hope.

so, any ideas?

thanks.
 
Old 01-05-2010, 03:24 PM   #2
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Original Poster
Rep: Reputation: 2
I just made a test and:
service apache restart
** this took a little while to stop
killall -29 mysqld
** waited about 10 seconds or so
** tried to connect, failed
killall -9 mysqld
** connected successfully

this appears to be a good workaround. if nothing comes up in the following days, I will keep testing this scenario and see if it works all/most of the time.
 
Old 01-06-2010, 02:38 PM   #3
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Original Poster
Rep: Reputation: 2
between the killall -29 and killall -9 there is definitely some timing thing. I had to issue a few killall -9 's before I was able to reconnect (this was with all command executed with about 2-4 seconds between them.

though this appears to be a workaround, I would very much like to get some ideas to test in an attempt to actually fix this.

just in case it matters (though it didn't matter with mysql 4.x), my server is an old PIII with 256 MB ram and 512 MB swap, RH 9 in text mode only. as I said, this server behaved very good before the upgrade so unless mysql 5.1.x comes with some high minimum requirements, this shouldn't be the cause.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding to Unix Domain Socket blank87 Programming 1 06-18-2008 06:19 PM
unix domain socket :how to choose the path(sun_path) sweetytweety Linux - Newbie 6 05-08-2008 04:00 AM
PHP UNIX Domain Socket Programming anamericanjoe Programming 2 12-08-2006 02:10 AM
unix domain socket: how to know if i use recvmsg or read Thinking Programming 3 09-23-2005 01:51 AM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration