zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Yuriy Taraday <yorik.sar@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Zsh start time issues.
Date: Thu, 30 Dec 2010 20:37:53 -0500	[thread overview]
Message-ID: <20101231013753.GA43422@redoubt.spodhuis.org> (raw)
In-Reply-To: <AANLkTin1Nt00f6ho+9Q9nAUAYud=FvTgr2Ru9m6oZy9i@mail.gmail.com>

On 2010-12-30 at 16:48 +0300, Yuriy Taraday wrote:
> Hello.
> 
> I've recently started using zsh as my default shell. The first bugging thing
> is that it takes really long to start zsh. On MacOS X it takes about 6
> seconds to start. When connecting to my FreeBSD server (where I set zsh as
> my default shell too) it takes about 35 seconds to see shell prompt.
> On FreeBSD I have clean install from ports, on MacOS I set up zsh-templates.
> Are there any way to find out what's taking so much time?

35 seconds sounds like there's a 30 second DNS timeout involved, from
sshd, before zsh is even involved.  sshd_config "UseDNS no" if there's
no reverse DNS for your source IP, to keep sshd from stalling while it
tries to figure out who you are?

The first file read by zsh is /etc/zshenv (or some variant thereof,
depending upon install options).  The second is ~/.zshenv.

My ~/.zshenv starts with:
----------------------------8< cut here >8------------------------------
[[ -n $TRACE_ZSH_PROF ]] && zmodload -i zsh/zprof
[[ -n $TRACE_ZSH_TIME ]] && PS4='+[%D{%M:%S}]%N:%i> '
if [[ -n $TRACE_ZSH ]]; then
        [[ -n "$TRACE_ZSH_FILE" ]] && exec 2> "${TRACE_ZSH_FILE}"
        setopt xtrace
fi
----------------------------8< cut here >8------------------------------

You can then modify /etc/ssh/sshd_config to include:
  AcceptEnv TRACE_ZSH*

You can then export some environment variables to the ssh command to get
a trace of everything that happens, from ~/.zshenv onwards.  You might
need a SendEnv in the client SSH config too.

-Phil


      reply	other threads:[~2010-12-31  1:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30 13:48 Yuriy Taraday
2010-12-31  1:37 ` Phil Pennock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101231013753.GA43422@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=yorik.sar@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).