Home

Awesome

Noisia

Harmful workload generator for PostgreSQL.


Supported workloads:

Disclaimer

ATTENTION: USE ONLY FOR TESTING PURPOSES, DO NOT EXECUTE NOISIA WITHOUT COMPLETE UNDERSTANDING WHAT YOU REALLY DO, RECKLESS USAGE WILL CAUSE PROBLEMS.

DISCLAIMER: THIS SOFTWARE PROVIDED AS-IS WITH NO CARES AND GUARANTEES RELATED TO YOUR DATABASES. USE AT YOUR OWN RISK.

Installation and usage

Check out releases page.

Using Docker

docker pull lesovsky/noisia:latest
docker run --rm -ti lesovsky/noisia:latest noisia --help

Using in your own code

You can import noisia and use necessary workloads in your code. Always use contexts to avoid infinite run. See tiny example below:

package main

import (
	"context"
	"fmt"
	"github.com/lesovsky/noisia/waitxacts"
	"github.com/rs/zerolog"
	"log"
	"os"
	"time"
)

func main() {
	config := waitxacts.Config{
		Conninfo:    "host=127.0.0.1",
		Jobs:        2,
		LocktimeMin: 5*time.Second,
		LocktimeMax: 20*time.Second,
	}

	logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(zerolog.InfoLevel).With().Timestamp().Logger()

	ctx, cancel := context.WithTimeout(context.Background(), 4*time.Second)
	defer cancel()

	w, err := waitxacts.NewWorkload(config, logger)
	if err != nil {
		log.Panicln(err)
	}
	
	err = w.Run(ctx)
	if err != nil {
		fmt.Println(err)
	}
}

Workload impact

Running 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.

WorkloadImpact?
deadlocksNo
failconnsYes: exhaust max_connections limit; this leads to other clients are unable to connect to Postgres
forkconnsYes: excessive creation of Postgres child processes; potentially might lead to max_connections exhaustion
idlexactsYes: might lead to tables and indexes bloat
rollbacksNo
tempfilesYes: might increase storage utilization and degrade storage performance
terminateYes: already established database connections could be terminated accidentally
waitxactsYes: locks heavy-write tables; this leads to blocking concurrently executed queries

Contribution

License

BSD-3. See LICENSE for more details.