From 4e880ed12b989b36387ea79179b5f14d8cee9491 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Wed, 30 Mar 2016 15:35:15 -0700 Subject: nfs: Enable multi-core epoll support in gNFSd Summary: - Enables multi-core epoll support in the nfs daemon. - Option can be turned on using: gluster volume set nfs.event-threads Test Plan: Prove test! Reviewers: kvigor, rwareing Reviewed By: rwareing Subscribers: dld, moox, dph Differential Revision: https://phabricator.fb.com/D3117966 Change-Id: Ie8a7b1ba04b0e83f5ec7a09f9d181fe59be479ca Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/18266 Reviewed-by: Jeff Darcy Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Smoke: Gluster Build System --- tests/basic/nfs-multicore-epoll.t | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/basic/nfs-multicore-epoll.t (limited to 'tests/basic') diff --git a/tests/basic/nfs-multicore-epoll.t b/tests/basic/nfs-multicore-epoll.t new file mode 100644 index 00000000000..28f341521f9 --- /dev/null +++ b/tests/basic/nfs-multicore-epoll.t @@ -0,0 +1,40 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc +. $(dirname $0)/../nfs.rc + +cleanup; + +>/var/log/glusterfs/nfs.log; + +function check_event_thread_log () +{ + local nlines + + nlines=$(grep "$1" /var/log/glusterfs/nfs.log | grep -v G_LOG | wc -l) + if [ "$nlines" != "0" ]; then + echo "Y" + else + echo "N" + fi; +} + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2} +TEST $CLI volume set $V0 nfs.disable off +TEST $CLI volume start $V0 + +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; + +# Make sure its not enabled without the option +EXPECT_WITHIN 10 "N" check_event_thread_log "Started thread with index 3"; + +# Turn it on and check that we spawned the threads +TEST $CLI volume set $V0 nfs.disable on +TEST $CLI volume set $V0 nfs.event-threads 4 +TEST $CLI volume set $V0 nfs.disable off +EXPECT_WITHIN 10 "Y" check_event_thread_log "Started thread with index 4"; + +cleanup; -- cgit