Skip to content

Commit

Permalink
Merge pull request #7155 from IQSS/7089-memory-tests
Browse files Browse the repository at this point in the history
get memory tests running on Payara, 5.0 RC #7089
  • Loading branch information
kcondon committed Aug 5, 2020
2 parents 7e6f5eb + 4d04212 commit 8223e27
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions scripts/tests/ec2-memory-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ All the other pieces will be downloaded automatically (from the
either locally, where you're running the script, or on the newly
created instance.

The main reason a dedicated Ansible config file is used is to enable "sampledata".

Run the script as follows:

```
Expand Down
22 changes: 12 additions & 10 deletions scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ then
EC2_HTTP_LOCATION="<EC2 INSTANCE HTTP ADDRESS>"
fi

DATAVERSE_APP_DIR=/usr/local/glassfish4/glassfish/domains/domain1/applications/dataverse; export DATAVERSE_APP_DIR
DATAVERSE_APP_DIR=/usr/local/payara5/glassfish/domains/domain1/applications/dataverse; export DATAVERSE_APP_DIR

# restart glassfish:
# restart app server

echo "Restarting Glassfish..."
echo "Restarting app server..."

# still "glassfish" until Ansible is updated

systemctl restart glassfish

echo "done."

# obtain the pid of the running glassfish process:
# obtain the pid of the running app server process:

GLASSFISH_PID=`ps awux | grep ^glassfi | awk '{print $2}' `; export GLASSFISH_PID
APP_SERVER_PID=`ps awux | grep ^dataver | awk '{print $2}' `; export APP_SERVER_PID

if [ ${GLASSFISH_PID}"x" = "x" ]
if [ ${APP_SERVER_PID}"x" = "x" ]
then
echo "Failed to obtain the process id of the running Glassfish process!"
echo "Failed to obtain the process id of the running app server process!"
exit 1;
fi

Expand All @@ -34,7 +36,7 @@ yum -y install gnuplot >/dev/null

GPLOT=gplot-1.11/gplot.pl; export GPLOT
GPLOTDIST=https://pilotfiber.dl.sourceforge.net/project/gplot/gplot/gplot-1.11.tar.gz; export GPLOTDIST
(cd /tmp; curl --insecure ${GPLOTDIST} 2>/dev/null | tar xzf - ${GPLOT} >/dev/null)
(cd /tmp; curl -L --insecure ${GPLOTDIST} 2>/dev/null | tar xzf - ${GPLOT} >/dev/null)


# Bombard the application with some GET requests.
Expand Down Expand Up @@ -97,7 +99,7 @@ do

# after every {repeat_outer} number of GETs, run jmap and save the output in a temp file:

sudo -u glassfish jmap -histo ${GLASSFISH_PID} > /tmp/jmap.histo.out
sudo -u dataverse jmap -histo ${APP_SERVER_PID} > /tmp/jmap.histo.out

# select the dataverse classes from the histo output:
#grep ' edu\.harvard\.iq\.dataverse' /tmp/jmap.histo.out
Expand All @@ -119,7 +121,7 @@ do
echo

# run jstat to check on GC:
sudo -u glassfish jstat -gcutil ${GLASSFISH_PID} 1000 1 2>/dev/null
sudo -u dataverse jstat -gcutil ${APP_SERVER_PID} 1000 1 2>/dev/null

echo

Expand Down
4 changes: 2 additions & 2 deletions scripts/tests/ec2-memory-benchmark/ec2-memory-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dat
chmod 755 ec2-create-instance.sh

# download the sample data ec2 config:
curl -O https://raw.githubusercontent.com/IQSS/dataverse-sample-data/memory-monitoring-experiments/ec2config_memory_test.yaml
curl -O https://raw.githubusercontent.com/GlobalDataverseCommunityConsortium/dataverse-ansible/master/tests/group_vars/memorytests.yml

# run the script:
./ec2-create-instance.sh -a ec2-memory-benchmark -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g ec2config_memory_test.yaml 2>&1 | tee create-instance.log
./ec2-create-instance.sh -b ${dataverse_branch} -r https://github.com/IQSS/dataverse.git -g memorytests.yml 2>&1 | tee create-instance.log

# obtain the address of the new instance, and the ssh key:

Expand Down

0 comments on commit 8223e27

Please sign in to comment.