花了一天时间,将原先放在免费虚拟主机上的 Flex 留言板,连同原先的数据库数据,全部搬家到了 Google App Engine 上,这里大概说说体会: 1、选 Python 还是选 Java ? |
2、GAE 速度怎么样?
说实话,很一般,Google 的粉丝不要拍砖哦,我这有证据。下面的两个网址,是同一个的 Flex 留言板程序,数据也一样。
第一个在 GAE 上
第二个在美国的一个免费虚拟主机上,距离远,而且速度带宽都有限制,自己比较下吧,我这里GAE 要慢很多。
要是同国内付费的虚拟主机比较,可能差距更大。
Google App Engine
普通虚拟主机
3、GAE 数据库好使吗?
还不错。但是 Google 应该在现有的 API 上再简单的包装一层,立刻就可以减少 80% 的重复代码。
比如,原先 PHP 版的留言板,在用 CodeIgniter 框架的情况下,一条留言从 request 到插入数据库,只需要几条语句。而现在要几十条语句。只要简单再包装一下,应该可以达到类似的效果。
4、GAE 配额都有什么限制?
限制的种类非常多,但是配额数都够用了。经过三四天的折腾,CPU 也才用了0.06个小时。
其他包括各种 API 调用次数也都是有限制的,我为了搬家,抓取原来的数据,使用了16次 UrlFetch API,好在配额六十多万次,够用了。
程序上传发布一天只能250次,我现在用了9次,问题也不大。
用的最多的是 Datastore API ,已经用了一千多次了,但是配额是每天一千万次,哈哈,够用了吧。
Requests
Quotas are reset every 24 hours. Next reset: 5 hours
Datastore
Datastore API Calls | 0% | 4024 of 10368000 | Okay | |
Stored Data | 0% | 0.00 of 1.00 GBytes | Okay | |
Data Sent to API | 0% | 0.00 of 12.00 GBytes | Okay | |
Data Received from API | 0% | 0.02 of 116.00 GBytes | Okay | |
Datastore CPU Time | 0% | 0.09 of 62.11 CPU hours | Okay |
Mail API Calls | 0% | 0 of 7000 | Okay | |
Recipients Emailed | 0% | 0 of 2000 | Okay | |
Admins Emailed | 0% | 0 of 5000 | Okay | |
Message Body Data Sent | 0% | 0.00 of 0.06 GBytes | Okay | |
Attachments Sent | 0% | 0 of 2000 | Okay | |
Attachment Data Sent | 0% | 0.00 of 0.10 GBytes | Okay |
UrlFetch
UrlFetch API Calls | 0% | 0 of 657084 | Okay | |
UrlFetch Data Sent | 0% | 0.00 of 4.00 GBytes | Okay | |
UrlFetch Data Received | 0% | 0.00 of 4.00 GBytes | Okay |
Image Manipulation
Image Manipulation API Calls | 0% | 0 of 864000 | Okay | |
Data Sent to API | 0% | 0.00 of 1.00 GBytes | Okay | |
Data Received from API | 0% | 0.00 of 5.00 GBytes | Okay | |
Transformations executed | 0% | 0 of 2592000 | Okay |
Memcache
Memcache API Calls | 0% | 0 of 8640000 | Okay | |
Data Sent to API | 0% | 0.00 of 10.00 GBytes | Okay | |
Data Received from API | 0% | 0.00 of 50.00 GBytes | Okay |
Deployments
Deployments | 0% | 0 of 250 | Okay |
最后看看超出配额的价格,下面的表格是每天0.1美元预算、偏重于存储的情况,11G的空间,够用了,博客园干脆也搬到 App Engine 上吧,呵呵。
Resource (% of Budget) | Budget | Unit Cost | Paid Quota | Free Quota | Total Daily Quota |
---|---|---|---|---|---|
CPU Time 40% | $0.05 | $0.10 | 0.50 | 46.30 | 46.80 CPU hours |
Bandwidth Out 8% | $0.00 | $0.12 | 0.00 | 10.00 | 10.00 GBytes |
Bandwidth In 2% | $0.00 | $0.10 | 0.00 | 10.00 | 10.00 GBytes |
Stored Data 50% | $0.05 | $0.005 | 10.00 | 1.00 | 11.00 GBytes* |
Recipients Emailed 0% | $0.00 | $0.0001 | 0.00 | 2000.00 | 2000.00 Emails |
欢迎大家来我的新家疯狂留言,进行残酷的压力测试,看看能不能把它刷爆,呵呵。
我的GAE主页是:http://myqiao-app.appspot.com/exercise/
==================================================
本文转自左洸博客园博客,原文链接:http://www.cnblogs.com/myqiao/archive/2009/05/12/1454670.html,如需转载请自行联系原作者