每隔一段时间,当我们重新启动应用程序或者dyno自动循环/重新启动时,dyno会重新启动,但会出现Can't connect to MySQL server on (url) (110)
错误。在我们手动重启dyno之前,我们会在每次请求时不断抛出!! Unexpected error while processing request: can't modify frozen array
个错误。然后就像我们所有其他的dynos一样完美无缺
Jan 29 22:18:23 myapp heroku/web.26: State changed from up to starting
Jan 29 22:18:27 myapp heroku/web.26: Stopping all processes with SIGTERM
Jan 29 22:18:29 myapp heroku/web.26: Process exited with status 0
Jan 29 22:18:32 myapp heroku/web.26: Starting process with command `bundle exec thin -p 41924 -e production -R /home/heroku_rack/heroku.ru start`
Jan 29 22:18:40 myapp app/web.26: >> Thin web server (v1.4.1 codename Chromeo)
Jan 29 22:18:40 myapp app/web.26: >> Maximum connections set to 1024
Jan 29 22:18:40 myapp app/web.26: >> Listening on 0.0.0.0:41924, CTRL+C to stop
Jan 29 22:18:42 myapp heroku/web.26: State changed from starting to up
Jan 29 22:19:08 myapp app/web.26: Starting the New Relic Agent.
Jan 29 22:19:08 myapp app/web.26: Installed New Relic Browser Monitoring middleware
Jan 29 22:19:08 myapp app/web.26: ** [NewRelic][01/29/13 19:19:08 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : Dispatcher: thin
Jan 29 22:19:08 myapp app/web.26: ** [NewRelic][01/29/13 19:19:08 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : Application: myapp
Jan 29 22:19:08 myapp app/web.26: ** [NewRelic][01/29/13 19:19:08 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : New Relic Ruby Agent 3.5.3 Initialized: pid = 2
Jan 29 22:19:08 myapp app/web.26: ** [NewRelic][01/29/13 19:19:08 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : NewRelic::Agent::Samplers::DelayedJobSampler sampler not available: No DJ worker present
Jan 29 22:19:18 myapp app/web.26: ** [NewRelic][01/29/13 19:19:18 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : Connected to NewRelic Service at collector-1.newrelic.com
Jan 29 22:19:18 myapp app/web.26: ** [NewRelic][01/29/13 19:19:18 -0800 dd1c41a1-e62a-46f0-bdc8-f48919d4db3c (2)] INFO : Reporting performance data every 60 seconds.
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: Can't connect to MySQL server on 'myrdsinstance.us-east-1.rds.amazonaws.com' (110)
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: can't modify frozen array
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: can't modify frozen array
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: can't modify frozen array
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: can't modify frozen array
Jan 29 22:19:31 myapp app/web.26: !! Unexpected error while processing request: can't modify frozen array
我们的MySQL实例是一个RDS实例,我们从未遇到过从其他EC2实例或本地连接到它的问题,只有我们的Heroku dynos。
认为它可能是back_log
问题,我们提高了这个值,但它对错误的发生没有影响。
我们还可以尝试帮助诊断出现问题或消除此连接问题?在RDS和Heroku上,我们的日志选项似乎相当有限......有没有办法让MySQL自动重新连接它的连接,因为Heroku高估了你的database.yml?