From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Why is Emacs so slow when used remotely? Date: Sat, 25 Sep 2010 10:39:57 +1000 Organization: Unlimited download news at news.astraweb.com Message-ID: <871v8ilkpu.fsf@puma.rapttech.com.au> References: <76f5ba95-cc68-4326-a962-f515c0fb70cd@y31g2000vbt.googlegroups.com> <86wrqbw3fn.fsf@aiuole.stru.polimi.it> <9a8712e0-b2c5-4506-8a80-64ac9038b7d1@t3g2000vbb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291882033 24273 80.91.229.12 (9 Dec 2010 08:07:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 08:07:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 09:07:09 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQbWu-0002GC-M4 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 09:07:08 +0100 Original-Received: from localhost ([127.0.0.1]:57222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQahR-0003JV-Qc for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 02:13:57 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!news.astraweb.com!border1.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:BFLZAdQCu1oNZ6rkSz+5/HlS5UE= Original-Lines: 75 Original-NNTP-Posting-Host: d6c8a956.news.astraweb.com Original-X-Trace: DXC=Z6ZKZ; cM@Q0SG6fD[7G; H=L?0kYOcDh@:i=VFiPm?<[5Ljd<>OFZ\J0eV68aEXRT8=51aL; 6BXc13 Original-Xref: usenet.stanford.edu gnu.emacs.help:181469 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76857 Archived-At: "Russ P." writes: > On Sep 24, 8:45 am, Giacomo Boffi wrote: >> "Russ P." 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