昨天花了一天時間,將原先放在免費虛擬主機上的 Flex 留言板,連同數據庫數據,全部搬家到了 Google App Engine 上,這里大概說說體會:
1、選 Python 還是選 Java ?
原先的留言板后臺是PHP,準備上 GAE 后就得面臨這個選擇。幾經嘗試后還是決定選 Java。
本來 Python 功能同樣強大,比 Java 更敏捷,主要問題是沒有一個好用的 IDE,這就很麻煩。少個冒號、少導入個包,你不會得到任何提示,程序運行起來到滿屏的錯誤清晰,根本無法迅速查找錯誤,所以最后選擇了 Java。語法雖然羅嗦點,但是一切都中規中矩。
|
|
2、GAE 速度怎么樣?
說實話,很一般,Google 的粉絲不要拍磚哦,我這有證據。下面有兩個網址,是同一個的 Flex 留言板程序,數據也一樣。
第一個在美國的一個免費虛擬主機上,速度帶寬都有限制。
第二個在 GAE 上,自己比較下吧,GAE 要慢很多。
要是同國內付費的虛擬主機比較,可能差距更大。
普通虛擬主機
Google App Engine
3、GAE 數據庫好使嗎?
還不錯。但是 Google 應該在現有的 API 上再簡單的包裝一層,立刻就可以減少 80% 的重復代碼。
比如,原先 PHP 版的留言板,在用 CodeIgniter 框架的情況下,插入一條留言,只用一條語句。而現在要幾十條語句。只要簡單再包裝一下,應該可以達到類似的效果。
4、GAE 配額都有什么限制?
限制的種類非常多,但是配額數都夠用了。經過三四天的折騰,CPU 也才用了0.06個小時。
其他包括各種 API 調用次數也都是有限制的,我為了搬家,抓取原來的數據,使用了16次 UrlFetch API,好在配額六十多萬次,夠用了。
程序上傳發布一個月只能250次,我現在用了9次,問題也不大。
用的最多的是 Datastore API ,已經用了一千多次了,但是配額是一千萬次,哈哈,夠用了吧。
歡迎大家來我的新家瘋狂留言,進行殘酷的壓力測試,看看能不能把它刷爆,呵呵。
我的GAE主頁是:http://myqiao-app.appspot.com/exercise/
下圖是配額使用情況表:
Requests
Quotas are reset every 24 hours. Next reset: 2 hours
Resource |
Daily Quota |
Rate  |
CPU Time |
|
0% |
0.06 of 46.30 CPU hours |
Okay |
Requests |
|
0% |
339 of 1333328 |
Okay |
Outgoing Bandwidth |
|
0% |
0.01 of 10.00 GBytes |
Okay |
Incoming Bandwidth |
|
0% |
0.00 of 10.00 GBytes |
Okay |
Secure Requests |
|
0% |
0 of 1333328 |
Okay |
Secure Outgoing Bandwidth |
|
0% |
0.00 of 10.00 GBytes |
Okay |
Secure Incoming Bandwidth |
|
0% |
0.00 of 10.00 GBytes |
Okay |
Datastore
Datastore API Calls |
|
0% |
1607 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.01 of 116.00 GBytes |
Okay |
Datastore CPU Time |
|
0% |
0.04 of 62.11 CPU hours |
Okay |
Mail
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% |
16 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 |
|
4% |
9 of 250 |
Okay |
|
posted on 2009-05-09 14:28
左洸 閱讀(2993)
評論(7) 編輯 收藏