[英]Which InstanceType for rails elastic beanstalk development vs. production?
We want to run both development
and production
instances on elastic beanstalk for our rails app. 我们想在Rails应用程序的弹性beantalk上运行
development
和production
实例。
Characteristics of production
are: production
特点是:
Database requirements (none on eb instance): 数据库要求(在eb实例上无):
development
currently uses sqlite on eb instance development
目前在eb实例上使用sqlite development
and production
development
和production
使用相同的RDS实例 Our development
is currently a t1.micro
, and clearly that isn't going to cut it even for development (login sometimes takes 60 seconds). 我们目前的
development
是t1.micro
,很明显即使开发也不会削减它(登录有时需要60秒)。
I will experiment, but would appreciate if anyone has any quick bits of advice for choosing an appropriate instance type for each env and which criteria/constraints are most meaningful for rails ie compute units. 我将进行实验,但是如果有人对每个env选择合适的实例类型有什么建议,以及对于rails即计算单元最有意义的标准/约束,我将不胜感激。
My 2 cents - lean on the side of CPU over memory. 我的2美分-靠CPU而不是内存。 CPU always helps;
CPU总是有帮助的; at the very least your app will compile assets and load into memory faster on deploys.
至少,您的应用程序将在部署时编译资产并更快地加载到内存中。 I suggest starting with 2x c1.medium in production (in 2 different AZs for basic redundancy) and 1x m1.small in development.
我建议从生产中使用2x c1.medium(用于基本冗余的2个不同AZ)开始,在开发中使用1x m1.small。
Don't overthink the machine sizes, instead get the low hanging fruit right, namely: put your static assets on a CDN and implement fragment caching (stored in a dedicated redis or memcached node per environment). 不要过分考虑机器的大小,而应该正确地取得成果,即:将静态资产放在CDN上并实现片段缓存(每个环境存储在专用的Redis或Memcached节点中)。
If you've never done this before, New Relic Pro will likely give you a big head start identifying bottlenecks in your app. 如果您以前从未做过此事,New Relic Pro可能会带您大胆地开始识别应用程序中的瓶颈。
Then get to load testing! 然后开始负载测试!
Also, please don't share your RDS instance between production and development. 另外,请不要在生产和开发之间共享您的RDS实例。 Isolate the two environments by giving each their own database.
通过给每个数据库各自的数据库来隔离这两个环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.