使用 Amazon Web Services(EC2 等)托管 CakePHP 应用程序?
我认为我还没有完全理解 Amazon Web Services,这就是我问这个问题的原因。我想知道 AWS 是否适合运行在 PHP 和 MySQL 之上的 CakePHP 应用程序?
如果使用像 EC2 这样的服务,我是否需要更改或添加任何内容到我的代码中?我还注意到亚马逊有自己的数据库系统,这是否意味着没有mysql。
另外问一个问题,你们觉得 AWS 的成本如何?
抱歉,如果我的问题有点分散,或者有点“菜鸟”,但这就是我问它的原因。 提前致谢!
I don't think I fully understand Amazon Web Services yet, which is why I'm asking this question. I want to know if AWS would be a nice host for a CakePHP application that of course runs off PHP, and MySQL?
Would I have to change or add anything to my code if used a service like EC2? I also noticed that Amazon has it's own database system, does that mean no mysql.
Also as a side question, what do you guys think of the cost AWS?
Sorry if my question is a little scattered, or somewhat "noobish," but that is why I ask it.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看来这个问题在两周前就已经得到了回答。是的,我当前的公司在 AWS 亚太地区(新加坡)和欧洲西部(爱尔兰)上托管了他们的 CakePHP 应用程序(1.2.1,生产和开发)。生产和开发服务器均为 m1.xlarge(标准 4 核、15GB、Fedora 8 64 位)。我们之前尝试过 LAMP starter,但它太小,无法处理网络流量需求。
基本上你不需要更改代码,除非你已经达到了具有足够流量的里程碑,迫使你切换到 CloudFront (CDN)、RDS 和负载均衡器功能(这就是我目前正在做的事情。)但你已被警告尽早计划。
对于费用,我们 6 月份收到的账单约为 550 美元 ~ 600 美元(大约是 24x7 运行的 m1.xlarge 服务器),7 月份的账单是 1100 美元 ~ 1200 美元(大约是 2 台 24x7 运行的 m1.xlarge 服务器)。知道要花多少钱。
It seems this question has been answered 2 weeks ago. Yes, my current company hosted their CakePHP app (1.2.1, production & development) on AWS Asia Pacific (singapore) and EU West (Ireland). Both production and development servers are m1.xlarge (standard 4-core, 15GB, Fedora 8 64-bit). We tried LAMP starter before, but it's too small and cannot handle web traffic demand.
Basically you don't have change your code, unless you have reached the milestone having enough traffic that forces you to switch to CloudFront (CDN), RDS, and Load Balancer features (that's currently I am doing now.) But you have been warned to plan it as early as possible.
For the cost, the bill we received for June is around USD$550 ~ 600 (roughly m1.xlarge server running 24x7), and for July is USD$1100 ~ 1200 (roughly two m1.xlarge server running 24x7.) This would give you the idea how much it cost.
除非您需要一个专门用于 cakephp 应用程序的实例
您最好使用在共享服务器上提供完整的 Lamp 托管堆栈的主机。
使用aws,您需要创建一个实例,配置该实例,例如安装mysql(如果这是您想要的)等。
然后您在它运行时按小时付费,所以全年都是24*365 *12c = 约 1050 美元(您需要检查您想要的确切费率)
unless you need a dedicated instance just for your cakephp application
you may be better off using a host that provides a full lamp hosting stack on a shared server.
with aws you would need to create an instance, configure that instance, eg install mysql if that is what you want, etc.
then you pay-per-hour while it is running, so for a full year it would be like 24*365*12c = $1050 approx. (you will need to check the exact rates for what you want)
AWS 非常适合自动平衡服务器上的不同负载。想象一下您正在运行一个圣诞特别节目 - 您全年不需要 50 台服务器(浪费钱)。 AWS 允许您(自动)从普通的 1 倍实例扩展到 50 倍。
根据您的问题,我猜测您不是基础设施方面的专家。亚马逊确实提供了一个可以取代 MySQL 的数据存储。但如果您不知道其中的权衡,我建议您不要走这条路,直到您更加熟悉 AWS。
您应该注册一个帐户并使用它来玩。您只需按计算小时付费,因此每天只需花费不到一美元即可设置和运行服务器。一探究竟!
就价格而言,我认为它们比其他一些云计算选项贵一点。我在该领域最常听到的名字是 AWS、linode(比真正的“云”更多的 VPS)、slicehost 和(更常见的)Media Temple。
AWS is great for automatically balancing varying loads across your server. Imagine you're running a Christmas special -- you don't need 50x servers all year (waste of money). AWS allows you to scale (automatically) from your normal 1x instance to 50x.
Based on your question, I'm going to guess you're not an expert in infrastructure. Amazon does offer a data store, which could replace MySQL. But if you're not aware of the tradeoffs, I'd advise against going this route until you become more familiar with AWS.
You should sign up for an account and play with it. You only pay per compute-hour, so you can setup and run a server for under a dollar a day. Check it out!
Price wise, I think they're a little more expensive than some of the other cloud computing options. The most frequent names I hear in that space are AWS, linode (more VPS than true "cloud"), slicehost, and (more frequently) Media Temple.
AWS 就像一个带有附加 API 的虚拟专用服务器 (VPS)。如果您以前没有使用过 VPS,那么在使用 AWS 之前最好先了解一下。
如果您确实想尝试 AWS,它的每小时费率非常实惠。您也可以尝试几个小时,看看效果如何。
玩得开心!
AWS is like a Virtual Private Server (VPS) with additional API. If you haven't used a VPS before, it would be good to explore into that before you use AWS.
If you do want to try AWS, it's available at an affordable per hour rate. You can try for a couple of hours to see how it's like too.
Have fun!