postgresql-connection-tester

command module
v0.0.0-...-84aecce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

postgresqm-connection-tester

This is a quick hack to abuse a postgresql database. It will connect to the URI specified in the envar DATABASE_URL (eg: postgresql://127.0.0.1/template1) and issue a pile of queries. The template1database,or any database with a table calledpg_typewith atypname string` column, will work. No writes are made.

The envar CONCURRENT_CONNECTIONS specifies the number of concurrent database connections to attempt. There is no syncronization, so it's possible some will finish prior to others completing. In my test, 100 (with a limit of 100 in the server) properly works. 101 fails with an error. 500 fails with a different error, perhaps related to the OS limiting TCP connection rate.

Example

CONCURRENT_CONNECTIONS=101 DATABASE_URL="postgresql://127.0.0.1/template1" go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL