Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!sun-barr!lll-winken!gauss.llnl.gov!casey From: casey@gauss.llnl.gov (Casey Leedom) Newsgroups: comp.windows.x Subject: Re: Remote xterm strategy Message-ID: <43394@lll-winken.LLNL.GOV> Date: 7 Jan 90 00:46:07 GMT References: <90Jan6.054031est.2293@neat.cs.toronto.edu> Sender: usenet@lll-winken.LLNL.GOV Reply-To: casey@gauss.llnl.gov (Casey Leedom) Organization: Lawrence Livermore National Laboratory Lines: 101 Mark Moraes explained the trade offs between the two methods well, but forgot a couple of performance issues. Expanding slightly on Mark's diagrams we see some really gross details exposed: Case 1: rsh remote-host xterm -display local-host:0 --------------------------------------------------- type: X -- lh(net) === rh(net) -- xterm -- rh(pty) (*) -- sh/app echo: sh/app -- (*) rh(pty) -- xterm -- rh(net) === lh(net) -- X Case 2: xterm -e rlogin remote-host ----------------------------------- type: X -- lh(unix) -- xterm -- lh(pty) -- rlogin1 -- lh(net) === rh(net) -- rlogind2 -- rh(pty) (*) -- sh/app echo: sh/app -- (*) rh(pty) -- rlogind1 -- rh(net) === lh(net) -- rlogin2 -- lh(pty) -- xterm -- lh(unix) -- X Key: ---- -- User/kernel context switch. === Network transfer. lh Local-host kernel. rh Remote-host kernel. (pty) Kernel pseudo tty service. (net) Kernel networking service. (unix) Kernel UNIX domain networking service. X X server running on local host. xterm An xterm client. Running on the local-host in case 1. Running on the remote host in case 2. rlogin1 Rlogin process running on local-host. Reads from local xterm via pty interface in CBREAK or RAW mode. Writes to rlogind2 on remote-host. rlogin2 Rlogin process running on local-host. Reads from rlogind1 on remote-host. Writes to local xterm via pty interface in CBREAK or RAW mode. rlogind1 Rlogin daemon process running on remote-host. Reads from sh/app via pty. Writes to rlogin2 on local-host. rlogind2 Rlogin daemon process running on remote host. Reads from rlogin2 on local host. Writes to sh/app via pty. (*) Sh/app and associated context switch not involved except at carriage return if shell/application is in line editing mode. Analysis of case 1: ------------------- Typically two context switches on local-host and four on remote-host per typed and echoed character when sh/app in line editing mode. (Two more context switches per typed and echoed character on remote-host when sh/app in non line-editing mode.) One user process executing on each of local-host (X) and remote-host (xterm) in typical, line editing mode. I.e. no user process to user process context switches involved. Analysis of case 2: ------------------- Typically ten context switches on local-host and four on remote-host per typed and echoed character when sh/app in line editing mode. (Two more context switches per typed and echoed character on remote-host when sh/app in non line-editing mode.) Four user processes executing on local-host (X, xterm, rlogin1, rlogin2) and two on remote-host (rlogind1, rlogind2). I.e. lots of user process to process context switching. Also, all characters are forced to go through mainly inactive pty code in the local kernel since the local rlogin has put the pty interface between itself and the xterm into CBREAK mode (RAW mode if the rlogin -8 switch is used). Additionally, as Mark mentioned, the larger network packet size for the X11 protocol versus the rlogin protocol isn't going to make much difference. The number of packets transmitted and the inter-packet spacing are usually the most important features of protocol performance with respect to Ethernet. I.e. how much packet room does the protocol leave? In this case, the size difference of the X11 and rlogin protocols is meaningless. I think there's only one packet pair per typed and echoed character using an xterm. If this is so, the total network impact difference between an rlogin versus an xterm connection is probably nearly unmeasurable. Summary and conclusions: ------------------------ Case 1: executing an xterm on a remote host. versus Case 2: using rlogin to remote-host from within a locally executing xterm window. Case 2 causes significantly more context switching on the local-host (ten versus two). Worse that context switching is among four different user processes instead of only one. Even the remote-host which doesn't see any more context switching is forced to context switch between two user level processes instead of only one. Not having made any actual performance timings it's impossible to make any conclusions. But you look at the circuit and tell me that you expect case 2 to be faster over anything except the slowest networks. Casey