AWS Lambda scheduled task with less than 1 minute frequency

We are trying to develop a real lambda-based application in which some tasks must be performed in variable frequency graphs. They actually polled the data, and at certain times of the day this survey can be as slow as every hour, while at other times it should be once per second. I considered scheduling options (for example, Using AWS Lambda with scheduled events and AWS re: Invent 2015 | (CMP407) Lambda as Cron: Scheduling calls in AWS Lambda), but it seems that without spinning an instance of EC2 or a long lambda, there is no built-in way to shoot lambda at a frequency of less than one minute. The lambda velocity expression does not take place in seconds. Is there a way to do this without an EC2 instance or a long lambda? Ideally, this can be done without additional planning costs.

+8
source share
5 answers

Currently, lambda functions are called at least every 1 minute from Cloudwatch scheduling events.

A solution that may work will be as follows:

Install an EC2 instance and from the program that you will run as a background job, use aws sdk to call your lambda function. Example:

while True:
  invoke lambda function via aws sdk
  sleep for x seconds
+5

AWS Lambda 5 5 .

, AWS Lambda 5 , EC2, . AWS Lambda, 5 , 5 , AWS Lambda .

, AWS Lambda, 5 , , .


UPDATE

CloudWatch 1 . , ​​ , . , , - .

+3

EC2, , . .

, Lambda. , ?

+2

EC2 , AWS, CloudWatch Events (. Emanuele Menga), , , ( 2019 ) :

( , 1 = 31536000 )

:

  • $ 0,0250 1000
  • 2 (Wait, Task) + 1 ( /)
  • 31536000 * (2 + 1/60) * 0.0250/1000= 1589,94 . 65,70 . (2 )

-:

  • $ 0,000000208 100 ( 128 )
  • 31536000 * 0.000000208 * 10= $ 65,595488/

EC2 :

  • t3a.nano $ 0,0047 $ 0,0014 Spot
  • 31536000 * 0,0047/3600 = 41,172 . / 12,264 . / Spot

, , , , .

+1

, , , .. ECS, EKS

0

All Articles