在 Amazon EC2 上托管 Web 应用程序的处理端是个好主意吗?
我有一个网络应用程序,它对处理器有相当严格的要求,特别是与存储的数据量有关。由于大量数据传入和传出(并进行排序、格式化等),我经常会关闭服务器。该问题通常与 CPU 相关,而不是与内存相关,并且由于对数据库进行大量插入、更新和选择而发生该问题。
真正的处理器密集型工作是在后台完成的,全部通过计划的 cron 作业运行。用户交互的前端相对简单。
为了保持服务器快速启动和运行,我必须显着减慢后台进程。我讨厌这样做,因为它限制了整个应用程序的实用性。
在我看来,这将是 EC2 之类的理想选择 - 将前端文件和交互留在服务器上,并将所有处理和数据存储外包给云。然而,在阅读了一些关于 EC2 的内容之后,这听起来并不像我想象的那么简单 - 持久存储的问题以及不断建议我“改变我对云计算的看法”让我感到紧张 - 主要是因为我听到这个消息,但没有得到关于应该进行哪些更改的解释。
有人可以帮助我了解我所拥有的是否适合 EC2 或其他类型的系统吗?
I've got a web app which has pretty intensive processor requirements, specifically in relation to the amount of data that gets stored. Because of the massive amounts of data coming in and out (and being sorted, formatted, etc), I'm routinely bringing the server down. The problem is usually CPU related, not memory related, and it is happening because of the massive number of inserts, updates, and selects to the database.
The really processor intensive stuff is done in the background, all run via scheduled cron jobs. The front end, where the users are interacting, is relatively simple.
In order to keep the server up and running quickly, I have to slow down the background processes significantly. I hate to do this, because it limits the whole apps usefulness.
It seems to me that this would be an ideal candidate for something like EC2 - leave the front end files and interaction on the server, and outsource all the processing and data storage to the cloud. However, after doing some reading on EC2, this doesnt sound nearly as simple as I thought it might be - questions of persistent storage and the constant suggestion that I "change the way I think" about cloud computing are making me nervous - mostly because I hear that, but don't get an explanation of what the change should be.
Can someone help me understand if what I've got is a good candidate for EC2, or some other type of system?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
披露:我是 EC2 团队的前 Amazon 员工,现在我所在的公司使用 EC2 来满足我们的大量处理需求。
首先我要说的是:是的,我认为 EC2 是支持 CPU 密集型进程的好主意,但我不知道“改变你的思维方式”指的是什么。
它之所以是个好主意,是因为它是建立服务器集群最省力的途径。我现在所说的“它”指的是任何允许您随意启动/拆卸机器的服务,而不是特指 EC2。缺点是它比维护自己的机器更昂贵,尽管成本涵盖了工作量更少且更灵活的事实(例如,如果您只需要一天或一周的所有计算能力)。
一般来说,如果您有一个 Web 应用程序必须进行 CPU 密集型数据处理,并且还需要有一个响应式界面,那么您当然不希望在一台计算机上分担这些职责。
关于持久化存储,根据你想存储什么,看看SimpleDB、S3和EBS。 SimpleDB 是一个键值存储,S3 保存文件对象,EBS 就像 EC2 上的硬盘驱动器 - 您获得可以安装到 EC2 实例/从 EC2 实例分离的虚拟存储。其中之一可能会满足您的需求,并且所有这些都可以很好地与 EC2 交互。
Disclosure: I am a former Amazon employee on the EC2 team, and I am now at a company that uses EC2 for a great deal of our processing needs.
I will say this, to start: yes, I think EC2 is a good idea for backing a CPU-intensive process, and I have no idea what "change the way you think" is referring to there.
The reason it is a good idea is because its the least-effort path to bringing up a server cluster. By "it" I am now referring to any kind of service that allows you to spin up / tear down machines at will, not specifically EC2. The downside is that it is more expensive than maintaining your own machines, though the cost covers the fact that it is less work and more flexible (for example, if you only need all that compute power for a day or a week).
And generally speaking, if you have a web application that has to do CPU-intensive data processing and also needs to have a responsive interface, you certainly don't want to share those responsibilities on a single machine.
Regarding persistent storage, depending on what you want to store, take a look at SimpleDB, S3 and EBS. SimpleDB is a key-value store, S3 holds file objects, and EBS is like the EC2 equivalent of hard drives - you get virtual storage that you can mount to / detach from EC2 instances. One of those will likely suit your needs, and all interface very nicely with EC2.
我将 EC2 用于 CPU 密集型目的。我对它的小例子有非常糟糕的经历。但是,幸运的是,他们提供了一个高 cpu 系统(以 cpu 计算是小型实例的 5 倍),成本也是双倍的。它对我来说工作得很好。
因此,现在的问题是 EC2 实例的非持久存储。对于硬盘数据,您可以使用持久性的 EC2 块。对于 mysql,您可以将 EC2 块设置为 mysql 服务器(参考)或者您可以使用他们的 Amazon 的关系数据库服务(提供自动扩展)
并开始使用EC2真的很简单:)
您还可以查看rackspace的云计算服务(http://www.rackspacecloud.com/< /a>),如果您正在寻找更多选择
I have used EC2 for cpu intensive purpose. I have pretty bad experience with small instance of it. But, luckily they provide a high cpu system (5 times the small instance in cpu terms) also at double the cost. Its work pretty fine for me.
So, now issue is non-persistent storage of EC2 instances. For hdd data, you can use EC2 blocks which are persistent. For, mysql you can setup a EC2 block as a mysql server (refer) or you can use their Amazon's Relational Database Service (which provides auto scaling)
And getting started with EC2 is really easy :)
You can also look at rackspace's cloud computing service (http://www.rackspacecloud.com/), if you are looking for more options