Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp831830ybt; Wed, 1 Jul 2020 11:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtE1/DxJL4OOyOjIoUtYB/9HLHDZv/yO7v7MY7B6gpJZgqGNDy+IsE1I3XNQCy/griJY8E X-Received: by 2002:a17:906:fa92:: with SMTP id lt18mr12285048ejb.534.1593626801572; Wed, 01 Jul 2020 11:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593626801; cv=none; d=google.com; s=arc-20160816; b=TAQ9ha5YKaFWU1TzS++1mwymDKYLZMre4QJ81YSRAuBtRGU7jFFW0JglaUu43Rho2h uyk/2/GzGhSWStyeHu3+6wxu0BXdfvozGPbxNjPQQSsaXH/5ZxfmZkw+jYa7BADhiFbY LsWeYO1uiSSuJEfE2exmuS5SZdYbJWJbzN4nmicGMV5uV1geJUkx08omMiC8bIQsFzD7 46TRTHdiz7WqMplLQgNj+P8T3gMLiXG9tGcS7VH6lj2VNS+/73mGo626EwHcyZ3NwTtH mTU5JjwGw99oIwEY1DTkcfDFDqpzk0QAJLgtXivpo9kvmnyHMUdARXhH55nCZnT9svDV U1Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=xmUKrZZsB+dFGspyh5ApvqZfuVDEiMxN2Xa5SgAKHuQ=; b=Uu5w1WiKUy4cYpPGuzMGzSwRCystRAxGQtBhJQHmNEVA+N02PEZWrjpmPnqAxUOxJ4 fC5V8+3fYoAMryeJSPUcpY6e+8uHkfiBDQ4Iieou82RhkhRDbN/NxTpSHEITfJ14lNg7 x/0UIAlGGt0MWmOi9WoC4FgnhYnuQSOA6QliwsA/2N3MYosv6fHlrAaOoaJHPn0iAhpn PSyCd/iVsIox/EyG0WrpBWNzwWeoBpfLmBWwwM0pbxss6QjGnkPLmby1H2/3skw0wr7o 0wG1zuP/U1qG1lP+xvpGmUYIFJDsQkCkplGVahWiVDwE5oav8iEZoz4Q/RYB53mL4qqT Wi/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=tk+bBJwo; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du14si4877634ejc.721.2020.07.01.11.06.06; Wed, 01 Jul 2020 11:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=tk+bBJwo; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732667AbgGASGD (ORCPT + 99 others); Wed, 1 Jul 2020 14:06:03 -0400 Received: from smtp-o-3.desy.de ([131.169.56.156]:51679 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730227AbgGASGD (ORCPT ); Wed, 1 Jul 2020 14:06:03 -0400 Received: from smtp-buf-3.desy.de (smtp-buf-3.desy.de [IPv6:2001:638:700:1038::1:a6]) by smtp-o-3.desy.de (Postfix) with ESMTP id 7BBA860494 for ; Wed, 1 Jul 2020 20:06:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de 7BBA860494 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1593626760; bh=xmUKrZZsB+dFGspyh5ApvqZfuVDEiMxN2Xa5SgAKHuQ=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=tk+bBJwovLpzsFu7j26h2QzFng/RYUXNeUbqgwrcW9rUAx7b6EWAXPyR74XyqhC6+ BYYM8xhs3VmMYtJmktFMJtHJTuNJP4EYVO5m9UFtsSmwj6a/xV2W5T2jXPC6epdrt2 oqwi3KhEeCRcQoMr6X6Vtn3624ErrmiHXJSOmLAs= Received: from smtp-m-3.desy.de (smtp-m-3.desy.de [131.169.56.131]) by smtp-buf-3.desy.de (Postfix) with ESMTP id 768F7A00C3; Wed, 1 Jul 2020 20:06:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at desy.de Received: from z-mbx-2.desy.de (z-mbx-2.desy.de [131.169.55.140]) by smtp-intra-1.desy.de (Postfix) with ESMTP id 53373C00AE; Wed, 1 Jul 2020 20:06:00 +0200 (CEST) Date: Wed, 1 Jul 2020 20:06:00 +0200 (CEST) From: "Mkrtchyan, Tigran" To: Pradeep Cc: linux-nfs Message-ID: <1203996558.728752.1593626760216.JavaMail.zimbra@desy.de> In-Reply-To: References: Subject: Re: File create performance between NFSv3 and NFSv4. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.8.15_GA_3901 (ZimbraWebClient - FF77 (Linux)/8.8.15_GA_3895) Thread-Topic: File create performance between NFSv3 and NFSv4. Thread-Index: UvZRXuozbCa5XDrASGCzVpiv+PpeZg== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Pradeep, When you talk performance always specify which version client and server you use, as older kernels might have issues and newer kernels might hare regressions. There are couple of reasons why you can observe it. First of all, NFS v3 is state less, thus less operations sent over the wire. The NFS v4.1 is more efficient than v4.0. Running your test as: ./smallfile_cli.py --operation create --threads 24 --file-size 0 --files 1024 --top /mnt/test I get: v4.0: 2530 v4.1: 13191 v3 : 14728 This is with 5.6.16-300 client, but a non linux server. Second, if you use NFSv4.1 you should check that client have enough session slots configured to process requests in parallel. You can check/set the value on the client as: cat /sys/module/nfs/parameters/max_session_slots echo 128 > /sys/module/nfs/parameters/max_session_slots IFAIK, server has hard coded max value of 160. Regards, Tigran. ----- Original Message ----- > From: "Pradeep" > To: "linux-nfs" > Sent: Wednesday, July 1, 2020 2:55:15 AM > Subject: File create performance between NFSv3 and NFSv4. > Hello, > > While testing a performance issue, I noticed that the number of > creates that an NFS client can do over NFSv4 is significantly lower > compared to NFSv3. I'm using the test below: > > https://github.com/distributed-system-analysis/smallfile > > Command run: > smallfile_cli.py --operation create --threads 128 --file-size 1 > --files 1024 --top > [ 128 threads, each doing 1024 file creates of 1K size] > > This gives around 1169 creates/sec with NFSv4.1 and 8073 creates/sec > with NFSv3. This is with the exact same client and server. NFS server > is tuned to use 200 threads. > > When I looked at tcpdump, I noticed that over NFSv3 multiple parallel > requests are being sent and NFSv4 is pretty much serial. Is there > anything that I can tune to improve NFSv4 performance w.r.t to file > creations? > > This also shows up in benchmarks like SpecFS SWBUILD's INIT phase > where millions of files are getting created. > > Thanks, > Pradeep