ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Linux Devel Mailing List <devel@lists.altlinux.org>
Subject: Re: [devel] Q: вопрос к знатокам rpm
Date: Fri, 10 Oct 2008 09:38:47 +0400
Message-ID: <20081010053847.GE6399@altlinux.org> (raw)
In-Reply-To: <20081009210722.GA18699@lks.home>


[-- Attachment #1.1: Type: text/plain, Size: 1604 bytes --]

On Fri, Oct 10, 2008 at 01:07:22AM +0400, Konstantin A. Lepikhov wrote:
> Не подскажут ли уважаемые знатоки, какой лимит на кол-во provides/requires
> в нашем rpm? Интересует в виде максимального кол-ва записей в пакете.

Хедер должен целиком помещаться в память, общий лимит 16M.

rpmdb/header.c:
    60  /**
    61   * Sanity check on data size and/or offset.
    62   * This check imposes a limit of 16Mb, more than enough.
    63   */ 
    64  #define hdrchkData(_nbytes)     ((_nbytes) & 0xff000000)

На практике средний размер хедера -- несколько килобайт,
максимальный -- около мегабайта.

$ perl -MDB_File -le 'tie %db, "DB_File", "/var/lib/rpm/Packages", 0 or die; print length($v) while ($k,$v) = each %db' |~/stats.pl
min=4
max=838512
mean=15909.9935379644
medi=6642
devi=48149.4217886403
$

Здесь min=4 на самом деле соответствует "нулевому хедеру", который
содержит last_insert_id (целое значение, а не хедер).

Сериализация дает более ясное представление (но неправильные цифры):

$ perl -MRPM::Database -MData::Dumper -le '$db=RPM::Database->new or die; print length(Dumper($v)),"\t",$k while ($k,$v) = each %$db' |~/stats.pl
min=4530        ilmbase6-common
max=6450138     tetex-core
mean=80824.329021827
medi=22901      perl-XML-Atom
devi=360911.67139352
$

Хедер включает в себя имена файлов и md5 суммы, поэтому на деле большой
хедер получается у больших пакетов.

$ perl -MRPM::Database -MData::Dumper -le '$db=RPM::Database->new or die; print Dumper($$db{"tetex-core"})' |less
(посмореть что находится в хедере)
/=>
(удобно так искать)
$

[-- Attachment #1.2: stats.pl --]
[-- Type: text/plain, Size: 345 bytes --]

#!/usr/bin/perl
use strict;
use bigint;
use Statistics::Descriptive;
my $stat = Statistics::Descriptive::Full->new();
while (<>) {
	chomp;
	$stat->add_data($_);
}
print "min=".$stat->min()."\n";
print "max=".$stat->max()."\n";
print "mean=".$stat->mean()."\n";
print "medi=".$stat->median()."\n";
print "devi=".$stat->standard_deviation()."\n";

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2008-10-10  5:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 21:07 Konstantin A. Lepikhov
2008-10-09 21:37 ` Led
2008-10-09 21:57   ` Konstantin A. Lepikhov
2008-10-09 22:26     ` Led
2008-10-09 22:43       ` Dmitry V. Levin
2008-10-09 22:55         ` Led
2008-10-09 23:19         ` Konstantin A. Lepikhov
2008-10-09 23:43           ` Led
2008-10-10  5:38 ` Alexey Tourbin [this message]
2008-10-10  5:47   ` Alexey Gladkov
2008-10-10  5:52     ` Alexey Tourbin
2008-10-10  5:58       ` Alexey Gladkov
2008-10-10  5:55   ` Alexey Gladkov
2008-10-10  6:22     ` Alexey Tourbin
2008-10-10  7:50       ` Alexey Gladkov

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=20081010053847.GE6399@altlinux.org \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.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

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git