Skip to content

Commit

Permalink
[ALS-7751] Increase resources for BDC (#165)
Browse files Browse the repository at this point in the history
* Adjust Java memory settings and upgrade EC2 instance type

* Update Java options in dictionary-docker.sh

Added `-XX:+PrintFlagsFinal` to `JAVA_OPTS` to print JVM flags at runtime for debugging purposes. This will help in confirming the active JVM settings during execution.

* Increase Java heap size from 16g to 24g in docker script

The JAVA_OPTS variable in dictionary-docker.sh has been updated to allocate 24GB of heap memory instead of 16GB. This change aims to improve performance and handle larger workloads efficiently.

* Fix JAVA_OPTS environment variable declaration

* Increase resource allocations for HPDS and psama services

Upgraded instance types for auth-hpds and open-hpds, and increased memory allocations for psama and open_hpds. Added swap space configuration for Wildfly to improve performance under load.
  • Loading branch information
Gcolon021 authored Nov 4, 2024
1 parent a5d37ac commit 75b0fe7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app-infrastructure/auth-hpds-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "aws_instance" "auth-hpds-ec2" {
count = var.include_auth_hpds ? 1 : 0

ami = local.ami_id
instance_type = "m5.12xlarge"
instance_type = "m5.24xlarge"

subnet_id = local.private2_subnet_ids[0]

Expand Down
2 changes: 1 addition & 1 deletion app-infrastructure/open-hpds-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "aws_instance" "open-hpds-ec2" {
count = var.include_open_hpds ? 1 : 0

ami = local.ami_id
instance_type = "m5.2xlarge"
instance_type = "m5.4xlarge"

subnet_id = local.private2_subnet_ids[0]

Expand Down
2 changes: 1 addition & 1 deletion app-infrastructure/scripts/auth_hpds-user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sudo docker run --name=$CONTAINER_NAME \
--log-driver syslog --log-opt tag=auth-hpds \
-v /opt/local/hpds:/opt/local/hpds \
-p 8080:8080 \
-e JAVA_OPTS=" -XX:+UseParallelGC -XX:SurvivorRatio=250 -Xms10g -Xmx128g -Dserver.port=8080 -Dspring.profiles.active=bdc-auth -DCACHE_SIZE=2500 -DID_BATCH_SIZE=5000 -DALL_IDS_CONCEPT=NONE -DID_CUBE_NAME=NONE " \
-e JAVA_OPTS=" -XX:+UseParallelGC -XX:SurvivorRatio=250 -Xms10g -Xmx360g -Dserver.port=8080 -Dspring.profiles.active=bdc-auth -DCACHE_SIZE=2500 -DID_BATCH_SIZE=5000 -DALL_IDS_CONCEPT=NONE -DID_CUBE_NAME=NONE " \
-d $HPDS_IMAGE

echo "Waiting for container to initialize"
Expand Down
4 changes: 3 additions & 1 deletion app-infrastructure/scripts/dictionary-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ s3_copy "s3://${stack_s3_bucket}/containers/application/dictionary-api.tar.gz" "

# load docker images
DICTIONARY_API_IMAGE=`sudo docker load < /home/centos/dictionary-api.tar.gz | cut -d ' ' -f 3`
JAVA_OPTS=" -Xmx24g "

sudo docker stop dictionary-api
sudo docker rm dictionary-api
sudo docker run \
-e JAVA_OPTS="$JAVA_OPTS" \
--env-file /home/centos/picsure-dictionary.env \
--name dictionary-api \
--restart always \
--network picsure \
--log-driver syslog --log-opt tag=dictionary-api \
--restart always \
-d $DICTIONARY_API_IMAGE
-d $DICTIONARY_API_IMAGE
2 changes: 1 addition & 1 deletion app-infrastructure/scripts/open_hpds-user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sudo docker run --name=$CONTAINER_NAME \
--log-driver syslog --log-opt tag=open-hpds \
-v /opt/local/hpds:/opt/local/hpds \
-p 8080:8080 \
-e JAVA_OPTS=" -XX:+UseParallelGC -XX:SurvivorRatio=250 -Xms10g -Xmx40g -Dserver.port=8080 -Dspring.profiles.active=open -DCACHE_SIZE=2500 -DSMALL_TASK_THREADS=1 -DLARGE_TASK_THREADS=1 -DSMALL_JOB_LIMIT=100 -DID_BATCH_SIZE=5000 " \
-e JAVA_OPTS=" -XX:+UseParallelGC -XX:SurvivorRatio=250 -Xms10g -Xmx60g -Dserver.port=8080 -Dspring.profiles.active=open -DCACHE_SIZE=2500 -DSMALL_TASK_THREADS=1 -DLARGE_TASK_THREADS=1 -DSMALL_JOB_LIMIT=100 -DID_BATCH_SIZE=5000 " \
-d $HPDS_IMAGE

echo "Waiting for container to initialize"
Expand Down
2 changes: 1 addition & 1 deletion app-infrastructure/scripts/psama-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ s3_copy "s3://${stack_s3_bucket}/releases/psama/psama.tar.gz" "/home/centos/psam

# This script is responsible for starting or updating the psama container
PSAMA_IMAGE=$(sudo docker load < /home/centos/psama.tar.gz | cut -d ' ' -f 3)
PSAMA_OPTS="-Xms1g -Xmx2g -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true"
PSAMA_OPTS="-Xms2g -Xmx8g -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true"

# Add remote debugging options if enabled.
# To enable remote debugging, set the second script argument to true.
Expand Down
6 changes: 6 additions & 0 deletions app-infrastructure/scripts/wildfly-user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ s3_copy() {
echo "waiting for terraform to render files"
sleep 300

# Add swap space
sudo dd if=/dev/zero of=/swapfile count=15360 bs=1MiB
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# make picsure network
sudo docker network create picsure
sudo mkdir /var/log/{wildfly-docker-logs,wildfly-docker-os-logs,psama-docker-logs,psama-docker-os-logs}
Expand Down
2 changes: 1 addition & 1 deletion app-infrastructure/wildfly-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "template_cloudinit_config" "wildfly-user-data" {

resource "aws_instance" "wildfly-ec2" {
ami = local.ami_id
instance_type = "m5.2xlarge"
instance_type = "m5.4xlarge"

subnet_id = local.private2_subnet_ids[0]

Expand Down

0 comments on commit 75b0fe7

Please sign in to comment.