Reputation: 31
I have a java application which is deployed to Elastic Beanstalk.
There are two environments: test and production, production is configured to use bigger instances than test.
With the default config for java environment max heap size is around 1/4 of all instance RAM (for 2G RAM instance it's about 0.5G) and I'd like to increase it (-Xmx
).
Available options are:
.ebextensions
- this way config for both environment will be the same (not good)Procfile
- the same as aboveEnvironment properties
in console does not work - those properties are passed to application (-D
), not to java
.Any ideas how to set -Xmx
depending on environment / available memory size?
Thanks
Upvotes: 3
Views: 1765
Reputation: 9866
I think of two ways to resolve the issue:
two sets of .ebextensions
, one for test
and one for prod
, when you do the app package, just put .ebextensions
under webapp
folder, it will be picked up by Beanstalk
customized catalina.sh
to grep
the free memory and adjust the -Xmx
accordingly.
Upvotes: 1