mysql over TCP and far out PIDs
Lennart Sorensen
lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Feb 19 18:17:46 UTC 2014
On Wed, Feb 19, 2014 at 12:08:26PM -0500, Darryl Moore wrote:
> Hi list,
>
> I lurk around this maillist a lot, but don't say much. I'm having an
> interesting issue right now though that maybe someone here might have
> some insight into, which I'd really appreaciate.
>
> I'm running servers with Ubuntu 12.04 with upgraded 3.5 kernels and
> mysql 5.5.35
>
> On three machines which are supposedly identical, only one works as it
> is suppose to allowing me to login to mysql via TCP. On the other two I
> get this message.
>
> Lost connection to MySQL server at 'reading initial communication
> packet', system error: 0
>
> I know mysql is listening (or someone is) because on a non listening
> port I get:
>
> ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
>
> Mysql is configured identical on all machines. What is really odd is
> when I run netstat I get the follow output:
>
> #netstat -n -l -e | grep tcp
> tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 128 15430
> tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 120 14278
> tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 116 452074
> tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 0 15278
>
> The last column is the PID of the listening process. In this case
> process id 452074 is listening on Mysql's port. However no process id is
> ever suppose to be greater than 65535 and when I lookup mysql's process
> ID i get this:
>
> #ps ax | grep mysql
> 7560 ? Ssl 0:01 /usr/sbin/mysqld
> 8109 pts/1 S+ 0:00 grep --color=auto mysql
>
> So mysql's PID is really 7560 and nobody should be 452074. Does anybody
> have clue what is going on here? Any insight would be greatly appreciated.
The default pid_max in linux is 32768, but with 2.5+ kernels it is
configurable. Look at /proc/sys/kernel/pid_max. It can be set to at
least 2147483647.
Now some user space tools may still assume it is 16 bit and wrap the
value early.
I prefer using 'netstap -anp' since it nicely tells you the process name.
Sure is helpful.
The numbers after LISTEN are userid and inode (not pid). If you want
the pid, use -p, which gives you a column like '15085/ntpd', which is
the pid and process name.
--
Len Sorensen
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list