I wanted to share a recent issue with stock Ruby on Centos6.
We run a Rails application that connects to a MySQL datastore. We're in a datacenter transformation and we deployed the application to our new datacenter though the MySQL datastore is at the other datacenter. As you can see there is about a 35ms distance between the application and the MySQL instance.
[root@host]# ping 172.x.y.19 PING 172.x.y.19 (172.x.y.19) 56(84) bytes of data. 64 bytes from 172.x.y.19: icmp_seq=1 ttl=253 time=32.6 ms 64 bytes from 172.x.y.19: icmp_seq=2 ttl=253 time=38.1 ms 64 bytes from 172.x.y.19: icmp_seq=3 ttl=253 time=36.0 ms ^C --- 172.x.y.19 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2751ms rtt min/avg/max/mdev = 32.656/35.600/38.101/2.250 ms
We started the Rails application up though it just was not working. Looking at netstat we observed the following:
So Ruby was connecting to MySQL though after about 10ms was receiving a SIGVTALRM and then immediately after it would re-attempt to establish the connection. tcpdumping 3306 didnt call out anything - it appeared to be doing the initial authentication to the database server and then terminating.
So in summary there still appears to be a threading bug within stock Ruby that ships with centos6 that will terminate a MySQL connection attempt if the datastore is more than 10ms away. Please comment if you have come across this yourself or have a different experience here.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.