{"id":28501882,"url":"https://github.com/fluent/fluent-bit-perf","last_synced_at":"2025-10-26T20:13:36.895Z","repository":{"id":37469928,"uuid":"206631223","full_name":"fluent/fluent-bit-perf","owner":"fluent","description":"Fluent Bit Performance Tools","archived":false,"fork":false,"pushed_at":"2024-11-09T05:33:04.000Z","size":195,"stargazers_count":35,"open_issues_count":2,"forks_count":12,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-27T23:12:30.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-05T18:28:33.000Z","updated_at":"2025-04-14T06:33:47.000Z","dependencies_parsed_at":"2022-09-05T21:10:51.807Z","dependency_job_id":null,"html_url":"https://github.com/fluent/fluent-bit-perf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fluent/fluent-bit-perf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-bit-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-bit-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-bit-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-bit-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent","download_url":"https://codeload.github.com/fluent/fluent-bit-perf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-bit-perf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263671746,"owners_count":23494027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T16:08:16.996Z","updated_at":"2025-10-26T20:13:36.796Z","avatar_url":"https://github.com/fluent.png","language":"C","readme":"# Fluent Bit Performance Test Tools\n\n[Fluent Bit](https://fluentbit.io) is a fast and lightweight log processor. As part of our continuous development and testing model, we provide specific tools to test performance under different data load scenarios.\n\nThe objective of our performance tooling is to gather the following insights:\n\n- Upon N number of records/data ingestion, measure:\n  - CPU usage, user time and system time\n  - Memory usage\n  - Total time required to process the data\n\nTests aim to run for a fixed number of time, data load can be increased per round. Every tool is able to monitor and collect resource usage metrics from the tested Fluent Bit or another logging tool as a target.\n\n\u003e we focused in a specific set of metrics only which are enough for the purpose of the testing.\n\n## How it Works\n\nEvery tool available is written on top of a generic framework that provides interfaces to load data files, gather metrics nad generate a report from a running process.\n\nIn the following diagram, using ```flb-tail-writer``` tool as an example, it writes N amount of records (lines) to a custom log file, in a separate session, Fluent Bit through [Tail input plugin](https://docs.fluentbit.io/manual/input/tail) reads information from the file generated. Internally the Linux Kernel exposes Fluent Bit process metrics through ProcFS, where flb-tail-writer _before_ and _after_ every write/round operation gather metrics and provides insights of resources consumption.\n\n```\n+-----------------+                 +----------------+\n| Proc FS (/proc) +\u003c----------------+  Linux Kernel  |\n+-----+-----+-----+                 +-----+----+-----+\n      |     ^                             |    ^\n      v     |                             v    |\n+-----+-----+-----+                 +-----+----+-----+\n|                 |                 |                |\n| FLB Tail Writer +-----+     +-----+   Fluent Bit   |\n|                 |     |     |     |                |\n+--------+--------+     |     |     +----------------+\n         |              |     |\n         v              v     v\n  +------+------+     +-+-----+----------+\n  | Test Report |     | /var/log/out.log |\n  +-------------+     +------------------+\n```\n\nAs an example, consider the following test using ```flb-tail-writer``` where:\n\n- Reads samples of data from _data.log_ file\n- Output data will be written to _out.log_ file\n- Write 1000000 records (log lines) every second, 10 times (called as 10 seconds).\n- Monitor resources usage of Fluent Bit process ID (PID).\n- Stop Monitoring Fluent Bit process once the process becomes almost idle for 3 seconds.\n\n```bash\n records   write (b)     write   secs |  % cpu  user (ms)  sys (ms)  Mem (bytes)      Mem\n--------  ----------  --------  ----- + ------  ---------  --------  -----------  -------\n 1000000   131881447   125.77M   1.05 |  40.05        370        50    152735744  145.66M\n 1000000   131881447   125.77M   1.05 |  50.34        480        50      5758976    5.49M\n 1000000   131881447   125.77M   1.05 |  45.54        410        70      3915776    3.73M\n 1000000   131881447   125.77M   1.06 |  46.40        420        70      3915776    3.73M\n 1000000   131881447   125.77M   1.05 |  44.61        410        60      3915776    3.73M\n 1000000   131881447   125.77M   1.06 |  45.39        430        50      3915776    3.73M\n 1000000   131881447   125.77M   1.05 |  45.59        430        50      3915776    3.73M\n 1000000   131881447   125.77M   1.06 |  44.53        440        30      3915776    3.73M\n 1000000   131881447   125.77M   1.09 |  47.75        460        60      3915776    3.73M\n 1000000   131881447   125.77M   1.06 |  45.45        440        40      3915776    3.73M\n       0           0       0 b   1.00 |   0.00          0         0      3915776    3.73M\n       0           0       0 b   1.00 |   0.00          0         0      3915776    3.73M\n       0           0       0 b   1.00 |   0.00          0         0      3915776    3.73M\n\n- Summary\n  - Process     : fluent-bit\n  - PID         : 1660\n  - Elapsed Time: 10.58 seconds\n  - Avg Memory  : 14.79M\n  - Avg CPU     : 45.56%\n  - Avg Rate    : 92.63M/sec\n```\n\n## Report Details\n\nThe report have two panes, left side belongs to the information provided by the perf tools in terms\nof data ingestion and the right side the metrics collected from the monitored process.\n\n#### Left Pane\n\nThe information on the left side of the report belongs to a summary of data samples sent to the target service.\n\n| Column    | Description                                       |\n| --------- | ------------------------------------------------- |\n| records   | Number of records ingested in the specific round. |\n| write (b) | Total number of bytes written.                    |\n| write     | Human readable version of written bytes.          |\n| secs      | Elapsed time on writing the data.                 |\n\n#### Right Pane\n\nOverall metrics from the monitored process when the ```-p PID``` parameter is used. \n\n| Column    | Description                                                  |\n| --------- | ------------------------------------------------------------ |\n| % cpu     | Represents the CPU time used by the process in user and system space during the time (_secs_) that the performance tool was writing data. |\n| user (ms) | CPU time spent in milliseconds in user time (user space)     |\n| sys (ms)  | CPU time spent in milliseconds in system time (kernel space). |\n| Memory    | Number of bytes in memory (RSS) currently used by the process after writing the data and waiting for one second. |\n| Mem       | Human readable version of Memory used.                       |\n\n## Tools Available\n\n| Tool        |                     Fluent Bit Target                     | Description                                  |\n| ----------- | :-------------------------------------------------------: | -------------------------------------------- |\n| Tail Writer | [Tail input](https://docs.fluentbit.io/manual/input/tail) | Writes large amount of data into a log file. |\n| TCP Writer  | [TCP input](https://docs.fluentbit.io/manual/input/tail), [Syslog input](https://docs.fluentbit.io/manual/input/syslog) (tcp mode) | Writes large amount of data over a TCP socket. |\n\n## Build Instructions\n\n### Requirements\n\n- C compiler\n- CMake3\n- Linux environment\n\n### Build\n\nRun the following command to compile the tools:\n\n```bash\n$ cd build/\n$ make\n```\n\n## Comments about Performance and Benchmarking\n\nPerformance is always critical and when managing data at high scale there are many corners where is possible to improve and make it better.\n\nWhen measuring performance is important to understand the variables that can affect a running _monitored_ service. If you are comparing same tool like Fluent Bit v/s Fluent Bit is not a hard task, but if you aim to compare Fluent Bit against other solution in the same space, you have to do an extra work and make sure that the setup and conditions are the same, e.g: make sure buffer sizes are the same on both tools.\n\n\u003e  Running a performance test using default options in different services will lead to unreliable results.\n\nStory: some years ago I was working in one of my [HTTP servers](http://monkey-project.com) projects. We got into a benchmark virtual battle against a proprietary web server. They claimed aims to be faster that all open source options available (e.g: Nginx, Lighttpd, Apache, etc)... and benchmark results shows that their project was _outstanding_ leaving every other project behind.\n\nAfter digging a bit more and starting measuring what was doing that web server from an operating system level, we ended up discovering that it was _caching_ every HTTP request and response without extra checks, so if it get one million request for the same end-point in a Keep-Alive session, it sent the same response over and over, without the expected processing. Basically it was _prepared_ before hand to cheat if it was benchmarked.\n\n\u003e Upon sending a HTTP request with an URI that changed the query string variable (e.g: /?a=1..) every time, it was slow as hell :)\n\nOn that moment I learn how important was to measure every aspect of a running service. That's why the simple metrics of CPU time in user/kernel space and memory usage are really important. \n\nfinal tip: if you are the user, try to do your own benchmarks for your own conditions and scenario. Trust in our performance tooling but don't trust in benchmarks reports made by us (maintainers) or vendors XD .\n\n## License\n\nThis program is under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n## Authors\n\n- [Eduardo Silva ](https://twitter.com/edsiper)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent%2Ffluent-bit-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluent%2Ffluent-bit-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent%2Ffluent-bit-perf/lists"}