@@ -49,10 +49,10 @@ Let's test 3 cases:
49
49
---
50
50
``` sh
51
51
postgres@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
56
56
postgres@dev:~ $ pgbench -f ~ /local_http_c.sql -c 10 -t 100 test
57
57
starting vacuum...end.
58
58
transaction type: /var/lib/postgresql/local_http_c.sql
@@ -62,9 +62,9 @@ number of clients: 10
62
62
number of threads: 1
63
63
number of transactions per client: 100
64
64
number 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)
68
68
postgres@dev:~ $ pgbench -f ~ /local_http_plsh.sql -c 10 -t 100 test
69
69
starting vacuum...end.
70
70
transaction type: /var/lib/postgresql/local_http_plsh.sql
@@ -74,9 +74,9 @@ number of clients: 10
74
74
number of threads: 1
75
75
number of transactions per client: 100
76
76
number 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)
80
80
postgres@dev:~ $ pgbench -f ~ /local_http_python.sql -c 10 -t 100 test
81
81
starting vacuum...end.
82
82
transaction type: /var/lib/postgresql/local_http_python.sql
@@ -86,9 +86,9 @@ number of clients: 10
86
86
number of threads: 1
87
87
number of transactions per client: 100
88
88
number 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)
92
92
postgres@dev:~ $ pgbench -f ~ /local_http_python3.sql -c 10 -t 100 test
93
93
starting vacuum...end.
94
94
transaction type: /var/lib/postgresql/local_http_python3.sql
@@ -98,9 +98,9 @@ number of clients: 10
98
98
number of threads: 1
99
99
number of transactions per client: 100
100
100
number 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)
104
104
postgres@dev:~ $
105
105
postgres@dev:~ $
106
106
postgres@dev:~ $ # ### http, ya.ru
@@ -289,10 +289,10 @@ Conclusions
289
289
290
290
Method | Latency, ms | TPS
291
291
------------ | ------------- | -------------
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
296
296
297
297
### Results for HTTP, ya.ru:
298
298
0 commit comments