We have two data centers located across the globe. if we run the rails app in one datacenter and point to the database located in the other data center. The app throws
MySQL server has gone away
like once in every 5-6 web request. and show 5000 internal server error
but if we put both the app and the mysql db in the same datacenter. it runs just fine. It appears to be some latency issue. maybe some timeout or reconnection to the database required. But not sure how to fix it. Any help appreciated.