问题描述
我们一直在将Google App Engine用于一个项目的后端服务,该项目已完全作为Gooogle App开发引擎项目.
We have been using Google App Engine for the backend services of a project which has been developed completely as a Gooogle App Engine Project.
最近,前端实例消耗了我们项目支出的60-70%以上.因此,我们决定完全放弃它,而改为迁移到Google Compute Engine.
Lately, the front end instances were consuming more than 60-70% of our project expense. Thus we decided to do away with it completely and migrate to Google Compute Engine instead.
想知道是否有人将其GAE项目迁移到了GCE.我了解可以在GAE应用程序中动态启动GCE VM,但我们希望完全取消GAE. (来源)
Wanted to know if anyone has migrated their GAE project to GCE. I understand that GCE VMs could be dynamically spun up from within a GAE app, but we want to completely do away with GAE. (Source)
最后一个选择是,我将托管一个Django项目,并使用GAE文件作为Web服务的控制器.
As a last option, I shall host a Django project and use GAE files as the controller for the web services.
但是,想知道在将数据存储集成保持完整的同时,是否还有其他可能更简单的选项可将GAE项目移至GCE.
However, wanted to know if there are other potentially easier options for moving GAE projects to GCE while keeping the datastore integration intact.
TIA
推荐答案
不幸的是,标准环境对应用程序的支持的独特性可能使您的迁移非常困难.
Unfortunately the uniqueness of the standard environment support for the application may make your migration quite difficult.
举例来说,标准环境和灵活环境之间的显着差异(如果需要,这就像迈向完全迁移到GCE的中间步骤):将服务从标准环境迁移到灵活环境.对我来说,它们实际上是不同的野兽.
Take, for example, the significant differences just between the standard env and the flexible env (which, if you want, would be like an intermediary step towards total migration to GCE): Migrating Services from the Standard Environment to the Flexible Environment. To me they're practically different beasts.
更糟糕的是,您认为迁移中最重要的事情-保持数据存储集成完整-也是最有可能反对迁移的 .
To make matters worse the very thing you consider the most important in your migration - keeping the datastore integration intact - is also the most likely to stand against your migration.
这是因为您的应用很可能使用专用客户端库之一,针对标准环境GAE应用进行了优化,并且仅适用于该标准环境.如果是这样-迁移实际上意味着重新设计与数据存储区的整个交互,以使其使用改为使用更通用的数据存储库.这意味着不仅仅是翻译API调用-还需要解决概念和功能上的差异.
That's because chances are that your app uses one of the dedicated client libraries, optimized for and only available to the standard environment GAE apps. If so - the migration effectively means re-designing the entire interaction with the datastore to make it use one of the more generic datastore libraries instead. Which means more than just translating API calls - there are conceptual and functional differences that would need to be addressed.
因此,标题问题的答案很可能是:为GCE重新设计您的应用程序.我个人不确定GCE是否总体上更具成本效益-我仍然更喜欢标准env GAE.假设某个时候成本上升到足以重新考虑的程度,我就会:
So the answer to the title question may very well be: redesign your app for GCE. Personally I'm unsure if GCE is overall more cost-effective - I still prefer the standard env GAE. Assuming at some point the costs go up enough to maybe re-consider, I'd:
- 仔细查看价格和当前应用程序成本明细,以了解哪些是较重的组件:例如,如果大多数成本来自数据存储使用,则我不希望将其迁移到GCE可以显着帮助
- 尝试调整应用程序的配置和/或代码以降低成本:例如,如果实例小时数占根据可调整的流量模式调整可扩展性配置的成本中的大多数,则可能可以降低费用
- 估算相似使用模式但在GCE(和/或GAE flex)上具有相应组件的成本
- 如果相应的组件也可以在GAE flex上使用,我将使用该组件进行一些实验,而不是使用完整的GCE(这几乎需要首先进行重写).
- take a closer look at the pricing and the current app costs breakdown, to see which components are the heavier ones: if the majority of the costs come, for example, from the datastore usage - I wouldn't expect a migration to GCE to significantly help
- try to tune the app's config and/or code to reduce costs: for example if the instance hours represent the majority in the costs tuning the scalability configurations depending on the actual traffic patterns might lower the bill
- estimate the costs for similar usage patterns but with the corresponding components available on GCE (and/or GAE flex)
- if the respective components are also available on GAE flex I'd make some experiments using that instead of going full GCE (which would pretty much require the re-write first).
使用灵活环境作为垫脚石的逐步过渡可以揭示估计的成本节省是否还不足够,从而有助于在进行整个重写之前放弃整个过渡.如果过渡仍然是继续",那么这也可能有助于重新编写.
A gradual transition using the flexible environment as a stepping stone could reveal if the estimated costs savings aren't quite there, thus helping drop the whole transition before doing the entire re-write. And also could help with the re-write, in case the transition still remains a "go".
更新:可能还需要考虑另一种降低成本的解决方案:通过 AppScale (另请参见 appscale )使用更具成本效益的IaaS提供商.
Update: There might be another solution to consider for reducing costs: running the existing GAE app code through AppScale (see also appscale) on a more cost-effective IaaS provider.
这篇关于如何将Google App Engine项目完全迁移到Compute Engine?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!