-
Notifications
You must be signed in to change notification settings - Fork 13
mysql timeouts on RDS #7
Description
I am using the VERY handy docker image created by rroemhild , which is a great way to get started with ejabberD. But the moment I enabled AWS RDS mysql on a VPC, it fails, out of the box, with no configuration changes except adding mysql db configuration parameters.
It fails with a bunch of exceptions, the root which seems to be this msg for each connection:
2015-12-31 05:43:33.798 [error] <0.311.0>@ejabberd_odbc:log:663 p1_mysql_conn: post_start timeout
After 2-3 minutes of throwing exceptions, the node settles down, it makes stable mysql connections, and the ejabberD node can start to accept connections.
As a new user to ejabberD, this made me very nervous, and the forms seem to be filled with concerns about mysql timeouts (some of which have a clear root cause like the db isn't running, but many which don't seem to have a resolution).
In this case, the issue seems to be the dns-name resolution that occurs during initial mysql conn login. After turning on detailed mysql logging, an entry was in the logs about the host dns address (10.0.0.147 in my case) not able to be resolved. Turning off dns name resolution (set skip_name_resolve as true when booting mysql) clears things up completely with the p1_mysql driver.
Two thoughts:
- I haven't had this sort of issue with the go, ruby, or python mysql drivers. Can the p1_mysql driver behave in a similar manner? I can dive into what the diff is between p1_mysql and these other drivers if it hasn't been looked at in the past
- this seems to be a pretty common problem. So I wanted to just note it here in case it was useful to others. It maybe worth adding a note in the readme?