Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not send QoS messages is we're still busy processing the previous ones #1105

Merged
merged 1 commit into from
Feb 13, 2025
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: 1 addition & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: ["sanity", "no_huge", "ns_lb_change", "no_subsystems", "auto_load_balance", "state_transitions", "state_transitions_both_gws", "state_transitions_loop", "state_transitions_rand_loop", "late_registration", "late_registration_loop", "4gws", "4gws_loop", "4gws_create_delete", "4gws_create_delete_loop", "namespaces", "namespaces_loop", "mtls", "notify", "ceph_status", "blocklist", "main_exit", "cluster_pool", "flat_bdev_per_cluster"]
test: ["sanity", "no_huge", "ns_lb_change", "no_subsystems", "auto_load_balance", "state_transitions", "state_transitions_both_gws", "state_transitions_loop", "state_transitions_rand_loop", "late_registration", "late_registration_loop", "4gws", "4gws_loop", "4gws_create_delete", "4gws_create_delete_loop", "namespaces", "namespaces_loop", "mtls", "notify", "ceph_status", "blocklist", "main_exit", "cluster_pool", "flat_bdev_per_cluster", "set_qos", "set_qos_2ms"]
runs-on: ubuntu-latest
env:
HUGEPAGES: 1024 # 4 spdk instances
Expand Down
2 changes: 2 additions & 0 deletions ceph-nvmeof.conf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ transport_tcp_options = {"in_capsule_data_size" : 8192, "max_io_qpairs_per_ctrlr
# Example value: {"small_pool_count" : 8192, "large_pool_count" : 1024, "small_bufsize" : 8192, "large_bufsize" : 135168}
# iobuf_options =

qos_timeslice_in_usecs = 0

[monitor]
#timeout = 1.0
#log_file_dir =
4 changes: 4 additions & 0 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,8 @@ def __init__(self, config: GatewayConfig, gateway_state: GatewayStateHandler,
self.up_and_running = True
self.rebalance = Rebalance(self)
self.spdk_version = None
self.spdk_qos_timeslice = self.config.getint_with_default("spdk",
"qos_timeslice_in_usecs", None)

def get_directories_for_key_file(self, key_type: str,
subsysnqn: str, create_dir: bool = False) -> []:
Expand Down Expand Up @@ -2703,6 +2705,8 @@ def namespace_set_qos_limits_safe(self, request, context):
set_qos_limits_args["r_mbytes_per_sec"] = request.r_mbytes_per_second
if request.HasField("w_mbytes_per_second"):
set_qos_limits_args["w_mbytes_per_sec"] = request.w_mbytes_per_second
if self.spdk_qos_timeslice:
set_qos_limits_args["timeslice_in_usecs"] = self.spdk_qos_timeslice

ns_qos_entry = None
if context:
Expand Down
2 changes: 2 additions & 0 deletions tests/ceph-nvmeof.cluster_pool.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ transport_tcp_options = {"in_capsule_data_size" : 8192, "max_io_qpairs_per_ctrlr
# Example value: {"small_pool_count" : 8192, "large_pool_count" : 1024, "small_bufsize" : 8192, "large_bufsize" : 135168}
# iobuf_options =

# qos_timeslice_in_usecs = 0

[monitor]
#timeout = 1.0
#log_file_dir =
2 changes: 2 additions & 0 deletions tests/ceph-nvmeof.flat_bdevs_per_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ transport_tcp_options = {"in_capsule_data_size" : 8192, "max_io_qpairs_per_ctrlr
# Example value: {"small_pool_count" : 8192, "large_pool_count" : 1024, "small_bufsize" : 8192, "large_bufsize" : 135168}
# iobuf_options =

# qos_timeslice_in_usecs = 0

[monitor]
#timeout = 1.0
#log_file_dir =
5 changes: 5 additions & 0 deletions tests/ceph-nvmeof.no-huge.conf
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ timeout = 60.0
# Example value: {"max_queue_depth" : 16, "max_io_size" : 4194304, "io_unit_size" : 1048576, "zcopy" : false}
transport_tcp_options = {"in_capsule_data_size" : 8192, "max_io_qpairs_per_ctrlr" : 7}

# Example value: {"small_pool_count" : 8192, "large_pool_count" : 1024, "small_bufsize" : 8192, "large_bufsize" : 135168}
# iobuf_options =

# qos_timeslice_in_usecs = 0

[monitor]
#timeout = 1.0
#log_file_dir =
5 changes: 5 additions & 0 deletions tests/ceph-nvmeof.tls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ timeout = 60.0
# Example value: {"max_queue_depth" : 16, "max_io_size" : 4194304, "io_unit_size" : 1048576, "zcopy" : false}
transport_tcp_options = {"in_capsule_data_size" : 8192, "max_io_qpairs_per_ctrlr" : 7}

# Example value: {"small_pool_count" : 8192, "large_pool_count" : 1024, "small_bufsize" : 8192, "large_bufsize" : 135168}
# iobuf_options =

# qos_timeslice_in_usecs = 0

[monitor]
#timeout = 1.0
#log_file_dir =
20 changes: 20 additions & 0 deletions tests/ha/set_qos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -xe

NS_COUNT=400
NQN="nqn.2016-06.io.spdk:cnode1QOS"
GW1_NAME=$(docker ps --format '{{.ID}}\t{{.Names}}' | awk '$2 ~ /nvmeof/ && $2 ~ /1/ {print $1}')
GW1_IP="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$GW1_NAME")"
cephnvmf="docker compose run --rm nvmeof-cli --server-address $GW1_IP --server-port 5500"

$cephnvmf subsystem add --subsystem $NQN --max-namespaces 1024 --no-group-append

for i in `seq 1 $NS_COUNT`
do
$cephnvmf namespace add -n $NQN --rbd-pool rbd --rbd-image image${i} --rbd-create-image --size 10MB
$cephnvmf namespace set_qos -n $NQN --nsid $i --rw-ios-per-second 150 --rw-megabytes-per-second 19 --r-megabytes-per-second 19 --w-megabytes-per-second 19
done

$cephnvmf subsystem del --subsystem $NQN --force
sleep 10
1 change: 1 addition & 0 deletions tests/ha/set_qos_2ms.sh
3 changes: 3 additions & 0 deletions tests/ha/setup_set_qos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
1 change: 1 addition & 0 deletions tests/ha/setup_set_qos_2ms.sh
12 changes: 12 additions & 0 deletions tests/ha/start_up_set_qos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -ex

# Check if GITHUB_WORKSPACE is defined
if [ -n "$GITHUB_WORKSPACE" ]; then
test_dir="$GITHUB_WORKSPACE/tests/ha"
else
test_dir=$(dirname $0)
fi

$test_dir/start_up.sh 1
15 changes: 15 additions & 0 deletions tests/ha/start_up_set_qos_2ms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -ex

# Check if GITHUB_WORKSPACE is defined
if [ -n "$GITHUB_WORKSPACE" ]; then
test_dir="$GITHUB_WORKSPACE/tests/ha"
else
test_dir=$(dirname $0)
fi

sed 's/^ *qos_timeslice_in_usecs.*$/qos_timeslice_in_usecs = 2000/' ceph-nvmeof.conf > /tmp/ceph-nvmeof.2ms.conf
export NVMEOF_CONFIG=/tmp/ceph-nvmeof.2ms.conf
$test_dir/start_up.sh 1
rm -f /tmp/ceph-nvmeof.2ms.conf
8 changes: 8 additions & 0 deletions tests/ha/wait_gateways_set_qos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Check if GITHUB_WORKSPACE is defined
if [ -n "$GITHUB_WORKSPACE" ]; then
test_dir="$GITHUB_WORKSPACE/tests/ha"
else
test_dir=$(dirname $0)
fi

$test_dir/wait_gateways.sh 1
1 change: 1 addition & 0 deletions tests/ha/wait_gateways_set_qos_2ms.sh
Loading