From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3724 invoked by alias); 31 Dec 2010 01:54:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28558 Received: (qmail 9694 invoked from network); 31 Dec 2010 01:54:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d200912; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=iVTS4wahOI8Gl24nlDucjOJKht7Ko8wC9XiiPl6nuL8=; b=Fb5PMjseUhF4iHCKXllwbj+XuIQbJJ6goJEFNXQ3+moUNmHBz8WfsYupMp8Kwn2CU1+JO2trpajLtQP0juw0QIWql/0noL6BGoTZKQMn2VsayTkQyXhd8OFZOrCwUKbBdUGhL5xL7l4waqHFgz0kL7+kavmLZd32cksYJJldVW0=; Date: Thu, 30 Dec 2010 20:37:53 -0500 From: Phil Pennock To: Yuriy Taraday Cc: zsh-workers@zsh.org Subject: Re: Zsh start time issues. Message-ID: <20101231013753.GA43422@redoubt.spodhuis.org> Mail-Followup-To: Yuriy Taraday , zsh-workers@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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