简体   繁体   English

AWS Elastic Beanstalk 中的容器选项

[英]Container Options in AWS Elastic Beanstalk

We have deployed a java webapplication in Elastic Beanstalk with the minimum instance count 1 and max instance count 2 for Autoscaling.我们在 Elastic Beanstalk 中部署了一个 java 的 Web 应用程序,其中最小实例数为 1,最大实例数为 2,用于自动缩放。 The custom AMI we are using is c1.medium with Sun JDK 6.我们使用的自定义 AMI 是带有 Sun JDK 6 的 c1.medium。

The environment status changed to yellow and then red.环境状态变为黄色,然后变为红色。 After checking into the log file from the snapshot logs we found a exception - Caused by: java.lang.OutOfMemoryError: Java heap space.从快照日志检查日志文件后,我们发现了一个异常 - Caused by: java.lang.OutOfMemoryError: Java heap space。 Assuming this could be one of the possible reason for the Environment failure.假设这可能是环境失败的可能原因之一。 The settings that we have configured in the Environment Container option are我们在环境容器选项中配置的设置是

Initial JVM Heap Size (MB) - 256M初始 JVM 堆大小 (MB) - 256M

Maximum JVM Heap Size (MB) - 512m The maximum heap size the java virtual machine will ever consume, specified on the JVM launch command line using -Xmx.最大 JVM 堆大小 (MB) - 512m java 虚拟机将消耗的最大堆大小,在 JVM 启动命令行上使用 -Xmx 指定。

Maximum JVM Permanent Generation Size (MB) - 512m最大 JVM 永久代大小 (MB) - 512m

Should i increase the Heap size from 512m to more or is it fine.我应该将堆大小从 512m 增加到更多还是没问题。

I think your maximum JVM Permanent Generation Size is too big.我认为您的最大 JVM 永久代大小太大。 Here is the documentation of AWS :这是AWS 的文档

JVM Options JVM 选项

The heap size in the Java Virtual Machine affects how many objects can be created in memory before garbage collection—a process of managing your application's memory—occurs. Java 虚拟机中的堆大小会影响 memory 在垃圾回收(管理应用程序内存的过程)发生之前可以创建的对象数量。 You can specify an initial heap size and a maximum heap size.您可以指定初始堆大小和最大堆大小。 A larger initial heap size allows more objects to be created before garbage collection occurs, but it also means that the garbage collector will take longer to compact the heap.较大的初始堆大小允许在垃圾收集发生之前创建更多对象,但这也意味着垃圾收集器将花费更长的时间来压缩堆。 The maximum heap size specifies the maximum amount of memory the JVM can allocate when expanding the heap during heavy activity.最大堆大小指定 memory 在繁重活动期间扩展堆时 JVM 可以分配的最大数量。

In the Edit Configuration window, you can set the initial and the maximum JVM heap sizes using the Initial JVM Heap Size (MB) and Maximum JVM Heap Size (MB) boxes.在编辑配置 window 中,您可以使用初始 JVM 堆大小 (MB) 和最大 JVM 堆大小 (MB) 框设置初始和最大 JVM 堆大小。 The available memory is dependent on the Amazon EC2 instance type.可用的 memory 取决于 Amazon EC2 实例类型。 For more information about the Amazon EC2 instance types available for your AWS Elastic Beanstalk environment, go to Instance Families and Types in the Amazon EC2 User Guide.有关适用于您的 AWS Elastic Beanstalk 环境的 Amazon EC2 实例类型的更多信息,请参阅 Amazon EC2 用户指南中的实例系列和类型 go。

The permanent generation is a section of the JVM heap that is used to store class definitions and associated metadata.永久代是 JVM 堆的一部分,用于存储 class 定义和关联的元数据。 To modify the size of the permanent generation, type the new size in the Maximum JVM Permanent Generation Size (MB) box要修改永久代的大小,请在最大 JVM 永久代大小 (MB) 框中键入新大小

I found this Rimuhosting how-to article quite good in explaining Xmx settings.我发现这篇Rimuhosting 操作指南文章很好地解释了 Xmx 设置。

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

相关问题 开发环境和AWS elastic beanstalk - Development environment and AWS elastic beanstalk 无法安装弹性 beantalk AWS - Unable to install elastic beanstalk AWS 将 django 部署到 AWS Elastic Beanstalk - deploy django to AWS Elastic Beanstalk 如何与 Elastic Beanstalk 多容器环境共享 AWS EC2 实例 - How to Share AWS EC2 Instances with Elastic Beanstalk Multi-Container Environments AWS Elastic Beanstalk:环境启动失败 - AWS Elastic Beanstalk: Environment Fails to Launch 如何在多个 AWS Lambda 和 Elastic Beanstalk 应用程序之间共享模块? - How to share modules across multiple AWS Lambda and Elastic Beanstalk applications? 如何在 AWS Elastic Beanstalk 上设置和使用 Laravel 调度? - How do I setup and use Laravel Scheduling on AWS Elastic Beanstalk? AWS Elastic Beanstalk 负载均衡器未显示 SSL 证书 - AWS Elastic Beanstalk load balancer not showing SSL certificate AWS:Elastic Beanstalk 和 Auto Scaling(内存不足时) - AWS: Elastic Beanstalk and Auto Scaling (When Out of Memory) Azure Pipeline 部署到 AWS Elastic Beanstalk 任务失败,因为缺少 web.config - Azure Pipeline Deploy To AWS Elastic Beanstalk Task failes because web.config is missing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM