Are crons executed globally or per app instance (i.e. load dependent)? - google-app-engine

If I define a cron in App Engine to execute "every 10 minutes" - does that mean:
(a):
"every 10 minutes per app instance (i.e. load dependent)"
(b):
"every 10 minutes globally across all instances of the application" (i.e. load independent)?

It is once globally every 10 minutes. Note that the interval refers to the time between jobs. So job 2 will start 10 minutes after job 1 finishes. This might be important if your job is long-running (e.g., if it takes 5 minutes to run, then it will actually start every 15 minutes if you specify "every 10 minutes").

Related

How to make gcp schedule execute tasks at a specific time every hour?

How to set schedule as "every 1 minutes from every hours from HH:10 to HH:15"?
I want the task to be executed at a specific time every hour, but gcp doesn't seem to support it.
In a nutshell,I want to execute the task 5 times per hour.
https://cloud.google.com/appengine/docs/standard/python/config/cronref
"every 1 minutes from every hours from HH:10 to HH:15" not working.
"5 times per hour" would essentially mean every 12 minutes. Try:
schedule: every 12 minutes
If you are using Cloud Scheduler, you can specify a cron:
*/12 * * * *
For running its every 11-15th every hour being 10-15 hours, try using the cron:
11-15 10-15 * * *

Equal intervals between Scheduled tasks in datastore

Consider I have a cron job running in app engine as below,
every 10 minutes from 00:00 to 02:00
My doubt is, If the task takes 5 mins to complete, Will the next task gets executed on the 15th minute or in the 10th minute?
My requirement is as below.
Task #1 starts at 00:00, runs for 4 mins.
Task #2 starts at 00:10, runs for 1 min.
Task #3 starts at 00:20, runs for 3 mins and so on!
Thanks,
Karthick.
You can find an answer in the documentation:
By default, an interval schedule starts the next interval after the last job has completed. If a from...to clause is specified, however, the jobs are scheduled at regular intervals independent of when the last job completed. For example:
every 2 hours from 10:00 to 14:00
This schedule runs the job three times per day at 10:00, 12:00, and 14:00, regardless of how long it takes to complete.

Go - AppEngine - Performance

I have Go app that receives JSON in POST and stores it in a Datastore (AppEngine)
The statistic for first 24 hours:
40 entities were stored in datastore. (every entity is small less 1K, JSON with 7-10 fields)
7.20 Instance hours consumed.
7 hours is much more then I expected. I expected to see 7 seconds or even 1 second.
Is that normal?
Instance hours means how long your app standup. As GAE will go idle if no request in 15 minutes, in your case, if there is a request every 15 minutes, you may max cost 40req*15min/60=10hour instance hours. So 7.2 instance hours is possible.

Backend instance hours count

I'm using the AppEngine's Backend instances and the daily free quota is 9 instance hours. However, I've been using a Backend with 10 instances for around 16-17 minutes and my usage has already crossed 66%.
The calculation I had in my mind was 17 mins * 10 instances = 170 mins ~ 2.8hrs which is definitely less than 66% of 9 hours.
Can someone explain me the billing scheme here?
From https://developers.google.com/appengine/docs/quotas#Requests:
Instance Hours (billable) In general, instance usage is billed on an
hourly basis based on the instance's uptime. 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. Runtime overhead is counted against the instance
memory.
In your case, you'd have 17min of activity + 15min after activity = 32 minutes. So 320 minutes (32 * 10) is pretty close to 2/3 of 9 hours.
You should be able to see the details in the Usage History of your application.

recycle time reporting service

by default the recycle time for reporting service is 720 minutes (12 hours). It is the reportserver.config file
720
Now it happens every 2 o'clock. so consequently, it happens twice a day 2 AM and 2 PM. Now the problem is we cannot have it recycled during business hours (2 PM). how do I set this to occur only # 4 AM?
thanks
From http://msdn.microsoft.com/en-us/library/ms157273.aspx
"RecycleTime: Specifies a recycle time for the application domain, measured in minutes. Valid values range from 0 to maximum integer. The default is 720."
I would interpret this as, after running X minutes, the app domain will recycle. If you want it to recycle every 24 hours, set it to 1440 minutes (24h x 60m).
If you want it to happen at 4am, I would assume you need to recycle it manually at 4AM. This would presumably reset the timer and force the auto recycle (every 1440 minutes) to occur again after 24 hours (or at 4am).

Resources