{"id":13466874,"url":"https://github.com/lesovsky/noisia","last_synced_at":"2025-04-04T13:12:17.675Z","repository":{"id":51127120,"uuid":"274490113","full_name":"lesovsky/noisia","owner":"lesovsky","description":"Harmful workload generator for PostgreSQL","archived":false,"fork":false,"pushed_at":"2023-11-06T06:33:18.000Z","size":132,"stargazers_count":691,"open_issues_count":0,"forks_count":17,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-16T10:44:26.993Z","etag":null,"topics":["benchmarking","failure-injection","postgresql","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesovsky.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-23T19:20:10.000Z","updated_at":"2024-08-30T16:47:20.000Z","dependencies_parsed_at":"2023-12-19T12:11:46.256Z","dependency_job_id":"ffad4258-7665-4ae9-bdc9-7ff8c8878289","html_url":"https://github.com/lesovsky/noisia","commit_stats":{"total_commits":103,"total_committers":4,"mean_commits":25.75,"dds":"0.029126213592232997","last_synced_commit":"4f857737744b48b7caf5ac5140d00a6bc163b4d7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesovsky%2Fnoisia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesovsky%2Fnoisia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesovsky%2Fnoisia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesovsky%2Fnoisia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesovsky","download_url":"https://codeload.github.com/lesovsky/noisia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182367,"owners_count":20897380,"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":["benchmarking","failure-injection","postgresql","testing"],"created_at":"2024-07-31T15:00:50.928Z","updated_at":"2025-04-04T13:12:17.660Z","avatar_url":"https://github.com/lesovsky.png","language":"Go","funding_links":[],"categories":["Go","Data"],"sub_categories":["Generation/Masking/Subsetting"],"readme":"# Noisia\n\n**Harmful workload generator for PostgreSQL.**\n\n---\n\n#### Supported workloads:\n- `idle transactions` - active transactions on hot-write tables that do nothing during their lifetime.\n- `rollbacks` - fake invalid queries that generate errors and increase rollbacks counter.\n- `waiting transactions` - transactions that lock hot-write tables and then idle, leading to other transactions getting stuck\n- `deadlocks` - simultaneous transactions where each holds locks that the other transactions want.\n- `temporary files` - queries that produce on-disk temporary files due to lack of `work_mem`.\n- `terminate backends` - terminate random backends (or queries) using `pg_terminate_backend()`, `pg_cancel_backend()`.\n- `failed connections` - exhaust all available connections (other clients unable to connect to Postgres).\n- `fork connections` - execute single, short query in a dedicated connection (lead to excessive forking of Postgres backends).\n- ...see built-in help for more runtime options.\n\n#### Disclaimer\n\nATTENTION: USE ONLY FOR TESTING PURPOSES, DO NOT EXECUTE NOISIA WITHOUT COMPLETE UNDERSTANDING WHAT YOU REALLY DO, RECKLESS USAGE WILL CAUSE PROBLEMS.\n\nDISCLAIMER: THIS SOFTWARE PROVIDED AS-IS WITH NO CARES AND GUARANTEES RELATED TO YOUR DATABASES. USE AT YOUR OWN RISK.\n\n\n#### Installation and usage\nCheck out [releases](https://github.com/lesovsky/noisia/releases) page.\n \n#### Using Docker\n```shell script\ndocker pull lesovsky/noisia:latest\ndocker run --rm -ti lesovsky/noisia:latest noisia --help\n```\n\n#### Using in your own code\nYou can import `noisia` and use necessary workloads in your code. Always use contexts to avoid infinite run. See tiny example below:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/lesovsky/noisia/waitxacts\"\n\t\"github.com/rs/zerolog\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc main() {\n\tconfig := waitxacts.Config{\n\t\tConninfo:    \"host=127.0.0.1\",\n\t\tJobs:        2,\n\t\tLocktimeMin: 5*time.Second,\n\t\tLocktimeMax: 20*time.Second,\n\t}\n\n\tlogger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(zerolog.InfoLevel).With().Timestamp().Logger()\n\n\tctx, cancel := context.WithTimeout(context.Background(), 4*time.Second)\n\tdefer cancel()\n\n\tw, err := waitxacts.NewWorkload(config, logger)\n\tif err != nil {\n\t\tlog.Panicln(err)\n\t}\n\t\n\terr = w.Run(ctx)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n```\n\n#### Workload impact\n\nRunning workloads could impact already running workloads produced by other applications. This impact might be expressed as performance degradation, transactions getting stuck, cancelled queries, disconnected clients, etc.\n\n| Workload  | Impact? |\n| :---         |     :---:      |\n| deadlocks  | No  |\n| failconns  | **Yes**: exhaust `max_connections` limit; this leads to other clients are unable to connect to Postgres |\n| forkconns  | **Yes**: excessive creation of Postgres child processes; potentially might lead to `max_connections` exhaustion |\n| idlexacts  | **Yes**: might lead to tables and indexes bloat |\n| rollbacks  | No  |\n| tempfiles  | **Yes**: might increase storage utilization and degrade storage performance  |\n| terminate  | **Yes**: already established database connections could be terminated accidentally  |\n| waitxacts  | **Yes**: locks heavy-write tables; this leads to blocking concurrently executed queries  |\n\n#### Contribution\n- PR's are welcome.\n- Ideas could be proposed [here](https://github.com/lesovsky/noisia/discussions)\n- About grammar issues or typos let me know [here](https://github.com/lesovsky/noisia/discussions/8).\n\n#### License\nBSD-3. See [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesovsky%2Fnoisia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesovsky%2Fnoisia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesovsky%2Fnoisia/lists"}