Silk: Open-source cooperative fiber scheduler
Recorded: May 24, 2026, 8:58 a.m.
| Original | Summarized |
GitHub - ClickHouse/silk: Fast stackful fibers with a NUMA-aware work-stealing scheduler · GitHub Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert ClickHouse silk Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security and quality Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security and quality Insights
mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History59 Commits59 Commits.github/workflows.github/workflows contribcontrib docsdocs include/silkinclude/silk srcsrc .clang-format.clang-format .clangd.clangd .gitignore.gitignore .gitmodules.gitmodules CMakeLists.txtCMakeLists.txt CMakePresets.jsonCMakePresets.json CONTRIBUTING.mdCONTRIBUTING.md LICENSELICENSE README.mdREADME.md bbbb View all filesRepository files navigationREADMEContributingLicenseSilk docs/scheduler.md — scheduler loop, context switching, suspension pattern, async IO, sleep cancellation, work-stealing design, and performance benchmarks Requirements CMake >= 3.28 GTest, Google Benchmark, libbacktrace, liburing, librseq, libbpf, bpftool, and cxxopts are bundled as submodules under contrib/ and do not need to be installed separately. The two Boost.Context asm sources used for fiber switching are vendored under contrib/fcontext/, and systemtap's USDT headers (<sys/sdt.h> + <sys/sdt-config.h>) under contrib/systemtap-sdt/ (both vendored directly, no submodule). Poco, the AWS SDK, and jemalloc are built on demand via --build-poco, --build-aws, and --build-jemalloc passed to configure. Global options Option -b, --build -s, --sanitizer Enable sanitizer -v, --verbose Print every command before running it; also passes --verbose to perf binaries to enable their debug logging Commands fmt [--check] clean build [targets] test [-R pattern] [-N] [ctest flags...] Flag -R <pattern> -N --timeout SECONDS --coverage --rerun-failed --repeat until-fail:<n> --output-on-failure ./bb test bench [-R pattern] [-N] [gbench flags...] Flag -R <pattern> -N --timeout SECONDS ./bb -b release bench Performance commands Option --file PATH --bs SIZE --size SIZE --duration DURATION --warmup DURATION --numjobs N [N ...] --iodepth N [N ...] --rw MODE [MODE ...] --flamegraph Profile and generate flamegraph SVG --print-counters Print perf counters after each run ./bb -b release file-perf fio-perf net-perf Option --host --port --msg-size BYTES --duration DURATION --warmup DURATION --connections N [N ...] --delay DURATION --flamegraph Profile client and generate flamegraph SVG --print-counters Print perf counters after each run ./bb -b release net-perf net-perf-asio http-perf Option --host --port --duration DURATION --warmup DURATION --connections N [N ...] --delay DURATION --threads Use thread-per-connection client mode instead of fibers --nginx Run client against nginx instead of the internal server --flamegraph Profile client and generate flamegraph SVG --print-counters Print perf counters after each run ./bb -b release http-perf s3-perf Option --endpoint URL --bucket NAME --key NAME --region NAME --access-key KEY --secret-key KEY --size SIZE --duration DURATION --warmup DURATION --numjobs N [N ...] --iodepth N [N ...] --rw MODE [MODE ...] --threads Also run with thread executor --flamegraph Profile first config and generate flamegraph SVG --print-counters Print perf counters after each run --data-dir PATH ./bb -b release s3-perf perf Target file fio net net-asio net-epoll http http-threads http-nginx s3 s3-threads all Option --duration DURATION --warmup DURATION --timeout SECONDS ./bb -b release perf file net About Fast stackful fibers with a NUMA-aware work-stealing scheduler Readme View license Contributing Contributing Uh oh! There was an error while loading. Please reload this page. Activity Custom properties 20 1 0 Report repository Releases Packages
Uh oh! There was an error while loading. Please reload this page. Uh oh! There was an error while loading. Please reload this page. Contributors Uh oh! There was an error while loading. Please reload this page. Languages C++ Python C CMake Assembly
Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
The silk project introduces a cooperative fiber scheduler for Linux designed to manage concurrency efficiently through lightweight, stackful coroutines. The core design philosophy centers on utilizing fibers that suspend rather than block the underlying operating system threads, thereby enabling high concurrency with minimal overhead. This scheduling mechanism incorporates per-CPU scheduler threads and leverages io_uring integration, contributing to a topology-aware work-stealing system. The project structure includes detailed documentation covering the scheduler loop, context switching patterns, asynchronous I/O, sleep cancellation, and the design of the work-stealing mechanism. Synchronization is managed through a set of custom primitives, including FiberFuture, FiberFutex, FiberMutex, FiberSequencer, FiberEvent, and FairFiberMutex. Utility functions are provided by a library incorporating lock-free data structures, time-stamp counter operations, memory pooling, CPU topology awareness, logging, and assertions. Furthermore, there is a comparative analysis distinguishing between stackless coroutines and the implemented stackful fibers. The development setup requires specific dependencies including CMake, Ninja, Clang, and Boost headers. The build process allows for conditional compilation, enabling the optional inclusion of components such as http-perf using Poco, s3-perf using the AWS SDK, or performance improvements using jemalloc. The repository provides precise commands for configuration, formatting, building, and running tests. Performance validation is facilitated through a suite of specialized benchmarking tools built around the framework. These benchmarks leverage io_uring for asynchronous file I/O testing via file-perf and fio-perf, and for network benchmarking via net-perf and net-perf-asio, which can report on TCP echo performance with configurable delays and connection counts. HTTP performance testing is also included through http-perf, which benchmarks internal server performance using fibers or, optionally, against an external server like nginx as a client. For data storage benchmarks, s3-perf is available, which benchmarks performance against a local MinIO server. The results of these performance operations are captured and presented through flamegraph generation and counter printing, allowing for in-depth profiling of the execution paths. The system also offers a unified perf command to execute multiple benchmarks concurrently, providing comprehensive measurement capabilities across I/O, networking, and storage operations. |