Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'd start with the benchmark tool that comes with postgresql: pgbench.

pgbench can be used immediately with several pre-set scenario's (e.g. write-heavy, readonly), but it can also be given custom SQL to test your own data/queries.

Or perhaps start right away with Greg Smith's pgbench-tools, which is built on top of pgbench. It produces output in useful series of text, graphs, html. Very nice.

I've heard good things about Tsung but never used it. It would seem that the pgbench-tools are the obvious first thing to run as they require almost no work to get going, and will provide you with a good first idea about your system's performance.

Lots of tuning information in the mailing lists; especially pgsql-performance (and perhaps, pgsql-hackers). The search interface on the postgresql website isn't very good but the mbox files are available too.

(Here is a simple pgbench example, small-scale, readonly. Add command-line connection details if necessary. (this output is from version 9.3devel, 9.2 output is similar (slightly more verbose))).

# # initialise small table... # $ pgbench -h /tmp -i -s 10 creating tables... 100000 of 1000000 tuples (10%) done (elapsed 0.10 s, remaining 0.94 s) +. 200000 of 1000000 tuples (20%) done (elapsed 0.21 s, remaining 0.85 s) +. 300000 of 1000000 tuples (30%) done (elapsed 0.31 s, remaining 0.71 s) +. 400000 of 1000000 tuples (40%) done (elapsed 0.40 s, remaining 0.59 s) +. 500000 of 1000000 tuples (50%) done (elapsed 0.49 s, remaining 0.49 s) +. 600000 of 1000000 tuples (60%) done (elapsed 0.59 s, remaining 0.39 s) +. 700000 of 1000000 tuples (70%) done (elapsed 0.68 s, remaining 0.29 s) +. 800000 of 1000000 tuples (80%) done (elapsed 0.77 s, remaining 0.19 s) +. 900000 of 1000000 tuples (90%) done (elapsed 0.86 s, remaining 0.10 s) +. 1000000 of 1000000 tuples (100%) done (elapsed 0.96 s, remaining 0.00 +s). vacuum... set primary keys... done. # # readonly, 90 concurrent clients, 5 minutes run # $ pgbench -h /tmp -n -S -T 300 -c 90 transaction type: SELECT only scaling factor: 10 query mode: simple number of clients: 90 number of threads: 1 duration: 300 s number of transactions actually processed: 6905843 tps = 23012.221067 (including connections establishing) tps = 23044.131737 (excluding connections establishing)

edit: Of course, quite possibly you have to use a much larger initialisation-value (the 'scale', -s, in the init invocation); and the performance obviously gets *much* worse when the tables do not fit in memory anymore or write-mostly is used as opposed to readonly, as above.

In reply to Re: Load/stress-testing PostgreSQL queries by erix
in thread Load/stress-testing PostgreSQL queries by Dallaylaen

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [ambrus]: Now it has five people instead of three, some sort of call number ticket system where people wait a lot for their food to get ready (it's the same kinds of grilled meat and fish on the same equipment, it won't actually fry slower),
    [ambrus]: it's slow as hell, and the food costs significantly more.
    [ambrus]: We no longer eat there.
    LanX Everybody quotes it, some people read it, and a few people go by it
    [ambrus]: LanX: why would I read it? isn't it a book for managers? I don't want to be a manager.
    [ambrus]: I don't quote it either.
    [erix]: it's really a software book, albeit about experiences from the 60s-80s. People haven't changed all that much though.
    [erix]: a software project book, is probably more exact
    [ambrus]: Yes, but I'm not managing software teams either.
    [ambrus]: I'm not only not a restaurant manager, but also not a software manager.

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (10)
    As of 2017-09-22 13:55 GMT
    Find Nodes?
      Voting Booth?
      During the recent solar eclipse, I:

      Results (264 votes). Check out past polls.