pkg(8) is "Compressing files ..."

This seems to be a feature I don't recall in the past.
Yes, that's new. I noticed it as well on the last package upgrade: https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly/

Index_of_FreeBSD_15_amd64_quarterly.png


What's being compressed, and if I have ZFS compression already, why does it need to be compressed twice?
Apparently files.pkg is decompressed and re-compressed again, to safe space. Nothing to do with ZFS. Not every FreeBSD file system is ZFS, there are users using UFS.

/var/db/pkg/repos/FreeBSD-ports
Code:
% ls -l
-rw-r--r--   1 root wheel 31149062 Dec  2 21:39 files

% file files
files: Zstandard compressed data (v0.8+), Dictionary ID: None

Regarding files.pkg: pkg-repo(8)
Rich (BB code):
DESCRIPTION
    ...
     files.pkg is an optional compressed archive containing files, a
     directory-grouped listing of all files present in all packages in the
     repository.  It is only generated when the -l flag is used.  The file
     uses a compact line-based text format where paths are grouped by
     directory.  When fetched by pkg-update(8), this data enables
     pkg-rwhich(8) to look up which remote package provides a given file.  See
     pkg-repository(5) for a full description of the format.
Note, the manual pkg-rwhich(8) as of pkg version 2.9.4 doesn't exist yet.

Example usage of 'pkg-rwhich':
Code:
% pkg rwhich /usr/local/bin/sudo
/usr/local/bin/sudo is provided by package sudo-1.9.17p2_5
/usr/local/bin/sudo is provided by package sudo-rs-0.2.15_2
/usr/local/bin/sudo is provided by package sudo-sssd-1.9.17p2_5

It's especially painful with multiple jails.
The fetching of files.pkg should be optional, not default. Not everybody wants to look up files provided by remote packages.
 
I've just came across this today, while updating several low-performance VPS instances. It takes minutes per upgrade process to get the files compressed.

I couldn't find a flag or any reference towards changing this behaviour. Does anyone else have a hint for me whether this is intended?
 
From https://github.com/freebsd/pkg/releases/tag/2.8.2
rwhich
  • Store the filesite as a compressed archive parsed in memory, removing the
    pkg_files and file_dirs tables from the repo SQLite database (~96% of
    the DB size)

Does this mean one (also) looses the pkg info -l capability when disabling the rwhich database?

Also, am I assuming correctly that we reduced the size of the already present database (sqlite) by adding an *additional*, *compressed* database for the same feature? WHY?
 
  • Like
Reactions: dkh
It was certainly a very unwelcome surprise. It is very slow and gets repeated on every server. If it's telling us which files are available on the remote server why not make that a binary download as well instead of doing it locally. I must be missing something but this feels like something that only a few people are going to want so it shouldn't have been an auto opt in kind of thing.
 
Hello

Same thing here—the “compression” that happens every time you run `pkg upgrade` in each jail is really annoying... and it seems like a very recent change... it easily takes a minute each time... I've worked around it like this


/usr/local/etc/pkg.conf
COMPRESSION_LEVEL = 6
 
Following what MetaOxy suggested, I saw that on the pkg.conf manpage:
COMPRESSION_LEVEL: integer
Set the default compression level, special values are:

0 default value per libarchive developers
-1 default value per pkg developers (default)

So I put it to 0 and it's definitely faster than the default -1.
It takes less than a second to complete its operation, and one can still enjoy the new pkg feature.

Alternatively there is an extreme solution(didn't try it though), changing the default compression format to something the CPU can handle better without struggling like tar instead of tzst, but you lose the possibility for the CPU to use multiple threads which is only for txz and tzst.
COMPRESSION_FORMAT: string
Set the default compression format: tzst, txz, tbz, tar.
Default: tzst.
COMPRESSION_THREADS: integer
Set the number of threads to use during compression and decom-
pression (only functional for txz and tzst).
Default: -1 (automatic).
 
The FreeBSD Project do not need to consult any of us to implement features they want into their own OS.
The way I see it, FreeBSD is not a community OS, it has a strong community for sure but that's a whole different thing.

If you are "selling" pkgbase as being, in part, a faster solution to current methodologies to maintaining the software it probably behooves you not to make it intentionally much slower.
 
The FreeBSD Project do not need to consult any of us to implement features they want into their own OS.

If you are "selling" pkgbase as being, in part, a faster solution to current methodologies to maintaining the software it probably behooves you not to make it intentionally much slower.
I agree with both of you.

I don't mean I have to decide about - well, this is not really a FreeBSD feature, it's still a port after all - what FreeBSD should be. I just said that no one wants this annoyance (even those who claimed this feature, I suppose).

I was just enjoying, among other things, the speed of upgrade pkgbase brings. In some ways, it's a regression and the funny thing here is this also impacts those that don't use pkgbase.
 
In some ways, it's a regression and the funny thing here is this also impacts those that don't use pkgbase.
It seems introducing regressions that affect many users is nowadays accepted in FreeBSD.

We already got a massive regression in build times thanks to this commit (that hasn't received A SINGLE REVIEW): https://reviews.freebsd.org/D49967
Despite various threads on the mailing list and massive impact on build times (i.e. not a few percent, but a factor of 3-4x) this hasn't been reverted but only a build-time knob (that is disabled by default) has been added - so everyone that wants to restore sane build times has to rebuild world. Hint: setting this option breaks a lot of ports (especially libclc-llvm) which had to adapt their Makefile/build options due to fallout from this change...

It's almost like valuing POLA seems to be "uncool" and instead we need to break stuff, especialy stuff that works and has been a solved problem for ages, because linuxland is doing it, so it must be good.
 
Back
Top