Long running script in Google Cloud

与世无争的帅哥 提交于 2019-12-25 09:40:15

问题


I have a piece of code, based on NodeJs, that does not serve any HTTP request, but monitors some online systems and sends report emails. This code is run by a shell script and keeps running 24x7.

Which Google Cloud offering is best suited to host this?

I tried with App Engine, but after one hour of console inactivity, the console exists and the script stops running.

I am not sure if Compute Engine would be best for this. I can host this in AWS EC2, it would work there... but wondering about Google.

Any tips appreciated.

Thanks


回答1:


This can be done with a simple Python app running in App Engine Standard Platform. See this post for details.




回答2:


If you're able to modify it so it can run periodically you could run it on AWS Lambda with a schedule as trigger and use SES to send out e-mails.

Alternatively, if you have control over the "online systems", you could use CloudWatch custom metrics and create alerts based on the thresholds of your metrics.

If you must use Google Cloud, you could use Google Cloud Functions instead of AWS Lambda, and Google Cloud Monitoring / Logging.



来源:https://stackoverflow.com/questions/44149687/long-running-script-in-google-cloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!