high resource usage than expected

51 views
Skip to first unread message

YH Yang

unread,
Jul 17, 2018, 2:21:00 PM7/17/18
to google-a...@googlegroups.com
Hi,

I have an python app on app engine standard environment for years, and its resource usage is stable. 
However, I deploy new code today to use Firebase Cloud Message admin sdk, but I have several high resource usage than my expectation.
(To be specific, they are backend instance hours: 251 instance-hours, requests: 100000, outgoing bandwidth: 4GB, incoming bandwidth: 8GB, datastore write operation: 50000)
In the below dashboard picture, it shows instances for all services, how is it possible for the backend to use 250+ instances hours? (From the day begin, my work on backend runs about 2~3 minutes few times. From the current load URI, I only have about 100 request, why quota shows I have 100K requests)

It is too much over my daily spending limit, how can I resolve or figure out what's the problem?

Thank for your support.
 YH Yang


high_backend_instance_hours.png

Jordan (Cloud Platform Support)

unread,
Jul 17, 2018, 7:38:01 PM7/17/18
to Google App Engine
If you do not want to use more than the free App Engine quotas, it is recommended to set 'max_instances' = 1 for basic scaling, as you currently have two instances running which will indeed exceed the free quota. 

As for the excess requests and bandwidth, I am not sure where you are seeing these details, but it is recommended to add logging to your application code to ensure that you do not have any looping logic that is making excess API calls to Firebase. You can also use Stackdriver Logging to see how many actual requests were handled by your application.

- Note that Google Groups is reserved for general product discussions and is not for technical support. If you confirm that you are not making that many requests, but end up being billed for it, it is recommended to open a free Billing support case with your additional detailed findings to have this properly investigated.

YH Yang

unread,
Jul 17, 2018, 9:45:24 PM7/17/18
to google-a...@googlegroups.com
Hi Jordan, thanks for reply.

I had sent the form to Google Cloud Platform Billing Support, and in the mean time, I am looking for general discussion about high spike resource usage for backend/request/bandwidth.

My backend is B1, and have 'max_instances' = 1 set for basic scaling. I think the picture shows 2 instances because I have other services (modules) running which use frontend instances. When I found high spike resource usage, the timestamp is between 11PM and Wed 18. My daily billing start from 3PM. I don't understand why my B1 instance can consume 251 instance hours between 3PM to Wed 18. From my usage history, the backend instance hours is only 3~5 instance hours in the passed 90 days.
About the excess requests and bandwidth, I see it from quota page in app engine (picture attached)

console.cloud.google.com_appengine_quotadetails_project=castleage-helper&folder&organizationId.png

From below picture, my service use backend instance (B1) only have at most 1 instance. 
console.cloud.google.com_appengine_instances_folder=&organizationId=&project=castleage-helper&serviceId=cron-backend&versionId=product&instancesTablesize=20&graph=AE_INSTANCES (1).png
​From stackdriver logging, and it matches 'Current load' table in appengine console, my app should have request < 100. Not sure why request/bandwidth is excess the quota so much.

The only special thing I did recently is using Firebase Cloud Message Admin SDK to send message to my phone (and it works), but the code is running in a service which uses frontend instead of backend. Is it possible this sdk use a lot of my bandwidth and requests?


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/8041b2f3-09ae-4d4e-b41c-ee38de31a6e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordan (Cloud Platform Support)

unread,
Jul 18, 2018, 3:59:10 PM7/18/18
to Google App Engine
As you mentioned, your App Engine resource usage is a combination of all of your services and versions. Mainly your 'api' and 'cron-backend' services, as they have the most instance usage due to URLFetch requests and Datastore/Memcahce interactions. Your 'api' service also saw a spike in errors which could have caused all of those failed requests to retry multiple times, causing an increase in networking usage.

As previously recommended, you should work with the billing team to confirm your specific case, and ensure that other versions of services have been stopped to reduce instance hours, and that errors are fixed to prevent spikes in retry traffic resulting in excess instances and network usage.  
Reply all
Reply to author
Forward
0 new messages