leftbee/em-postgresql-adapter — Issue #12: Poor batch select performance vs mysql
Author: fbernier
Created: 2012-01-18 01:41:17+00:00
State: open

Hey,

I just wanted to share some tests I just made. The difference in the results might be caused by something else than the adapter, but I'd like your opinion. I used the same stack for both tests, which consists of Padrino (http://www.padrinorb.com/) and sinatra-syncrony (https://github.com/kyledrake/sinatra-synchrony), I used this adapter for the postgres version, and the em_mysql2 adapter provided by the em-synchrony gem (https://github.com/igrigorik/em-synchrony).

### Mysql (em_mysql2)

ab -c 100 -n 100 http://127.0.0.1:3000/

Concurrency Level: 100
Time taken for tests: 1.088 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 14300 bytes
HTML transferred: 200 bytes
Requests per second: 91.92 [#/sec] (mean)
Time per request: 1087.925 [ms] (mean)
Time per request: 10.879 [ms] (mean, across all concurrent requests)
Transfer rate: 12.84 [Kbytes/sec] received

### Postgres (pg_postgres_adapter)

ab -c 100 -n 100 http://127.0.0.1:3000/

Concurrency Level: 100
Time taken for tests: 0.153 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 14300 bytes
HTML transferred: 200 bytes
Requests per second: 655.00 [#/sec] (mean)
Time per request: 152.672 [ms] (mean)
Time per request: 1.527 [ms] (mean, across all concurrent requests)
Transfer rate: 91.47 [Kbytes/sec] received

So is this cause by mysql2 being more performant than ruby-pg ? I might eventually test in synchronous mode...