每隔一段时间,当我们重新启动应用程序或测功机自动循环/重新启动时,测功机会重新启动,但会出现Can't connect to MySQL server on (url) (110)
错误。然后将在我们收到的每个请求中不断抛出!! Unexpected error while processing request: can't modify frozen array
错误,直到我们手动重新启动测功机。就像我们所有其他的测功机一样,它非常好
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?