我的应用程序是一个可扩展的tomcat应用程序与MySQL。如果我有一段时间不访问我的应用程序,当我再次访问它时,响应时间会很长。检查haproxy.log:
[WARNING] 131/134600 (449836) : Server express/local-gear is DOWN, reason: Layer7 timeout, check duration: 10002ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/134644 (449836) : Server express/local-gear is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 4068ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 131/154052 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is DOWN, reason: Layer7 timeout, check duration: 10004ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/154323 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 501ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 131/154550 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is DOWN, reason: Layer7 timeout, check duration: 10003ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/154643 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 7ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 131/182346 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is DOWN, reason: Layer7 timeout, check duration: 10003ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/182512 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 11ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 131/194433 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is DOWN, reason: Layer7 timeout, check duration: 10004ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/194439 (449836) : Server express/gear-5370cea0500446741d00058b-ibrainext is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 109ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
[WARNING] 131/194615 (449836) : Server express/local-gear is DOWN, reason: Layer7 timeout, check duration: 10002ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 131/194735 (449836) : Server express/local-gear is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 0ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
看起来超时值是10秒。如何保持应用程序正常运行而不宕机?
如果你在24小时内没有访问你的应用程序,它将被闲置(如果这是一个免费帐户),并且根据你的应用程序有多大,当你再次访问它时,它可能需要一段时间才能重新启动。