Loading ...
Sorry, an error occurred while loading the content.

Re: slow samba+vim, I'm out of suggestions ...

Expand Messages
  • Dominique PellĂ©
    ... Hi Which version of Vim are you using? Maybe this patch helps? 7.3.027 MS-Windows: Opening a file on a network share is very slow -- Dominique -- You
    Message 1 of 15 , Dec 14, 2012
    View Source
    • 0 Attachment
      dza wrote:

      > I wonder why my Vim is so slow over our Windows samba share -
      > not only opening/closing is slow - also typing and edit/insert
      > commands are slow as well :-commands, plugins, everything.

      Hi

      Which version of Vim are you using? Maybe this patch helps?

      7.3.027 MS-Windows: Opening a file on a network share is very slow

      -- Dominique

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • dza
      ... It s also a problem on Linux for me :( ... Thanks for your suggestions so far all ! -- You received this message from the vim_use maillist. Do not
      Message 2 of 15 , Dec 14, 2012
      View Source
      • 0 Attachment
        On Thursday, 13 December 2012 19:06:00 UTC+1, Ben Fritz wrote:
        > On Thursday, December 13, 2012 11:11:26 AM UTC-6, dza wrote:
        > > I wonder why my Vim is so slow over our Windows samba share - not only opening/closing is slow - also typing and edit/insert commands are slow as well :-commands, plugins, everything.
        > >
        > > Can I tame Vim running on a fileshare? Or make it cache the files locally so it doesn't slow down?
        > >
        > > I've seen alot of suggestions, but none of them seems to do the trick.
        > >
        > > For example:
        > >
        > > nofsync
        > > ttyfast
        > > ttimeout
        > > timeout
        > >
        > > Thank you very much in advance, I would really like to know how I can fix this !
        >
        > A couple of suggestions:
        >
        > Move your Vim config (.vimrc, plugins, etc.) off any network share. In my experience, my single greatest slow-down in Vim was due to running scripts off a network share.
        >
        > Set your 'directory', 'backupdir', and/or 'undodir' options to a local directory. By default swap, backup, and undo files are stored in the same directory. This can make editing slow because Vim must peridocially write the swap file over the network. 'backupdir' and 'undodir' are less important as they only affect file write times. See https://groups.google.com/d/topic/vim_use/1ZrWkBj6DKI/discussion for setting 'directory' differently for different file locations.

        On Friday, 14 December 2012 09:53:37 UTC+1, Dominique Pelle wrote:
        > Hi
        >
        >
        >
        > Which version of Vim are you using? Maybe this patch helps?
        >
        >
        >
        > 7.3.027 MS-Windows: Opening a file on a network share is very slow
        >
        >
        >
        > -- Dominique

        It's also a problem on Linux for me :( ...

        Thanks for your suggestions so far all !

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • dza
        ... Thanks Tim! I think the dir, undodir, and backupdir made a difference. I have set the following now-: set noswapfile set nobackup set nofsync set ttyfast
        Message 3 of 15 , Dec 14, 2012
        View Source
        • 0 Attachment
          On Thursday, 13 December 2012 19:02:25 UTC+1, Tim Chase wrote:
          > My first thought would be to check where your swapfile is located.
          >
          > You can check the value of 'dir'
          >
          >
          >
          > :set dir?
          >
          >
          >
          > to see where Vim will try to write the swap file. If it's on a
          >
          > low-bandwidth or high-latency connection such as a shared drive, you
          >
          > might want to move it locally. You can read the grisly details at
          >
          >
          >
          > :help 'dir'
          >
          >
          >
          > Thus, you might want to remove "." from the setting for your network
          >
          > files:
          >
          >
          >
          > :set dir-=.
          >
          >
          >
          > or perhaps with an autocmd that only does that for network files.
          >
          >
          >
          > -tim

          Thanks Tim! I think the dir, undodir, and backupdir made a difference.

          I have set the following now-:

          set noswapfile
          set nobackup
          set nofsync
          set ttyfast
          set notimeout
          set nottimeout
          set dir -=.
          set undodir -=.
          set backupdir -=.

          It still seems to slow down periodically between modes like INSERT, navigating between buffers, and generally everything seems slowed to a point where vim is hardly not usable over a network.

          On Thursday, 13 December 2012 19:06:00 UTC+1, Ben Fritz wrote:
          > A couple of suggestions:
          >
          > Move your Vim config (.vimrc, plugins, etc.) off any network share. In my experience, my single greatest slow-down in Vim was due to running scripts off a network share.
          Thanks for your suggestions Ben, but I have all plugins, vimrc, etc. locally.


          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Dominique PellĂ©
          ... Ah Linux. Try running vim with strace to see what system calls it does. It may give clues. $ strace -o /tmp/vim.trace vim Perform things that are slow on
          Message 4 of 15 , Dec 14, 2012
          View Source
          • 0 Attachment
            dza <dezzadk@...> wrote:

            > On Friday, 14 December 2012 09:53:37 UTC+1, Dominique Pelle wrote:
            >> Hi
            >>
            >> Which version of Vim are you using? Maybe this patch helps?
            >>
            >> 7.3.027 MS-Windows: Opening a file on a network share is very slow
            >>
            >> -- Dominique
            >
            > It's also a problem on Linux for me :( ...

            Ah Linux. Try running vim with strace to see what system calls it does.
            It may give clues.

            $ strace -o /tmp/vim.trace vim

            Perform things that are slow on samba and look at what Vim
            does in /tmp/vim.trace log file.

            -- Dominique

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Ben Fritz
            ... With dir and backupdir set to keep their files off your network share, you probably don t need noswapfile and nobackup . I have used swap files
            Message 5 of 15 , Dec 14, 2012
            View Source
            • 0 Attachment
              On Friday, December 14, 2012 11:26:23 AM UTC-6, dza wrote:
              >
              > Thanks Tim! I think the dir, undodir, and backupdir made a difference.
              >
              > I have set the following now-:
              >
              > set noswapfile
              > set nobackup
              > set nofsync
              > set ttyfast
              > set notimeout
              > set nottimeout
              > set dir -=.
              > set undodir -=.
              > set backupdir -=.
              >

              With 'dir' and 'backupdir' set to keep their files off your network share, you probably don't need 'noswapfile' and 'nobackup'. I have used swap files often enough to recover from kicking the power cord out or a plugin crashing Vim that I would never consider turning them off entirely.

              > It still seems to slow down periodically between modes like INSERT, navigating between buffers,

              For insert mode, is it mainly when you have syntax folding turned on? There's a workaround for that:

              http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text

              > and generally everything seems slowed to a point where vim is hardly not usable over a network.
              >

              You say "hardly not usable", does that mean it is now usable most of the time?

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Christian Brabandt
              Hi dza! ... Have you tried with all plugins turned off and started in default mode? See also the faq: http://vimhelp.appspot.com/vim_faq.txt.html#faq-2.5
              Message 6 of 15 , Dec 14, 2012
              View Source
              • 0 Attachment
                Hi dza!

                On Fr, 14 Dez 2012, dza wrote:

                > Thanks for your suggestions Ben, but I have all plugins, vimrc, etc.
                > locally.

                Have you tried with all plugins turned off and started in default mode?
                See also the faq:
                http://vimhelp.appspot.com/vim_faq.txt.html#faq-2.5

                regards,
                Christian
                --
                Wie man sein Kind nicht nennen sollte:
                Lutz Ern

                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • dza
                ... Yes, I put it there to confirm I tried exactly what people suggested, no matter how it was perceived :) ... Should I put it to foldmethod=none ? ... It s
                Message 7 of 15 , Dec 14, 2012
                View Source
                • 0 Attachment
                  On Friday, 14 December 2012 20:16:56 UTC+1, Ben Fritz wrote:
                  > On Friday, December 14, 2012 11:26:23 AM UTC-6, dza wrote:
                  > >
                  > > Thanks Tim! I think the dir, undodir, and backupdir made a difference.
                  > >
                  > > I have set the following now-:
                  > >
                  > > set noswapfile
                  > > set nobackup
                  > > set nofsync
                  > > set ttyfast
                  > > set notimeout
                  > > set nottimeout
                  > > set dir -=.
                  > > set undodir -=.
                  > > set backupdir -=.
                  > >
                  >
                  > With 'dir' and 'backupdir' set to keep their files off your network share, you probably don't need 'noswapfile' and 'nobackup'. I have used swap files often enough to recover from kicking the power cord out or a plugin crashing Vim that I would never consider turning them off entirely.
                  >
                  Yes, I put it there to confirm I tried exactly what people suggested, no matter how it was perceived :)

                  > > It still seems to slow down periodically between modes like INSERT, navigating between buffers,
                  >
                  > For insert mode, is it mainly when you have syntax folding turned on? There's a workaround for that:
                  Should I put it to foldmethod=none ?
                  >
                  > http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
                  >
                  > > and generally everything seems slowed to a point where vim is hardly not usable over a network.
                  > >
                  >
                  > You say "hardly not usable", does that mean it is now usable most of the time?
                  It's usable, but just very slow.

                  Everytime I write a file I have to wait around 10seconds before I can continue typing.

                  Everytime I switch buffers I have to wait the same 10-20seconds.

                  And now-and-then when switching between INSERT/NORMAL mode it halts again for a little less maybe 5-10 secs, but still really annoying.

                  I just tried turning "syntax off" and it didn't help as well, not for writing the files and not for navigating in general - I just deleted 2 letters with delete and then wanted to move down (j, down) and it froze again !

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Ben Fritz
                  ... Unless a plugin is interfering, this sounds like it might just be a slow network share. Do other applications take a long time to write files to the
                  Message 8 of 15 , Dec 14, 2012
                  View Source
                  • 0 Attachment
                    On Friday, December 14, 2012 2:01:57 PM UTC-6, dza wrote:
                    >
                    > Everytime I write a file I have to wait around 10seconds before I can continue typing.

                    Unless a plugin is interfering, this sounds like it might just be a slow network share. Do other applications take a long time to write files to the network share, or is it just Vim?

                    >
                    > Everytime I switch buffers I have to wait the same 10-20seconds.
                    >

                    Vim keeps active buffers in RAM, but by default clears out buffer text when you leave the buffer and it is no longer visible in a window.

                    You can try setting 'hidden' to help with switching buffers, since if I understand correctly Vim keeps the file in RAM then and thus need not read in the file every time it switches buffers if 'hidden' is set.

                    Or, start using split windows/tab pages instead of switching buffers in the same window.

                    > And now-and-then when switching between INSERT/NORMAL mode it halts again for a little less maybe 5-10 secs, but still really annoying.
                    >

                    This might be a plugin or syntax folding.

                    > I just tried turning "syntax off" and it didn't help as well, not for writing the files and not for navigating in general - I just deleted 2 letters with delete and then wanted to move down (j, down) and it froze again !

                    Since you have 'noswapfile' set I don't expect this is caused by swap files. Since you have syntax off that can't be interfering either. Have you tried disabling all your plugins and config with vim -N -u NONE -U NONE -i NONE to see if the problem persists?

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  • dza
                    ... I managed to cut off some time, but still write (:w) and INSERT mode is a bit slow - when I am building up a few or 10 buffers. -- You received this
                    Message 9 of 15 , Dec 19, 2012
                    View Source
                    • 0 Attachment
                      On Thursday, 13 December 2012 18:11:26 UTC+1, dza wrote:
                      > I wonder why my Vim is so slow over our Windows samba share - not only opening/closing is slow - also typing and edit/insert commands are slow as well :-commands, plugins, everything.
                      >
                      > Can I tame Vim running on a fileshare? Or make it cache the files locally so it doesn't slow down?
                      >
                      > I've seen alot of suggestions, but none of them seems to do the trick.
                      >
                      > For example:
                      >
                      > nofsync
                      > ttyfast
                      > ttimeout
                      > timeout
                      >
                      > Thank you very much in advance, I would really like to know how I can fix this !

                      I managed to cut off some time, but still write (:w) and INSERT mode is a bit slow - when I am building up a few or 10 buffers.

                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php
                    • Ben Fritz
                      ... Again I ask, do other applications also have slow writes to this network share?Have you tried running Vim without any plugins or .vimrc configuration to
                      Message 10 of 15 , Dec 19, 2012
                      View Source
                      • 0 Attachment
                        On Wednesday, December 19, 2012 3:56:07 AM UTC-6, dza wrote:
                        > On Thursday, 13 December 2012 18:11:26 UTC+1, dza wrote:
                        > > I wonder why my Vim is so slow over our Windows samba share - not only opening/closing is slow - also typing and edit/insert commands are slow as well :-commands, plugins, everything.
                        > >
                        > > Can I tame Vim running on a fileshare? Or make it cache the files locally so it doesn't slow down?
                        > >
                        > > I've seen alot of suggestions, but none of them seems to do the trick.
                        > >
                        > > For example:
                        > >
                        > > nofsync
                        > > ttyfast
                        > > ttimeout
                        > > timeout
                        > >
                        > > Thank you very much in advance, I would really like to know how I can fix this !
                        >
                        > I managed to cut off some time, but still write (:w) and INSERT mode is a bit slow - when I am building up a few or 10 buffers.

                        Again I ask, do other applications also have slow writes to this network share?Have you tried running Vim without any plugins or .vimrc configuration to see if the problem persists?

                        Also did you try my suggestion of the 'hidden' option, or using split windows, etc. for buffer switching speed?

                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php
                      • dza
                        ... Hello guys - It s been some time since I last answered, but I have made some real progress since! I was seeing alot of NAME NOT FOUND entries in ProcMon
                        Message 11 of 15 , Jan 3, 2013
                        View Source
                        • 0 Attachment
                          On Thursday, 13 December 2012 18:11:26 UTC+1, dza wrote:
                          > I wonder why my Vim is so slow over our Windows samba share - not only opening/closing is slow - also typing and edit/insert commands are slow as well :-commands, plugins, everything.
                          >
                          > Can I tame Vim running on a fileshare? Or make it cache the files locally so it doesn't slow down?
                          >
                          > I've seen alot of suggestions, but none of them seems to do the trick.
                          >
                          > For example:
                          >
                          > nofsync
                          > ttyfast
                          > ttimeout
                          > timeout
                          >
                          > Thank you very much in advance, I would really like to know how I can fix this !

                          Hello guys - It's been some time since I last answered, but I have made some real progress since!

                          I was seeing alot of "NAME NOT FOUND" entries in ProcMon from www.sysinternals.com to these files:
                          c:\Windows\CSC\v2.0.6\namespace\networksharename

                          I solved this simply by disabling "Offline Files"
                          Search in Explorer for "Offline Files" click the UAC "Disable Offline Files", needs a restart and gone are the mysterious slowing "NAME NOT FOUND" entries in ProcMon and a noticeable gain in performance in Vim :) (while not running ProcMon of course which slows things down tremendously)

                          I am still getting alot of "FAST IO DISALLOWED" entries. However, I am not sure if this is because of misconfiguration of SAMBA or simply because Network Shares are not having "FAST IO" ...

                          Other than that you are right; swap, backup, dir needs to be turned off and the current dir "." removed from the array.

                          I've also gained some speed by using
                          let g:miniBufExplCheckDupeBufs = 0
                          let g:miniBufExplorerMoreThanOne = 0

                          I still get slowdowns on several tabs with vertical and horizontal tabs when buffers starts to grow. I will keep using ProcMon and ":debug wincmd p "

                          ":debug wincmd p" shows alot of minibufexpl calls, and that is essentially what I think is causing the slowdown between switching buffers, although the plugin is quite essential.

                          I still have experimented alot with/without configs and plugins and I will keep doing this.

                          Sincerely thanks,
                          Christoffer Aasted.

                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                        Your message has been successfully submitted and would be delivered to recipients shortly.