Search Postgresql Archives

Re: Slow down dev database transactions/second for testing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 05/02/2023 23:17 CET Richard Brockie <richard.brockie@xxxxxxxxx> wrote:
>
> I maintain a Django webapp that uses postgresql and can create inefficient
> queries if I'm not careful. I'm looking for ways to mimic a congested db
> server in development to expose these queries.

pgbench is what your looking for: https://www.postgresql.org/docs/current/pgbench.html

You can run custom statements with the --file option.  Get the statements that
Django generates and let pgbench run those to analyze the bottlenecks.  Or let
pgbench create load for some time (see option --time) while you debug your
Django app.

> The configuration of postgresql is complicated - is there a simple method by
> which I could, for example limit the number of transactions/second to a
> certain level by adjusting postgresql.conf?

No.  Postgres will execute as fast as possible with the available resources.

--
Erik





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux