1

In order to check if a new version of the database (in staging) react the same way (or better) than the production database, I would like to capture all requests execute on production server, .. to replay them on the staging database.

Is there a tool that does this job ? what would be interesting is the abality to compare execution time, when replay, and highlight queries executed slower.

Else, I thought I would catpure queries by configuring '0' to log_min_statement_duration (so that queries can be logged in postgresql logfile), and then parse the file to grab and re play request on other server.... is there a better way to do it ?

(current database version postgresql9.6, but I'm interesting even if it's for higher version.. for next time)

Enialis
  • 173
  • 1
  • 9
  • Your could try [Streaming replication](https://www.postgresql.org/docs/9.6/warm-standby.html#STREAMING-REPLICATION) – Steeeve Aug 09 '21 at 17:46
  • 2
    There is pgreplay, although it has not impressed me with its robustness or easy of use. – jjanes Aug 09 '21 at 19:02
  • thanks @jjanes ! on the description, it does exactly what I need.. hope that robustness and ease of use will be ok for me ! :) – Enialis Aug 10 '21 at 08:40
  • @Steeeve - I don't think so - I have to reproduce the workload, with 'select' activity. I think 'streaming replication' wouldn't help me on this. So far, pgreplay is the only tool I found to do it. Though, as jjanes said, .. it lacks some options / features to be an impressive tool :) well, .. it helped me quite a lot , so I'm rather grateful that it exists ! :) – Enialis Oct 19 '21 at 09:20

0 Answers0