help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is Emacs so slow when used remotely?


From: Tim X
Subject: Re: Why is Emacs so slow when used remotely?
Date: Wed, 08 Dec 2010 15:29:45 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

"Russ P." <russ.paielli@gmail.com> writes:

> On Sep 24, 8:45 am, Giacomo Boffi <giacomo.bo...@polimi.it> wrote:
>> "Russ P." <russ.paie...@gmail.com> writes:
>> > As I explained a few days ago, I am trying to switch from XEmacs to
>> > Emacs so I can use Ensime (an Emacs-based IDE for Scala). I finally
>> > got my .emacs file debugged, but now I am finding that Emacs seems to
>> > be very slow when used remotely.
>>
>> > When I work from home, I login from one Linux machine to another using
>> > ssh -X
>>
>> is sshfs not an option for you?
>
> I looked up sshfs, and it looks interesting. Before I go to the
> trouble of installing it, can anyone tell me something about its
> performance and how it should be used. Would I open Emacs locally on
> my home machine and edit remote files? What are the delays like?
> Thanks.
>

I'll try to clarify things. I'm assuming you have ssh setup and use
ssh-agent (not strictly necessary, but makes life a lot easier by
avoiding the need to enter passwords when loging into the remote host)

You have three options for editing remote files using emacs. 

1. Run emacs rmotely. This approach has given you performance issues.
You could get better performance running it without X support i.e.
issuing emacs -nw on the remote machine, but you then don't have menus
or full mouse support. If you still want to run reotely with X, you only
remaining option is to use one of the X compression protocols, such as
dxcp or nxproxy. 

2. Use tramp to edit the files remotely. Run emacs on the local machine
as usual. When you want to edit a file on the remote host, just do

C-x C-f /remote-hostname:path/to/file/to/edit

There are a few tweaks you can do to improve performance, such as
setting a local temp directory, but it should just work 'out of the box'
(depending on your version of emacs). I've been using tramp mode for
about 8 years. It has been part of emacs for the last two or three
releases. 

3. Use sshfs. This is similar in concept to using NFS. You 'mount' a
remote file system locally over the ssh protocol. The remote file system
is mounted on a local directory. You can then cd to that directory and
view/edit files as if they were local files. Of course, performance may
be a bit slower than a real local file due tot he ssh overhead
anddepending on your network stability, you can get drop outs.
Sometimes, you need to tweak the sshfs otptions to get the best
performance and you may need to turn on auto-reconnect etc. 

As this makes the remote filesystem appear as a local filesystem to the
OS, you just edit the files as if they were local files. 

I find this option very useful when I want to manipulate the files with
other non-emacs tools. If I only want to edit the file, tramp is easier. 

Performance is difficult to quantify as it depends a lot on your network
connection. I use a pretty fast DSL link and connect using ssh inside an
SSL VPN tunnel. With either tramp or sshfs, the only time you notice any
delay is when you first open the file and when you save it - the delay
is small, though of course it can be longer if you have other network
activity happening at the same time you open/save a file (i.e. mail
download, web browsing etc). To get optimal performance, depending on
your environment, you may need to tweak things. However, I've found most
of the time, the defaults work fine.

Tim


-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]