[From nobody Fri Jul  3 20:42:04 2009
Received: (at submit) by bugs.debian.org; 4 Jan 2006 08:14:55 +0000
Return-path: &lt;philipp.marek@bmlv.gv.at&gt;
Received: from mail.bmlv.gv.at ([193.171.152.37])
	by spohr.debian.org with esmtp (Exim 4.50) id 1Eu3nL-0003Tv-6N
	for submit@bugs.debian.org; Wed, 04 Jan 2006 00:14:55 -0800
Received: from localhost (localhost [127.0.0.1])
	by mail.bmlv.gv.at (mail) with ESMTP id 43D098032A
	for &lt;submit@bugs.debian.org&gt;; Wed,  4 Jan 2006 09:14:22 +0100 (CET)
From: &quot;Ph. Marek&quot; &lt;philipp.marek@bmlv.gv.at&gt;
To: submit@bugs.debian.org
Subject: gnupg: very bad performance with key import
Date: Wed, 4 Jan 2006 09:14:19 +0100
User-Agent: KMail/1.8.3
MIME-Version: 1.0
Content-Type: text/plain;
  charset=&quot;us-ascii&quot;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: &lt;200601040914.19920.philipp.marek@bmlv.gv.at&gt;
X-Virus-Scanned: by amavisd-new at bmlv.gv.at
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: gnupg
Version: 1.4.2-2
Severity: important

I'm currently doing an import of the debian-keyring:
	$ dpkg-query -l debian-keyring | grep keyring
	ii  debian-keyring      2005.05.28          GnuPG (and obsolete PGP) keys of Debian Developers
	$ ls -la /usr/share/keyrings/debian-keyring.gpg
	-rw-r--r-- 1 root root 13644930 2005-05-29 11:54 /usr/share/keyrings/debian-keyring.gpg
	$ gpg --import /usr/share/keyrings/debian-keyring.gpg

and that takes a very long time and very much memory ....

gpg said that it imports 903 key (summary message), and since then just &quot;hangs&quot; 
without giving further messages.

This is not a slow machine - P4 1.7GHz, 512MB RAM:
	$ cat /proc/cpuinfo
	processor       : 0
	vendor_id       : GenuineIntel
	cpu family      : 15
	model           : 1
	model name      : Intel(R) Pentium(R) 4 CPU 1.70GHz
	stepping        : 2
	cpu MHz         : 1700.437
	cache size      : 256 KB
	...
	bogomips        : 3403.20
	$ free
	             total       used       free     shared    buffers     cached
	Mem:        515976     510132       5844          0       6632     152752
	-/+ buffers/cache:     350748     165228
	Swap:       258008     195676      62332

top says:
	27136 root      35  10  432m 270m 1132 R 90.7 53.8  47:17.54 gpg

straces gives me
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075137
	read(8, &quot;\4\22\21\2\0\6\5\2?%$o\0\n\t\20\265Y9\347\367\343\303\264&quot;..., 8192) = 8192
	read(8, &quot;\17F{82\261\244\345\254S0\0\237an\317\301e\203=\'}\240&quot;..., 8192) = 8192
	read(8, &quot;|\336*m\315\375\300\0\237Hh\2326\213\254\275r\255\20\23&quot;..., 8192) = 8192
	read(8, &quot;\10\244\306\225EUm\351^\20\372&amp;\360l\17W\356\346&amp;\0\240&quot;..., 8192) = 8192
	gettimeofday({1136361996, 120996}, NULL) = 0
	getrusage(RUSAGE_SELF, {ru_utime={2093, 191786}, ru_stime={413, 155190}, ...}) = 0
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075138
	gettimeofday({1136361996, 124019}, NULL) = 0
	getrusage(RUSAGE_SELF, {ru_utime={2093, 191786}, ru_stime={413, 155190}, ...}) = 0
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075138
	gettimeofday({1136361996, 126554}, NULL) = 0
	getrusage(RUSAGE_SELF, {ru_utime={2093, 191786}, ru_stime={413, 155190}, ...}) = 0
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075138
	gettimeofday({1136361996, 129007}, NULL) = 0
	getrusage(RUSAGE_SELF, {ru_utime={2093, 191786}, ru_stime={413, 155190}, ...}) = 0
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075139
	gettimeofday({1136361996, 132419}, NULL) = 0
	getrusage(RUSAGE_SELF, {ru_utime={2093, 191786}, ru_stime={413, 155190}, ...}) = 0
	time(NULL)                              = 1136361996
	times({tms_utime=209319, tms_stime=41315, tms_cutime=0, tms_cstime=0}) = 439075139
	read(8, &quot;\4\0\270n\2728\356\356\262vSmO\227\243\374\210R\356\16&quot;..., 8192) = 8192
	gettimeofday({1136361996, 140468}, NULL) = 0
	getrusage(RUSAGE_SELF,  &lt;unfinished ...&gt;

It's likely that I just underestimate the complexity of importing keys; but in my limited 
understanding doing an import of 903 keys must not take more than a few minutes, and 
surely doesn't need 400MB ...

It's still not finished; I wonder when/if it will finish on my slow laptop ....



-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (600, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-1-686-smp
Locale: LANG=de_AT@euro, LC_CTYPE=de_AT@euro (charmap=ISO-8859-1) (ignored: LC_ALL set to de_AT)

Versions of packages gnupg depends on:
ii  libbz2-1.0                  1.0.2-11     high-quality block-sorting file co
ii  libc6                       2.3.5-9      GNU C Library: Shared libraries an
ii  libldap2                    2.1.30-12    OpenLDAP libraries
ii  libreadline5                5.1-5        GNU readline and history libraries
ii  libusb-0.1-4                2:0.1.10a-22 userspace USB programming library
ii  makedev                     3.3.8.2-0    Creates device files in /dev
ii  zlib1g                      1:1.2.3-9    compression library - runtime

gnupg recommends no packages.

-- no debconf information

]