Skip to content

After upgrade some aptly operations became extremely slow (hours vs minutes), suspect ext4 discard on QEMU #1536

Description

@volo-05

Hi! After upgrading aptly we see a huge slowdown on a clone machine with (as far as we can tell) the same dataset and workload.

What changed

  • Old aptly: 1.4.0+ds1-4+b4
  • New aptly: 1.6.2

Symptoms (CI timings)

Before:

  • Deploy pool and staging: ~5 min
  • Deploy releases: ~5 min

After upgrade:

  • Deploy pool and staging: ~1h 25m
  • Deploy releases: >5h

How we run aptly

We run aptly api serve and our CI connects via a UNIX socket.
rootDir is on ext4 inside a QEMU/KVM VM.

Filesystem / storage

We noticed the filesystem is mounted with discard:
/dev/sda1 ... ext4 (rw,relatime,discard,...)

The virtual disk supports TRIM/UNMAP:

  • lsblk -D shows DISC-GRAN=4K, DISC-MAX=1G, ROTA=0 (QEMU HARDDISK)
  • /sys/block/sda/queue/discard_max_bytes = 1073741824
  • /sys/block/sda/queue/discard_granularity = 4096

TRIM / discard test

With nodiscard, fstrim -av trims a lot of data:

  • /: 26.2 GiB trimmed, real time ~12s

With discard, fstrim -av reports:

  • /: 0 B trimmed, real time ~0.02s

This suggests continuous discard is active.

Question / request for guidance

  1. Is discard known to hurt performance for LevelDB-heavy workloads used by aptly (compactions, table file churn, fsync)?
  2. Are there recommended filesystem mount options for aptly databases?
    For example, should we avoid discard and use periodic fstrim instead?
  3. Any aptly-side debug flags / logging / profiling you recommend to pinpoint why these steps became so slow after 1.6.2?

If you tell us what logs/metrics you need (aptly debug logs, strace snippet, LevelDB stats, etc.), we can provide them.

Thanks!

aptly config (redacted)
{
  "FileSystemPublishEndpoints": {},
  "S3PublishEndpoints": {
    "deb.wirenboard.com": {
      "acl": "public-read",
      "awsAccessKeyID": "<REDACTED>",
      "awsSecretAccessKey": "<REDACTED>",
      "bucket": "deb.wirenboard.com",
      "plusWorkaround": true,
      "region": "eu-west-1"
    }
  },
  "SwiftPublishEndpoints": {},
  "architectures": [],
  "dependencyFollowAllVariants": false,
  "dependencyFollowRecommends": false,
  "dependencyFollowSource": false,
  "dependencyFollowSuggests": false,
  "downloadConcurrency": 4,
  "downloadSourcePackages": false,
  "downloadSpeedLimit": 0,
  "gpgDisableSign": false,
  "gpgDisableVerify": false,
  "gpgProvider": "internal",
  "ppaCodename": "",
  "ppaDistributorID": "ubuntu",
  "rootDir": "/home/jenkins/aptly-ng"
}

{
"rootDir": "/home/jenkins/aptly-ng",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"dependencyVerboseResolve": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"gpgProvider": "gpg",
"downloadSourcePackages": false,
"skipLegacyPool": true,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"skipContentsPublishing": false,
"FileSystemPublishEndpoints": {},
"S3PublishEndpoints": {},
"SwiftPublishEndpoints": {}
}

Metadata

Metadata

Assignees

Labels

bugplease confirm resolvedWe believe the issue is resolved ! if so, please close the issue, thanks ;-)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions