From owner-freebsd-fs@freebsd.org Fri Apr 6 01:38:24 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 991F7F94066 for ; Fri, 6 Apr 2018 01:38:24 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660047.outbound.protection.outlook.com [40.107.66.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5AF7C979 for ; Fri, 6 Apr 2018 01:38:23 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM (52.132.66.153) by YQBPR0101MB0852.CANPRD01.PROD.OUTLOOK.COM (52.132.65.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Fri, 6 Apr 2018 01:38:22 +0000 Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::185:356:49c5:794c]) by YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::185:356:49c5:794c%13]) with mapi id 15.20.0653.012; Fri, 6 Apr 2018 01:38:22 +0000 From: Rick Macklem To: Mike Tancsa , "freebsd-fs@freebsd.org" Subject: Re: Linux NFS client and FreeBSD server strangeness Thread-Topic: Linux NFS client and FreeBSD server strangeness Thread-Index: AQHTzEKdJ7nozqXV6kKGauYOIuptM6PxTtMygAEGZICAAJxWpg== Date: Fri, 6 Apr 2018 01:38:22 +0000 Message-ID: References: <369fab06-6213-ba87-cc66-c9829e8a76a0@sentex.net> , <9040d0fa-f9c2-2cc3-efbd-f96408cff73b@sentex.net> In-Reply-To: <9040d0fa-f9c2-2cc3-efbd-f96408cff73b@sentex.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQBPR0101MB0852; 7:Ocxda/WBp9l3CuxhMTZS1Wpq1FbQj8OeTh44LUyxAwnYrKhOrRLgOy7vb9UOh4jZlBnX+jp313dJsEmXQQEYN50ft+pfkXjYiSaRlZ1dUIyG+9wXD5jBQM2pPaOAPl2DpahiYBVEdm+LMohM8dR9veK72MoxxUNZUsGrRqwTJ9cFltUrkOXK+ExRbBPKr95LFWIb7zG6Z1NkufMmwv4VRVNVRXnVMC5mb5gcllsBX9jbOZ5hh7ya7g0sSTiKnxY9 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 536dea51-4121-4efe-1198-08d59b5f1532 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YQBPR0101MB0852; x-ms-traffictypediagnostic: YQBPR0101MB0852: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(788757137089); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6041310)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:YQBPR0101MB0852; BCL:0; PCL:0; RULEID:; SRVR:YQBPR0101MB0852; x-forefront-prvs: 0634F37BFF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39380400002)(376002)(39850400004)(396003)(199004)(189003)(6436002)(102836004)(110136005)(105586002)(345774005)(106356001)(6506007)(76176011)(53936002)(26005)(486006)(2906002)(7696005)(99286004)(55016002)(74316002)(86362001)(6246003)(186003)(9686003)(33656002)(3660700001)(68736007)(2501003)(305945005)(74482002)(25786009)(81166006)(59450400001)(3280700002)(229853002)(81156014)(316002)(11346002)(786003)(446003)(8676002)(97736004)(14454004)(478600001)(5660300001)(476003)(2900100001)(8936002)(5250100002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB0852; H:YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: hk/8z3voJ3V0cULdCQkM/hb4zPYxe5sIvdfpm4zFE03VZbYCJw/Y5c/2UwX9LFm4UgqBK/cSoN5a43n7+nY2CuLvTesOGkFxl9lZ/lyo9Mt/OGxkWhmtDMlaGS/qxliGNmdJ4J32sjjnLnmGWN2SWS0ZPEMEGT/O0GQhm6zJPtTaOBjVzUPf7AHWk5s/Mzr+BYKcmeUUaCrONJMWLcnaXrwukNkiNGrLefiX+AwRcspgv2xuezR54MepnkVdbjcB9d9G/A0RfVs8GaRxrHntDNiBgHjwYR1sdXn6PPywWyhNrP2Q9tH3ogXDt57Qc/Y9GNJDNSg7igUOg0zJNSp7rTZtPfdsJZNFYAki5gu6zpQ6wFai0GyYdaNoVvl/C63PDCbpmAMxprNAR1QtNOQFKofoMxe/6cv6IEl6yBEtEug= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 536dea51-4121-4efe-1198-08d59b5f1532 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2018 01:38:22.1656 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB0852 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 01:38:24 -0000 Mike Tancsa wrote: >Thank you for all the feedback, pointers/insights. Coming directly from >'Mr. NFS', its particularly appreciated :) I could replace "Mr. NFS" with "Mr. stupid enough to do NFS without getting paid to do it";-) However, I should note that, although I am fairly familiar with the protoco= l and the FreeBSD code, I don't have a lot of experience w.r.t. performance, at l= east on newer hardware and fast networking. [good stuff snipped] >I think the root of the issue partially stems from the client having a >LOT of RAM. So according to this default behaviour There is a now rather ancient connectathon test suite for NFS, where one of the tests is writing/reading a large 10Mbyte file. The 10Mbyte size was selected because it was guaranteed to exceed the NFS client's buffer cache capacity. (Maybe no longer true;-) >---------------- > The NFS client treats the sync mount option differently than some >other file systems (refer to mount(8) for a description of the > generic sync and async mount options). If neither sync nor >async is specified (or if the async option is specified), the NFS > client delays sending application writes to the server until any >of these events occur: > > Memory pressure forces reclamation of system memory resource= s. > > An application flushes file data explicitly with sync(2), >msync(2), or fsync(3). > > An application closes a file with close(2). > > The file is locked/unlocked via fcntl(2). > > In other words, under normal circumstances, data written by an >application may not immediately appear on the server that hosts > the file. >----------------------------- Just fyi, the FreeBSD client starts a write when the buffer cache block is completely written with new data. (Called B_ASYNC in the code.) If only part of a block has been written with new data, the write is delaye= d until it is fully written with new data or one of the above cases applies. You might want to slap to-gether a test program that loops on write(2) for a while, does an fsync(2), then more writing... and see how that performs on both FreeBSD and Linux clients. I do find the fact that doing an "ls" concurrently with the writes makes th= ings work better interesting/weird. All the "ls" will do is inject a bunch of ot= her RPC messages into the TCP stream (small ones in the client->server dire= ction). The only thing I can think of is that the net interface is somehow "awakene= d" by the small RPC messages (each one almost always in one TCP segment). (Maybe something related to how the net interface device driver handles receive interrupts or ???) If you find the "magic bullet" that makes the Linux case work well without the concurrent "ls", please post and let us know what it is. Good luck with it, rick [lots of stuff snipped]=