当我使用1.6.0_20回滚到以前的版本时,我的应用程序将在60秒内启动。鉴于以下事实,我该如何调试和解决问题?Java 1.6.0_27更新后Heroku应用程序无法在60秒内启动
- 我的应用程序正在使用播放1.2.5
- 在日志中我看到了应用程序连接到PostgreSQL数据库。这通常是R10错误发生之前的最后一个日志。
--update 我已经创建了一个插件并发出一个假端口绑定,这将在10秒后关闭。这解决了绑定问题,但现在我有一个内存问题。在高负载下,app可能会使用600M的内存。但是现在我看到〜1500M,并且在不断增加。
@Override
public void onConfigurationRead() {
final int port = Integer.parseInt(Play.configuration.getProperty("http.port"));
try {
// Create a new server socket and set to non blocking mode
final ServerSocketChannel ssc = ServerSocketChannel.open();
ssc.configureBlocking(false);
InetSocketAddress isa = new InetSocketAddress(port);
ssc.socket().bind(isa);
Logger.info("Fake bind to port %d", port);
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
try {
ssc.socket().close();
Logger.info("Fake port closed");
} catch (IOException ioe) {
Logger.error(ioe, "Cannot close fake port");
}
}
}, 10000);
} catch (IOException ioe) {
Logger.error(ioe, "Cannot open fake port");
}
Cache.forcedCacheImpl = RedisCacheImpl.getInstance();
}
您的应用程序启动时是否正在运行数据库迁移?如果是这样,你可以将这些移动到一个单独的过程吗? – 2013-04-09 21:10:32
不,在启动过程中没有任何要求。 – fcs 2013-04-10 07:20:36