@@ -105,6 +105,9 @@ resource "aws_launch_configuration" "launch_configuration" {
105105 sudo yum install java-${ var . language_version } -amazon-corretto -y
106106 fi
107107
108+ # enable ec2 instance connect for debug
109+ sudo yum install ec2-instance-connect -y
110+
108111 # Copy in CW Agent configuration
109112 agent_config='${ replace (replace (file (" ./amazon-cloudwatch-agent.json" ), " /\\ s+/" , " " ), " $REGION" , var. aws_region )} '
110113 echo $agent_config > amazon-cloudwatch-agent.json
@@ -128,12 +131,14 @@ resource "aws_launch_configuration" "launch_configuration" {
128131 OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
129132 OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
130133 OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${ var . test_id } \
131- nohup java -jar main-service.jar &> nohup.out &
134+ nohup java -jar -XX:+UseG1GC main-service.jar &> nohup.out &
132135
133136 # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
134137 sleep 30
135138
136139 # Deploy Traffic Generator
140+
141+ " " \
137142 sudo yum install nodejs aws-cli unzip tmux -y
138143
139144 # Bring in the traffic generator files to EC2 Instance
@@ -224,7 +229,7 @@ resource "null_resource" "remote_service_setup" {
224229 OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
225230 OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
226231 OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${ var . test_id } \
227- nohup java -jar remote-service.jar &> nohup.out &
232+ nohup java -XX:+UseG1GC - jar remote-service.jar &> nohup.out &
228233
229234 # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
230235 sleep 30
0 commit comments