I've been informed that there have been some reports of problems with MySQL connections failing due to randomized ephemeral ports. If you're one of the people affected, could you check a few things and then contact me? Things to check: 1. Are the stuck sockets / failing connections sticking in the SYN_SENT state? 2. Does the range of ports in use look like it's relatively random, or do you see only a small amount of your portrange being used? (The portrange is 1024 to 5000 by default.) 3. Does setting net.inet.ip.portrange.randomized=0 solve the problem for you? Thanks, Mike "Silby" Silbersack
> > I've been informed that there have been some reports of problems with > MySQL connections failing due to randomized ephemeral ports. If you're > one of the people affected, could you check a few things and then contact > me? > > Things to check: > > 1. Are the stuck sockets / failing connections sticking in the SYN_SENT > state? > > 2. Does the range of ports in use look like it's relatively random, or do > you see only a small amount of your portrange being used? (The portrange > is 1024 to 5000 by default.) > > 3. Does setting net.inet.ip.portrange.randomized=0 solve the problem for > you? > > Thanks, > > Mike "Silby" Silbersack > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"Well I'm seeing the occasional EADDRINUSE being returned from connect(). This is w/ a different application. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org
freebsd-question@premsoft.co.za
2004-Jun-02 02:57 UTC
Possible portrange.randomized problems?
Mike Silbersack typed on a keyboard not too far away, on 6/2/2004 9:44 AM:>I've been informed that there have been some reports of problems with >MySQL connections failing due to randomized ephemeral ports. If you're >one of the people affected, could you check a few things and then contact >me? > >Things to check: > >1. Are the stuck sockets / failing connections sticking in the SYN_SENT >state? > >2. Does the range of ports in use look like it's relatively random, or do >you see only a small amount of your portrange being used? (The portrange >is 1024 to 5000 by default.) > >3. Does setting net.inet.ip.portrange.randomized=0 solve the problem for >you? > >Thanks, > >Mike "Silby" Silbersack >_______________________________________________ >freebsd-stable@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-stable >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > >Oh, sorry, I forgot to mention my MySQL error log: 040602 11:50:08 Aborted connection 18214 to db: 'vpopmail' user: 'vpopmail' host: `localhost' (Got an error reading communication packets) 040602 11:50:52 Aborted connection 18215 to db: 'vpopmail' user: 'vpopmail' host: `localhost' (Got an error reading communication packets) 040602 11:51:06 Aborted connection 18216 to db: 'vpopmail' user: 'vpopmail' host: `localhost' (Got an error reading communication packets) 040602 11:51:35 Aborted connection 18217 to db: 'vpopmail' user: 'vpopmail' host: `localhost' (Got an error reading communication packets) 040602 11:52:56 Aborted connection 18220 to db: 'vpopmail' user: 'vpopmail' host: `localhost' (Got an error reading communication packets) My logs are filling up with those. :/ Can this somehow be hardware related?
> 1. Are the stuck sockets / failing connections sticking in the SYN_SENT > state?This is impossible to tell sadly, I get the failures at random times - usually when I am away from the box - so I cant tell att the actual time what the status is. I have tried setting net.inet.ip.portrange.randomized and will see what happens over the next 24 hours. Usually I get a few errors duuring the day and collect quite a number overnight when Iam away from the machine. Will let you know, thanks.... -pcf.
Mike Silbersack typed on a keyboard not too far away, on 6/2/2004 9:44 AM:>I've been informed that there have been some reports of problems with >MySQL connections failing due to randomized ephemeral ports. If you're >one of the people affected, could you check a few things and then contact >me? > >Things to check: > >1. Are the stuck sockets / failing connections sticking in the SYN_SENT >state? > >2. Does the range of ports in use look like it's relatively random, or do >you see only a small amount of your portrange being used? (The portrange >is 1024 to 5000 by default.) > >3. Does setting net.inet.ip.portrange.randomized=0 solve the problem for >you? > >Thanks, > >Mike "Silby" Silbersack >_______________________________________________ >freebsd-stable@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-stable >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > >Mike, This problem exists even if you do not allow network connections to MySQL. MySQLd is started with --skip-networking, thus making use of UNIX-sockets only, and I get this problem. I am running 4.9-STABLE: FreeBSD riot.xxx.xx.xx 4.9-STABLE FreeBSD 4.9-STABLE #2: Sat Jan 24 13:13:08 SAST 2004 jacovt@riot.xxx.xx.xx:/usr/obj/usr/src/sys/RIOT i386 I do _not_ have net.inet.ip.portrange.randomized: riot% sysctl net.inet.ip.portrange.randomized sysctl: unknown oid 'net.inet.ip.portrange.randomized' riot% sysctl net.inet.ip.portrange net.inet.ip.portrange.lowfirst: 1023 net.inet.ip.portrange.lowlast: 600 net.inet.ip.portrange.first: 1024 net.inet.ip.portrange.last: 5000 net.inet.ip.portrange.hifirst: 49152 net.inet.ip.portrange.hilast: 65535 Here is the output of sockstat (for what it may be worth): qscand perl 17215 4 stream mysqld[78219]:15 mysql mysqld 17214 3 stream /tmp/mysql.sock mysql mysqld 17214 15 stream /tmp/mysql.sock vpopmail qmail-sm 17213 4 stream mysqld[78219]:15 .... mysql mysqld 78229 3 stream /tmp/mysql.sock mysql mysqld 78229 15 stream /tmp/mysql.sock mysql mysqld 78228 3 stream /tmp/mysql.sock mysql mysqld 78228 15 stream /tmp/mysql.sock mysql mysqld 78227 3 stream /tmp/mysql.sock mysql mysqld 78227 15 stream /tmp/mysql.sock mysql mysqld 78226 3 stream /tmp/mysql.sock mysql mysqld 78226 15 stream /tmp/mysql.sock mysql mysqld 78225 3 stream /tmp/mysql.sock mysql mysqld 78225 15 stream /tmp/mysql.sock mysql mysqld 78224 3 stream /tmp/mysql.sock mysql mysqld 78224 15 stream /tmp/mysql.sock mysql mysqld 78223 3 stream /tmp/mysql.sock mysql mysqld 78223 15 stream /tmp/mysql.sock mysql mysqld 78222 3 stream /tmp/mysql.sock mysql mysqld 78222 15 stream /tmp/mysql.sock mysql mysqld 78221 3 stream /tmp/mysql.sock mysql mysqld 78221 15 stream /tmp/mysql.sock mysql mysqld 78220 3 stream /tmp/mysql.sock mysql mysqld 78220 15 stream /tmp/mysql.sock mysql mysqld 78219 3 stream /tmp/mysql.sock mysql mysqld 78219 15 stream /tmp/mysql.sock -- Jaco van Tonder Magic Developer :: Premsoft Development (Pty) Ltd Direct: +27 11 312 2122 :: Fax: +27 11 312 2122 :: Mobile: +27 83 417 5424 Email: jaco@premsoft.co.za :: Web: http://www.premsoft.co.za/ Disclaimer: http://www.premsoft.co.za/email_disclaimer.html
> 3. Does setting net.inet.ip.portrange.randomized=0 solve the problem for > you?Just to confirm, this does indeed seem to make the problem go away! Do you want me to file a (very indistinct) pr on the subject ? Where do we go from here ? Good that a workaround exists though - I can upgrade all the other machines to 4.10 now as long as I turn off the randomising. -pcf.