Port Exhaustion - SQL
Brandon Mallory
brandonm at medent.com
Thu May 16 15:12:54 UTC 2019
The programmers currently use a file to specify the IP of the remote SQL server. As a work around for the time being I have added a 2nd interface to the front end server and the remote SQL server.
These are the errors we get when we hit the 65k limit.
mysqli_connect(): Can't connect to MySQL server on '192.168.98.19' (99)
Front end
192.168.99.8
192.169.98.9
Remote SQL
192.168.99.19
192.168.98.19
There is a file where I can specify which IP to use ( 192.168.99.19 or 192.168.98.19) wrote a script to change that IP when we hit 30k connections.
SQLIP=`cat /MYSQL_HOST`
COUNT=`netstat -an | grep $SQLIP | wc -l`
if [ "$SQLIP" = "192.168.98.19" ];then
FLIP="192.168.99.19"
else
FLIP="192.168.98.19"
fi
if [ $COUNT -gt 30000 ];then
echo "$FLIP" > /MYSQL_HOST
COUNTFLIP=`netstat -an | grep $FLIP | wc -l`
echo "$SQLIP Hit $COUNT switching IP to $FLIP with $COUNTFLIP connections - $(date)" >> $LOG
fi
There just seems like a better way to have something else "load balance" between 2 lan IP's.
Best Regards,
Brandon Mallory
Network & Systems Engineer
MEDENT EMR/EHR
15 Hulbert Street
Auburn, NY 13021
Phone: [ callto:(315)-255-0900 | (315)-255-0900 ]
Fax: [ callto:(315)-255-3539 | (315)-255-3539 ]
Web: [ http://www.medent.com/ | www.medent.com ]
This message and any attachments may contain information that is protected by law as privileged and confidential, and is transmitted for the sole use of the intended recipient(s). If you are not the intended recipient, you are hereby notified that any use, dissemination, copying or retention of this e-mail or the information contained herein is strictly prohibited. If you received this e-mail in error, please immediately notify the sender by e-mail, and permanently delete this e-mail.
From: "Reinis Rozitis" <r at roze.lv>
To: "nginx" <nginx at nginx.org>
Sent: Thursday, May 16, 2019 10:38:43 AM
Subject: RE: Port Exhaustion - SQL
Ohh I missed the whole idea that nginx is used as tcp balancer for mysql.
But imo it is still more simple (unless you can't do anything with the DB server) to balance the remote server rather than split and bind local clients:
upstream backend {
least_conn;
server ip1:3306;
server ip2:3306;
server ip3:3306;
}
rr
_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190516/23bae3c2/attachment-0001.html>
More information about the nginx
mailing list