CC Lab4
CC Lab4
APP ENGINE: DEPLOY A WEB APPLICATION ON APP ENGINE WITH AUTOMATIC SCALING
ENABLED.
Google App engine is a Platform -as -a -Service (PaaS) that lets you build, deploy and host web
applications on Google’s infrastructure handling infrastructure management and scaling
automatically.
Step3: Click on create application-> then select the area [asia-south1]->Click Next->
Folder structure:
/my-app-demo
• Open cloud Shell application in a new tab and create a project directory
mkdir my-app-demo
app = Flask(__name__)
@app.route('/')
def home():
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
Now, Type CTRL+S to save your code, then CTRL+X Y then enter key
nano requirements.txt
Flask==2.0.1
gunicorn
runtime: python311
automatic_scaling:
min_instances: 1
max_instances: 5
target_cpu_utilization: 0.65
target_throughput_utilization: 0.75
handlers:
12 script: auto
[optional**If your getting bad gateway error while viewing your app then install
Click on the https project link where the app is been deployed
Step 8: Monitor and Manage Your Application
• Automatic Scaling: The configuration in app.yaml enables automatic scaling based on CPU
and throughput utilization. You can adjust the min_instances and max_instances values as
needed.