Question

I have an EC2 instance configured the way I want it. Tomcat started up, some big >>100MB files loaded into memory waiting for the first request to come in. Request comes in and is handles in 2ms. Easy enough. Now I take an image of this EC2 and use this in an elastic Beanstalk. When the beanstalk starts up it has a min of 1 instance which it creates. Then waits for request which duely comes along. Now, because it is the first request the servlet has to load up the very large files to RAM so the first request takes almost 10ms. Now I can have some code that loads up the files prior to getting a request but I was wondered is there anyway to take an AMI image of a running EC2 instance and have the beanstalk spawn new instances as it needs them which are in a running state with everything loaded to RAM as opposed to havinig to boot the instance up?

Was it helpful?

Solution

An instance will always be booted as a normal server would: Clean memory.

Have you considered something like elasticache (AWS)/memcache (general) for that kind of thing?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top