ssk
ssk

Reputation: 9255

Understanding front end instance hours on google app engine

My app already shows:

Front end instance hours:

Frontend Instance Hours     62% 62%     17.35 of 28.00 Instance Hours 

app.yaml:

version: 1
runtime: python27
api_version: 1
threadsafe: true

inbound_services:
- xmpp_message
- xmpp_presence
- xmpp_subscribe
- xmpp_error

libraries:
- name: django
  version: "1.2"

Does using the xmpp service increase the front end instance hours? I need xmpp service to send notifications to gchat client. The app is serving less than 10 requests an hour. How do I optimize my front end instance hours on GAE?

Any useful resources/tutorial?

Upvotes: 1

Views: 3040

Answers (2)

Nick Johnson
Nick Johnson

Reputation: 101139

Frontend instance hours simply records the total amount of time an instance of your app is running. If you have two instances running for an hour, you will be billed for two instance hours. App Engine automatically scales frontend instances up and down as needed to serve your traffic, but at low traffic levels such as you are dealing with, at least one instance needs to be running in order to serve traffic, so you'll get billed more or less the same amount for 1 request every 10 minutes as you will for 1 request a second.

No service, including XMPP, intrinsically increases instance hours consumed. Serving requests generated by the XMPP service will take up processing time on instances just like any other request, of course, which may cause App Engine to spin up more instances, or keep them running when that wouldn't otherwise be necessary.

Upvotes: 3

Dan Holevoet
Dan Holevoet

Reputation: 9183

In most cases, yes, using the XMPP service will use front end instance hours. You can see a view of the number of currently running instances within the admin console. From the Admin Console documentation on dynamic instances (which is most likely what you are using):

Billing begins when the instance starts and ends fifteen minutes after the instance shuts down. You will be billed only for idle instances up to the number of maximum idle instances set in the Performance Settings tab of the Admin Console.

Depending on the architecture of your application (and how frequently it handles requests) you may have one or more instances running for a significant part of the day.

If you need to make your 10 requests evenly distributed throughout each hour, you may want to use discounted reserved instances (as noted on Managing Resources). If you can squeeze the requests into a smaller window, your instance will have a chance to shut down, thus lowering your bill.

Upvotes: 1

Related Questions