运行在Amazon EC2上微实例一出戏的框架应用程序 [英] Running a play framework app in Amazon EC2 micro instance

查看:135
本文介绍了运行在Amazon EC2上微实例一出戏的框架应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的游戏!应用程序,它简单地处理了几个正常的GET和POST请求,会谈到一个MySQL数据库的,没有什么特别的。

I have a really basic play! app which simply handles a couple of normal GET and POST requests and talks to a MySQL database, nothing fancy.

我跑播放DIST 和zip文件传输到我的EC2实例。解压缩它,去仓后文件夹,然后运行 ./的myapp <​​/ code>,我得到一个消息:

I ran play dist and transferred the zip file to my EC2 instance. After unzipping it, going to the bin folder and running ./myapp, I get a message:

Java HotSpot(TM) 64-Bit Server VM warning: Info: os::commit_memory ... error='Cannot allocate memory' (errorno=12)
There is insufficient memory for the Java Runtime Environment to continue.

我正在播放的版本2.2.1,这情况有大约RAM 512MB的,与64位版本的Oracle JDK的。这是不够的,运行游戏!应用程序还是我失去了一些东西?

I'm running Play version 2.2.1 and this instance has about 512MB of ram, with the 64-bit version of the Oracle JDK. Is this not enough to run a play! app or am I missing something?

感谢。

推荐答案

播放框架2.3现在有一个漂亮的小功能。

Play Framework 2.3 now has a nifty little feature.

$ /path/to/bin/<project-name> -mem 512 -J-server

Shoule把工作做好。

Shoule get the job done.

读<一href="http://www.playframework.com/documentation/2.3-SNAPSHOT/ProductionConfiguration">http://www.playframework.com/documentation/2.3-SNAPSHOT/ProductionConfiguration

指定其他JVM参数 您可以指定任何JVM参数来启动脚本。否则,默认的JVM设置将被使用:

Specifying additional JVM arguments You can specify any JVM arguments to the start script. Otherwise the default JVM settings will be used:

$ /路径/为/ bin / -J-Xms128M -J-Xmx512m -J-服务器 为了方便您也可以设置内存最小值,最大值,PermGen的和​​一次性的保留code高速缓存的大小;一个公式用于 确定这些值给出所提供的参数(重presents最大内存):

$ /path/to/bin/ -J-Xms128M -J-Xmx512m -J-server As a convenience you can also set memory min, max, permgen and the reserved code cache size in one go; a formula is used to determine these values given the supplied parameter (which represents maximum memory):

$ /路径/为/ bin / -mem 512 -J-服务器

$ /path/to/bin/ -mem 512 -J-server

这篇关于运行在Amazon EC2上微实例一出戏的框架应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆