简体   繁体   English

如何在AWS Lambda 24/7上运行python脚本

[英]How can I run my python script on AWS lambda 24/7

是否可以在没有5分钟限制的情况下在AWS lambda 24/7上运行我的python脚本?

That is not the purpose of AWS Lambda. 那不是AWS Lambda的目的。 If you want to run something 24/7, you'll be better off using an ec2 instance. 如果您想以24/7的速度运行某些程序,最好使用ec2实例。

You could create one Lambda that runs every 5 minutes and creates a new Lambda that runs your code. 您可以创建一个每5分钟运行一次的Lambda,并创建一个可以运行您的代码的新Lambda。 You would just have to have your program work in such a way that it can be interrupted every 5 minutes. 您只需要使程序以每5分钟中断一次的方式工作即可。

However, this is not really the point of Lambda. 但是,这并不是Lambda的重点。 You might consider using a virtual machine on EC2 or an Elastic Beanstalk instance, which is also serverless but designed to run persistent applications. 您可能会考虑在EC2上使用虚拟机或Elastic Beanstalk实例,该实例也是无服务器的,但旨在运行持久性应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM