Sign inSign up

miskolabor/pgbench-tester

By miskolabor

•Updated over 3 years ago

Latest version of pgBench for automated tests

Image
0

10K+

miskolabor/pgbench-tester repository overview

This is a simple image to perform pgBench tests against PostgreSQL. The test results will be shown in the log.

⁠Prereqs

  • The target DB (DBNAME) needs to be created and initialized. Eg. pgbench -d ${DBNAME} -h ${SOCKET} -i -s 500. This runs only benchmark tests.
  • Ensure pg_hba.conf file have proper entry to be able to connect to the DB. If the PG username is test, DB name is 'pgbenchand the network address of the PODs is172.16.16.0/24 ` then pg_hba should contain:
host pgbench test    172.16.16.0/24   md5

⁠PARAMETERS

The variables listed below hold values for pgBench parameters.

  • DBNAME - -d paramter, name of the database where pgbench will run it's tests.
  • PGUSER - -U parameter, name of the PostgreSQL user used to connect to the Database
  • CLIENTS_NO - -c parameter , NUmber of clients
  • TEST_DURATION_S - -T parameter. The duration of the test in seconds
  • SOCKET - -h parameter. Can be set to socket or other URL
  • PORT - -p parameter value - PostgreSQL port number.
  • JOBS_NO - -j parameter value
  • TLOGS - name of the file where the pgbench logs will be dropped

⁠Execution

pgbench -d ${DBNAME} -U ${PGUSER} -c ${CLIENTS_NO} -T ${TEST_DURATION_S} -h ${SOCKET} -j ${JOBS_NO} -p ${PORT} -r > ${TLOGS}

When the tests will be completed the ${TLOGS} content will be displayed with benchmark summary and POD will be put to sleep for a random number of seconds (range 60-240).

Tag summary

Content type

Image

Digest

sha256:6d0c7c807…

Size

132.4 MB

Last updated

over 3 years ago

docker pull miskolabor/pgbench-tester