2

Judging by a conversation I had on #appengine at irc.freenode.net, I'm clearly not the only person baffled by GAE pricing, so I figured I'd throw this up on StackOverflow and ask for clarity. Essentially: given an app with the figures below, what should its "CPU time" bill be per year?

Suppose:
h = Google App Engine's charge per hour for CPU time. Currently, h = $0.10
f = Google App Engine's daily free quota of CPU hours. Currently, I think* f = 2853.5
t = total registered users
s = simultaneous users. Assume = t * 0.2
e = (requests/second)/simultaneous user. Assume = 0.5
r = requests/sec = s * e
R = requests/day = r * 3600 * 24
p = CPU hours/request. Assume 150ms/request. I.e. assume p = 0.15/3600
c = CPU hours/sec = r * p
C = CPU hours/day = c * 3600 * 24
y = average number of days in a year = 365.25 B = CPU time bill per year = (C - f) * h * y

Therefore, C = t * 0.2 * 0.5 * (0.15/3600) * 3600 * 24
So suppose I get 10000 registered users, that means C = 3600.

In that case:
B = (3600 - f) * h * y = 9146.5 * $0.10 * 365.25 = $40415 to the nearest dollar

Is that right, or have I misunderstood what CPU time is, how it is priced, or how the quotas work?

*The free daily quota is not clearly expressed, but I think it's 6.5 hours for general use plus 2,487 hours for datastore manipulation: 2853.5 hours/day in total, assuming that my app mostly spends its time handling requests by using a controller to generate views on the models in the datastore, and allowing CRUD operations on those models.

NB. For a transcript of the IRC discussion, please see the edit history of this question.

4

1 に答える 1

6

あなたの見積もりの​​いくつかは高すぎると思います。

サイトの登録ユーザーの 20% が常にサービスを使用しています。これは非常に高いです。平均的な人は 5 つの Web サイトにしか登録しておらず、1 日 24 時間、これらの 5 つのサイトを閲覧していることになります。平均的な人は 50 の Web サイトに登録されており、それらすべてを合わせて 1 日 2.4 時間ブラウジングしているという推定に近いと思います。

同時ユーザーあたり 0.5 リクエスト/秒。これはサイトによって異なりますが、通常のパターンは、ページ テンプレートをレンダリングするための 1 つの動的リクエストと、画像、CSS、および JavaScript をレンダリングするための一連の静的ハンドラを持つことです。静的リクエストでは、CPU 料金は発生しません。ページごとに 1 つの動的リクエストがある場合、見積もりでは、平均的なユーザーが毎秒 2 回新しいページに移動していると想定されます。5秒に1回がより合理的だと思います。

この種の見積もりが最初から特に役立つかどうかはわかりません。サイトのユーザー数が 10,000 人であろうと 1,000 万人であろうと、トラフィックを収益化しているか、損失を出しているかのどちらかです。1 リクエストあたり平均 150 ミリ秒の CPU 時間 (1 時間あたり 0.10 ドル) の場合、1 ドルで 240,000 リクエストを購入できます。240,000 ページ ビューから 1 ドルの広告収入を取り戻せない場合は、何かが間違っています。

これらの見積もりには、帯域幅やディスク ストレージに支払っている金額や、平日の午後に Google がデータストアを読み取り専用モードにするたびに失う金額は考慮されていません。または、データストアを学習するための開発コスト。これにより、従来のリレーショナル データベースにはなかった多くの制約が課せられます。また、スケーラビリティで得られるものも考慮に入れません。あなたのサイトの人気があまり高くない場合 (圧倒的多数のインターネットのように)、おそらく無料の割り当てに収まり、何も支払うことはありません。非常に人気が高くなると、最初から適切に設計されていれば、アプリは自動的にスケーリングされます。これは EC2 や Azure とは対照的です。EC2 や Azure では、誰かがヒットしているかどうかにかかわらず、インスタンスごとに最大 77 ドルを支払っています。

于 2010-11-20T15:27:00.923 に答える