Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
Debian/dcs: Debian Code Search (codesearch.debian.net) is a search engine that searches through all the 130 GB of open source software that is included in Debian. Supports regular expressions!

Debian/dcs: Debian Code Search (codesearch.debian.net) is a search engine that searches through all the 130 GB of open source software that is included in Debian. Supports regular expressions!

5 hours ago

GitHub Actions CI</a>

Context:

* Debian Code Search: taming the latency tail (2014) * TurboPFor: an analysis (2019) Documentation: Hardware requirements:
  • At least 1 TB of SSD disk space.
  • The more CPU, the better. Then, more IOPS (disks that saturate many reads).
Example: Google Cloud
  • A Google Cloud N2 instance (n2-standard-16) has 64 GB of RAM and a Cascade Lake CPU (with AVX512), at least in my test.
* Local NVMe SSDs are recommended. You need at least four 375 GB disks. * Performance ceiling (fio, 16K random reads): 180k IOPS, 2.95 GB/s * DCS needs 4.6 ns CPU time per byte searched, about 0.22 GB/s per vCPU. * 32 vCPUs are the recommendation if you want fastest queries. 16 vCPUs is fine, too. * 32 GB of RAM, or 64 GB of RAM (better) are recommended. * 128 GB of RAM holds the typical working set and can deliver 2x faster (warm) queries.

Example: Hetzner dedicated server

  • A Hetzner AX52 (no longer available to order) has 64 GB of RAM, a Ryzen 7 7700 (8 cores / 16 threads) and two 1 TB Samsung PM9A1 NVMe disks.
* Performance ceiling (fio, 16K random reads): 400k IOPS, 6.5 GB/s (RAID0) * DCS needs 2.7 ns CPU time per byte searched, about 0.37 GB/s per Zen 4 thread. * This machine is CPU-bound: To saturate the disk, we’d need a 16 or 32 core CPU. * With 64 GB of RAM, about 44% of searched bytes came from page cache.

Guide to this repository:

  • cmd/dcs is the swiss-army knife tool for Debian Code Search, displaying index files in a variety of ways.
  • cmd/dcs-localdcs runs a local development instance of Debian Code Search.
The service itself consists of the following services / jobs:
  • cmd/dcs-compute-ranking generates ranking.json based on the Debian Popularity Contest (popcon).
  • cmd/dcs-feeder feeds packages to multiple dcs-package-importer shards.
  • cmd/dcs-web is the web server which runs searches on multiple dcs-source-backend shards.
Each shard (codesearch.debian.net uses 6 shards) runs:
  • A cmd/dcs-package-importer to receive, unpack and index Debian packages for this shard.
  • A cmd/dcs-source-backend to run actual searches over imported source code.
Chat with me