On 2023-05-23 12:42, Druckenmueller, Marc wrote:
Hi there,

I am investigating possible throughput with PostgreSQL 14.4 on an ARM
i.MX6 Quad CPU (NXP sabre board).

Testing with a simple python script (running on the same CPU), I get
~1000 request/s.

I tweaked your script slightly, but this is what I got on the Raspberry Pi 4 that I have in the corner of the room. Almost twice the speed you are seeing.

    0: this = 0.58 tot = 0.58
    1: this = 0.55 tot = 1.13
    2: this = 0.59 tot = 1.72
    3: this = 0.55 tot = 2.27
    4: this = 0.56 tot = 2.83
    5: this = 0.57 tot = 3.40
    6: this = 0.56 tot = 3.96
    7: this = 0.55 tot = 4.51
    8: this = 0.59 tot = 5.11
    9: this = 0.60 tot = 5.71

That's with governor=performance and a couple of background tasks running as well as the python. PostgreSQL 15 in a container on a Debian O.S. I've not done any tuning on PostgreSQL (but your call isn't doing anything really) nor the Pi.

The minor tweaks to your script were as below:

    import psycopg as pg
    import time

    conn = pg.connect('')
    conn.autocommit = True
    cur = conn.cursor()
    start = time.time()
    prev = start
    end = start
    for j in range(10):
        for i in range(1000):
cur.execute("call dummy_call(%s,%s,%s, ARRAY[%s, %s, %s]::real[]);", (1,2,3, 4.0, 5.0, 6.0), binary=True )
        end = time.time()
print(f"{j}: this = {(end - prev):.2f} tot = {(end - start):.2f}")
        prev = end

--
  Richard Huxton


Reply via email to