public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: L A Walsh <cygwin@tlinx.org>
To: Adam Dinwoodie <adam@dinwoodie.org>
Cc: cygwin@cygwin.com
Subject: Re: Renaming (with 'mv') very large files is SLOW
Date: Wed, 02 Feb 2022 09:09:30 -0800	[thread overview]
Message-ID: <61FABACA.9070104@tlinx.org> (raw)
In-Reply-To: <20220131213615.l3bvoyacl3jcvls2@lucy.dinwoodie.org>

On 2022/01/31 13:36, Adam Dinwoodie wrote:
>
>> Could it be that the first 'mv' triggered an anti-virus read of the file since
>> perhaps it detects it as a new/changed file?
>>
>> But if so, would 'mv' (under Task Manager) be showing the 100+ MB/s disk activity?
>>     
>
> That definitely seems plausible; there's a reason a significant number
> of the applications that are known to interfere with Cygwin operation
> (see [0]) are antivirus applications.  But what would trigger your
> antivirus to want to scan a file, and how much work is required to do
> that, is something you'll need to take up with your antivirus vendor,
> I'm afraid.
>   
----
    Something that most people don't realize, is that windows always
puts a lock on a file when it is going to READ it.  It's an advisory lock,
and usually, on a local file access, it can be removed by the user who
started the read  and it's not noticed.
    But if cygwin is accessing the file through some virtual table, Windows
might think it is on a separate virtual device -- like an indexing 
scanner that
indexes content, or anti-vir.

This becomes real noticeable if it is a real remote file on a remote fs.

    In samba there's a setting to allow breaking advisory locks -- and 
if you
are the only person who can be accessing that file, its best to allow 
them to
be broken -- only real useful if you have multiple users (or programs) 
trying to
modify the same file at the same time.  If the oplocks are held by 
another process
windows may return a 'file busy' so cygwin uses a file-copy method to 'move'
the file.  I usually only run into this locally when the file is opened 
by a system
process when I try to modify it, like deleting a thumbs.db when explorer 
is updating
it.

The param in samba is "fake oplocks = yes", tells samba to fake oplocks 
and not
really enforce them.  It's a per-share parameter, so you need to set it 
on every
share.  But only on shares where you are the only 'modifier'.  For actual
shared-access w/other users -- only read-only access should be used.

    If you ever want to have local file caching of remote content work 
-- need to set
the oplocks to fake or have the files be read-only.



> [0]: https://cygwin.com/faq/faq.html#faq.using.bloda
>
>   

  reply	other threads:[~2022-02-02 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 14:52 cygwin
2022-01-31 14:59 ` Eliot Moss
2022-01-31 15:13   ` René Berber
2022-01-31 15:20     ` cygwin
2022-01-31 15:51       ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-01-31 15:17   ` cygwin
2022-01-31 21:36     ` Adam Dinwoodie
2022-02-02 17:09       ` L A Walsh [this message]
2022-02-01  8:47     ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61FABACA.9070104@tlinx.org \
    --to=cygwin@tlinx.org \
    --cc=adam@dinwoodie.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).