Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.

Metrics: PSS for a transfer rate of 1Gb #939

Merged
merged 1 commit into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ GENERATED_FILES = \
tests/metrics/network/network-metrics-cpu-consumption.sh \
tests/metrics/network/network-metrics-memory-pss.sh \
tests/metrics/network/network-metrics-memory-rss-1g.sh \
tests/metrics/network/network-metrics-memory-pss-1g.sh \
tests/lib/test-common.bash

$(GENERATED_FILES): %: %.in Makefile
Expand Down Expand Up @@ -372,6 +373,7 @@ EXTRA_DIST = \
tests/metrics/network/network-metrics-cpu-consumption.sh.in \
tests/metrics/network/network-metrics-memory-rss-1g.sh.in \
tests/metrics/network/network-metrics-memory-pss.sh.in \
tests/metrics/network/network-metrics-memory-pss-1g.sh.in \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jodh-intel when #946 is merged then I can add it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or I can add another PR for the modification of the README

vendor \
data/genfile.sh \
data/cc-bootchart.conf
Expand Down
4 changes: 4 additions & 0 deletions tests/metrics/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ with iperf. PSS is a meaningful representation of the memory applications use.
`network-metrics-memory-rss-1g` measures the Resident Set Size (RSS) memory using smem while running a transfer of one Gb with nuttcp.
RSS is a standard measure to monitor memory usage in a physical memory scheme.

### `network-metrics-memory-pss-1g`

`network-metrics-memory-pss-1g` measures the Proportional Set Size (PSS) memory using smem while running a transfer of one Gb with nuttcp.

## Running the networking tests

Before the network tests can be run, some files must be pre-processed.
Expand Down
78 changes: 78 additions & 0 deletions tests/metrics/network/network-metrics-memory-pss-1g.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

# This file is part of cc-oci-runtime.
#
# Copyright (C) 2017 Intel Corporation
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Description:
# Measures Proportional Set Size memory while running an
# inter (docker<->docker) 1 Gb tranfer rate using nuttcp.
# The selection of 1 Gb as a tranfer rate is because that is
# the maximum that we can be handle in our testing infrastructure.

set -e

SCRIPT_PATH=$(dirname "$(readlink -f "$0")")

source "${SCRIPT_PATH}/../../lib/test-common.bash"
source "${SCRIPT_PATH}/lib/network-test-common.bash"

function pss_memory {
# Currently default nuttcp has a bug
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745051
# Image name
local image=gabyct/nuttcp
# We wait for the test system to settle into a steady mode before we
# measure the PSS. Thus, we have two times - the length of the time the
# test runs for, and the time after which we sample the PSS
# Time for the test to run (seconds)
local total_time=6
# Time in which we sample the PSS (seconds)
local middle_time=3
# Rate limit (speed at which transmitter send data, megabytes)
# We will measure PSS with a specific transfer rate
local rate_limit=1000
# Name of the containers
local server_name="network-server"
local client_name="network-client"
# Arguments to run the client
local extra_args="-d"

setup
local server_command="sleep 30"
local server_address=$(start_server "$server_name" "$image" "$server_command")

local client_command="/root/nuttcp -R${rate_limit}m -T${total_time} ${server_address}"
local server_command="/root/nuttcp -S"
$DOCKER_EXE exec ${server_name} sh -c "${server_command}"
start_client "$extra_args" "$client_name" "$image" "$client_command" > /dev/null

# Time when we are taking our PSS measurement
echo >&2 "WARNING: sleeping for $middle_time seconds in order to sample the PSS"
sleep ${middle_time}

local memory_command="smem -c pss"
${memory_command} -P @QEMU_PATH@ | tail -n 2 > "$result"
local memory=$(awk '{ total += $1 } END { print total/NR }' "$result")
echo "The PSS memory is : $memory Kb"

echo >&2 "WARNING: This test is being affected by https://github.com/01org/cc-oci-runtime/issues/795"
clean_environment "$server_name"
$DOCKER_EXE rm -f ${client_name} > /dev/null
}

pss_memory