LAN speed different from WinSCP and NFS on W11

  • Something odd is going on here and I want to ask if someone has any thoughts on what I can change.


    The scenario is:

    I have made a NFS v3 share to my LAN and prep W11 to see it (I don't use SMB).

    OMV server is connected with 2.5Gb NIC to a unmanaged TP-Link switch with 8x 2.5Gb (TL-SG108-M2)

    Laptop is connected with a Thunderbolt-to-NIC adapter 2.5Gb to the TP-Link switch.

    TP-Link switch is connected to a ISP router NIC which is only 1Gb although, I assume that it's only the Internet speed that is influenced by this, NOT the LAN from SERVER to CLIENT.


    NFS settings are:



    On W11, I made a registry edit to bind Anonymous UID:GID to UID 1000; GID 100 to the NFS share so, it has no issues when R/W files/folders to the share via Windows Explorer (all files are owned by 1000:100 )




    When using W11 Explorer, I can pull from server at a speed of ~160-180MB which I accept as excelent (and shows that it is using the 2.5Gb speed)

    (Before with a 1Gb managed TP-Link switch TL-SG108E , the speed was around 100MB pull and 80MB push)



    The issue is when pushing to the share, the speed doesn't go over ~20MB.




    To compare, I use also WinSCP with LAN connection and the speeds go completely different.


    When pulling or pushing files, the speed goes somewhat constant on the ~80MB





    Any pointers to what I can change to increase the speed on the NFS protocol, at least?

    Maybe some changes on the options of the share?

  • I suspect your performing slow sync writes on the NFS mount. Adding async to the NFS share options may show a speed increase on write.

    I read about it (and I'm now, starting to put ChatGPT to use, :D ) and I thought that sync is much more reliable than async:


    Quote

    Copilot

    The difference between async (asynchronous) and sync (synchronous) options on an NFS share primarily affects how write operations are handled:

    Synchronous (Sync)

    • Definition: With the sync option, all changes to the filesystem are immediately written to disk. The NFS server waits for the data to be written to stable storage before responding to the client.
    • Pros:
      • Data Integrity: Ensures that data is safely written to disk, reducing the risk of data loss in case of a crash or power failure.
      • Consistency: Provides a consistent state of the filesystem, as all write operations are completed before the next one begins.
    • Cons:
      • Performance: Can significantly slow down write operations because the client must wait for each write to be confirmed by the server before proceeding.

    Asynchronous (Async)

    • Definition: With the async option, the NFS server can respond to the client immediately after processing the I/O request and sending it to the local filesystem, without waiting for the data to be written to stable storage.
    • Pros:
      • Performance: Improves write performance by allowing the client to continue operations without waiting for each write to be confirmed.
      • Efficiency: Write operations are batched and optimized, reducing the number of disk writes and improving overall system efficiency.
    • Cons:
      • Data Risk: Increases the risk of data loss in case of a server crash or power failure, as data may still be in the server's cache and not yet written to disk.

    Use Cases

    • Sync: Recommended for critical data where data integrity and consistency are paramount, such as databases or financial records.
    • Async: Suitable for scenarios where performance is more critical than immediate data integrity, such as temporary files or non-critical data processing.


    Although the amount of DATA that I push to the share isn't that much (via NFS), I want it to be safe and secure, hence the sync option.


    I will try (just to test it) the async option just to compare it but, I think I'll just stick with WinSCP to deal with the DATA that I need to push to the Server.

  • On the client side, I see this as the mount:

    Code
    Local    Remote                                 Properties
    -------------------------------------------------------------------------------
    Z:       \\192.168.1.130\export\pote-media      UID=1000, GID=100
                                                    rsize=1048576, wsize=1048576
                                                    mount=soft, timeout=3.2
                                                    retry=1, locking=yes
                                                    fileaccess=755, lang=ANSI
                                                    casesensitive=no
                                                    sec=sys


    Do you have any thoughts on what can be changed on it?

    Maybe reduce/increase the rsize/wsize to change the buffer value?


    These are the options available when using the mount command on W11:

    Quote
    1. Options:
      • -o rsize=<buffersize>: Sets the size in kilobytes of the read buffer. Acceptable values are 1, 2, 4, 8, 16, and 32; the default is 32 KB.
      • -o wsize=<buffersize>: Sets the size in kilobytes of the write buffer. Acceptable values are 1, 2, 4, 8, 16, and 32; the default is 32 KB.
      • -o timeout=<seconds>: Sets the timeout value in seconds for a remote procedure call (RPC). Acceptable values are 0.8, 0.9, and any integer in the range 1-60; the default is 0.8.
      • -o retry=<number>: Sets the number of retries for a soft mount. Acceptable values are integers in the range 1-10; the default is 1.
      • -o mtype={soft|hard}: Sets the mount type for your NFS share. By default, Windows uses a soft mount. Soft mounts time out more easily when there are connection issues; however, to reduce I/O disruption during NFS server reboots, a hard mount is recommended.
      • -o lang={euc-jp|euc-tw|euc-kr|shift-jis|Big5|Ksc5601|Gb2312-80|Ansi}: Specifies the language encoding to configure on an NFS share. You can use only one language on the share.
      • -o fileaccess=<mode>: Specifies the default permission mode of new files created on the NFS share. Specify mode as a three-digit number in the form ogw, where o, g, and w are each a digit representing the access granted to the file's owner, group, and the world, respectively.
      • -o anon: Mounts as an anonymous user.
      • -o nolock: Disables locking (default is enabled).
      • -o casesensitive={yes|no}: Specifies case sensitivity of file lookup on the server.
      • -o sec={sys|krb5|krb5i|krb5p}: Specifies the security mechanism for mounting an NFS share. Options include:
        • sec=sys: No authentication or security checks are performed. Data transfers aren't encrypted.
        • sec=krb5: Specifies Kerberos authentication for mounting the NFS share.
        • sec=krb5i: Extends Kerberos security by adding data integrity checks.
        • sec=krb5p: Adds privacy protection to Kerberos security by encrypting data transfers.


    Perhaps some tweaking can be done here?

  • What ChatGPT didn't mention was any reference to the relevant RFC doc for NFSv3 or latest NFv4.2. In Linux, NFS exports default to sync while client mounts can be sync or async. A scrict interpretation of the RFC docs would say async exports breaks the NFS protocol.


    A command line mount in Linux defaults to async. I'm pretty sure a NFS client mount in Windows10/11 is sync. Running the server in sync with a client sync mount is always going to be relatively slow.


    SMB servers/clients in contrast operate in async mode by default.


    As to tweaking mount options in Windows, a doubt whether any of that would make a difference to the fundamental facts re: sync modes.

  • I'm pretty sure a NFS client mount in Windows10/11 is sync

    So, to mount it async I need the -o mtype=soft:

    Quote

    By default, Windows 11 mounts NFS shares using the synchronous (sync) option. This means that all changes to the filesystem are immediately written to disk, ensuring data integrity and consistency

    1
    2
    .

    If you need to change this behavior to asynchronous (async) for performance reasons, you can specify the -o mtype=soft option when mounting the NFS share. However, be aware that using async can increase the risk of data loss in case of a crash or power failure.

    Here's an example command to mount an NFS share with async:

    Code
    mount -o mtype=soft \\<IP_ADDRESS>\<PATH_TO_DIR> <drive_letter>:


    Let's see how it goes.

  • I just saw that it is already mounted with that option. post #4

    Code
    Local    Remote                                 Properties
    -------------------------------------------------------------------------------
    Z:       \\192.168.1.130\export\pote-media      UID=1000, GID=100
                                                    rsize=1048576, wsize=1048576
                                                    mount=soft, timeout=3.2
                                                    retry=1, locking=yes
                                                    fileaccess=755, lang=ANSI
                                                    casesensitive=no
                                                    sec=sys


    So, I'll just try with async option on the server share and see what changes.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!