@@ -49,10 +49,10 @@ Let's test 3 cases:
4949---
5050``` sh
5151postgres@dev:~ $ # ### http, localhost
52- postgres@dev:~ $ echo " select left(http_get.content, 50) from http_get('http://localhost/');" > ~ /local_http_c.sql
53- postgres@dev:~ $ echo " select left(_get, 50) from http_client._get('http://localhost/', 2);" > ~ /local_http_plsh.sql
54- postgres@dev:~ $ echo " select left(get, 50) from get('http://localhost/');" > ~ /local_http_python.sql
55- postgres@dev:~ $ echo " select left(get_python3, 50) from get_python3('http://localhost/');" > ~ /local_http_python3.sql
52+ postgres@dev:~ $ echo " select left(http_get.content, 50) from http_get('http://localhost/robots.txt ');" > ~ /local_http_c.sql
53+ postgres@dev:~ $ echo " select left(_get, 50) from http_client._get('http://localhost/robots.txt ', 2);" > ~ /local_http_plsh.sql
54+ postgres@dev:~ $ echo " select left(get, 50) from get('http://localhost/robots.txt ');" > ~ /local_http_python.sql
55+ postgres@dev:~ $ echo " select left(get_python3, 50) from get_python3('http://localhost/robots.txt ');" > ~ /local_http_python3.sql
5656postgres@dev:~ $ pgbench -f ~ /local_http_c.sql -c 10 -t 100 test
5757starting vacuum...end.
5858transaction type: /var/lib/postgresql/local_http_c.sql
@@ -62,9 +62,9 @@ number of clients: 10
6262number of threads: 1
6363number of transactions per client: 100
6464number of transactions actually processed: 1000/1000
65- latency average = 5.250 ms
66- tps = 1904.627674 (including connections establishing)
67- tps = 1915.319878 (excluding connections establishing)
65+ latency average = 5.013 ms
66+ tps = 1994.932871 (including connections establishing)
67+ tps = 2007.401692 (excluding connections establishing)
6868postgres@dev:~ $ pgbench -f ~ /local_http_plsh.sql -c 10 -t 100 test
6969starting vacuum...end.
7070transaction type: /var/lib/postgresql/local_http_plsh.sql
@@ -74,9 +74,9 @@ number of clients: 10
7474number of threads: 1
7575number of transactions per client: 100
7676number of transactions actually processed: 1000/1000
77- latency average = 19.543 ms
78- tps = 511.693475 (including connections establishing)
79- tps = 512.487107 (excluding connections establishing)
77+ latency average = 19.199 ms
78+ tps = 520.853950 (including connections establishing)
79+ tps = 521.675404 (excluding connections establishing)
8080postgres@dev:~ $ pgbench -f ~ /local_http_python.sql -c 10 -t 100 test
8181starting vacuum...end.
8282transaction type: /var/lib/postgresql/local_http_python.sql
@@ -86,9 +86,9 @@ number of clients: 10
8686number of threads: 1
8787number of transactions per client: 100
8888number of transactions actually processed: 1000/1000
89- latency average = 4.093 ms
90- tps = 2443.022605 (including connections establishing)
91- tps = 2461.714190 (excluding connections establishing)
89+ latency average = 2.203 ms
90+ tps = 4539.882871 (including connections establishing)
91+ tps = 4602.161543 (excluding connections establishing)
9292postgres@dev:~ $ pgbench -f ~ /local_http_python3.sql -c 10 -t 100 test
9393starting vacuum...end.
9494transaction type: /var/lib/postgresql/local_http_python3.sql
@@ -98,9 +98,9 @@ number of clients: 10
9898number of threads: 1
9999number of transactions per client: 100
100100number of transactions actually processed: 1000/1000
101- latency average = 4.611 ms
102- tps = 2168.910404 (including connections establishing)
103- tps = 2183.211150 (excluding connections establishing)
101+ latency average = 3.180 ms
102+ tps = 3144.268470 (including connections establishing)
103+ tps = 3175.129339 (excluding connections establishing)
104104postgres@dev:~ $
105105postgres@dev:~ $
106106postgres@dev:~ $ # ### http, ya.ru
@@ -289,10 +289,10 @@ Conclusions
289289
290290Method | Latency, ms | TPS
291291------------ | ------------- | -------------
292- pgsql-http (C) | 5.25 | 1915
293- plsh (curl) | 19.5 | 512
294- plpython2u | 4.09 | 2462
295- plpython3u | 4.61 | 2183
292+ pgsql-http (C) | 5.01 | 2007
293+ plsh (curl) | 19.20 | 521.6
294+ plpython2u | 2.20 | 4602
295+ plpython3u | 3.18 | 3175
296296
297297### Results for HTTP, ya.ru:
298298
0 commit comments