[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Kate being slow on NFS due to swap files
From:       Milian Wolff <mail () milianw ! de>
Date:       2012-12-29 17:55:03
Message-ID: 2257651.8KEa1diQN0 () minime
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Wednesday 26 December 2012 22:41:26 John Chen wrote:
> Hi,
> 
> I've been a long time user of kate, and it've became slow since some times
> ago. It's the same symptoms as described in a previous posting in this
> mailing list: http://lists.kde.org/?l=kwrite-devel&m=130597705405037&w=2
> It takes some time ( a few seconds ) for keystroke to appear on screen,
> and there are no CPU spikes or anything. I'm not sure if the original
> poster's issue is the same as mine, but I guess they might be.
> 
> After some poking around, I found out that this sluggishness is caused by
> high latency of the NFS file system. It seemed that what Kate does is this:
> Receives Key Stroke -> Write the swap file -> Updates the screen
> Whereby, the act of writing to the swap file is blocking, and thus
> when the file system
> on which swap file exists is slow, the keystrokes will be slow to appear.
> 
> By checking the check box "Disable swap files syncing" in
> Settings->Configure Kate->Editor Component->Open/Save->Advanced
> , the problem gets solved, but the user looses the feature having
> backups in case of crashes.
> 
> I haven't traced the part of the code on swap files, but I suggest
> making the write
> to swap files asynchronous, or non-blocking, such that there will be
> delay caused
> by slow file system. If there are no objection to that, I think I can
> come up with a patch
> when I'm free ( around Feb 2013, since I'm a college student with
> Final term exam coming
> in Jan 2013 )

The swap file must stay "valid" to ensure that nothing is lost and more 
importantly to guarantee that it can be properly re-read. The simplest way to 
achieve that is via the fsync call.

But I agree that this is very sub-optimal - especially on NFS. There a simple 
workaround would actually be the implementation of another wish: free 
configuration for the swap file location. Right now the file is always put 
next to the original file. If instead one could freely configure that path and 
put it e.g. into ~/.cache/kwriteswapfiles/$(fullpathtofile). Then ensure that 
~/.cache is a symlink to a local partition (not a NFS share) and you get 
proper performance again.

Otherwise you'll have to come up with a way to write data to the swap file in 
a safer way as it is done right now, such that crashes which would result in 
potentially corrupted swap files do not make the whole file invalid but 
instead we only lose at most a few chars that where typed or such.

Cheers
-- 
Milian Wolff
mail@milianw.de
http://milianw.de
["signature.asc" (application/pgp-signature)]

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic