shlogg · Early preview
Tom-Takeru @tom-takeru

Preventing Server Sleep With Google Apps Script: A Practical Example

Prevent backend server sleep with Google Apps Script: ping health-check API every 5min using GAS, staying within free usage limits (6min exec time, 20k URL fetches/day)

When using Google Apps Script (GAS), one common concern is how much you can achieve within the free usage limits. In this article, we'll summarize these limits and demonstrate a practical example of how to prevent your backend server from sleeping by regularly pinging its health-check API.

  
  
  Main Limits of GAS Free Tier

Below are the primary limitations of GAS’s free usage:


Item
Limit


Maximum execution time per script run
6 minutes (360 seconds)

Total daily execution time
90 minutes (5400 seconds)

Number of triggers
Maximum 20 triggers per script

URL Fetch calls
20,000 requests...