I've setup an Elastic Beanstalk instance on the .NET (Windows/IIS) platform. I've deployed a .NET Core application there that does 2 things:
Item 2 works great - I drop off a message and less than a second later I get an SMS message on my phone.
The problem is that AWS puts the application to sleep after a period of inactivity. And that causes the RabbitMQ listener to also go to sleep. This results in undelivered SMS messages. Until I wake up the instance by going to the URL assigned to my by Elastic Beanstalk.
How do I make my Elastic Beanstalk instance not go to sleep? Is there something I can call from C# code to prevent it from doing so?
Here is what I implemented following this article .
In this project, any .config file will be used as config for your elastic beanstalk, they will be applied in alphabetical order. So create a file containing the following : (see in the link, the white space is important and I can't seem to get it right here...)
commands: setIdleTimeoutToZero: cwd: "C:\\windows\\system32\\inetsrv" command: "appcmd set apppool /apppool.name:DefaultAppPool /.processModel.idleTimeout:0.00:00:00"
Make sure the file is always copied to output.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.