Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def self.get_async_db
return unless ENV['DATABASE_URL']
ConnectionPool.new(size: pool_size, timeout: 5) do
db = PG.connect(ENV['DATABASE_URL'])
db.field_name_type = :symbol
db.prepare('select', SELECT_QUERY)
db.prepare('crud_get', CRUD_GET_SQL)
db.prepare('crud_list', CRUD_LIST_SQL)
Expand Down
16 changes: 8 additions & 8 deletions frameworks/rails/app/controllers/benchmark_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def async_db

items = rows.map do |r|
{
id: r['id'],
name: r['name'],
category: r['category'],
price: r['price'],
quantity: r['quantity'],
active: r['active'] == 't',
tags: JSON.parse(r['tags']),
rating: { score: r['rating_score'], count: r['rating_count'] }
id: r[:id],
name: r[:name],
category: r[:category],
price: r[:price],
quantity: r[:quantity],
active: r[:active] == 't',
tags: JSON.parse(r[:tags]),
rating: { score: r[:rating_score], count: r[:rating_count] }
}
end
render json: { items: items, count: items.length }
Expand Down
16 changes: 8 additions & 8 deletions frameworks/rails/app/controllers/items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ def update

def map_row(row)
mapped_row = {
id: row['id'],
name: row['name'],
category: row['category'],
price: row['price'],
quantity: row['quantity'],
active: row['active'] == 1,
id: row[:id],
name: row[:name],
category: row[:category],
price: row[:price],
quantity: row[:quantity],
active: row[:active] == 1,
}
mapped_row[:tags] = JSON.parse(row['tags']) if row['tags']
mapped_row[:rating] = { score: row['rating_score'], count: row['rating_count'] } if row['rating_score'] && row['rating_count']
mapped_row[:tags] = JSON.parse(row[:tags]) if row.has_key?(:tags)
mapped_row[:rating] = { score: row[:rating_score], count: row[:rating_count] } if row.has_key?(:rating_score) && row.has_key?(:rating_count)
mapped_row
end
end
24 changes: 12 additions & 12 deletions site/data/api-16-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,28 +802,28 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 25015,
"avg_latency": "39.99ms",
"p99_latency": "129.10ms",
"cpu": "1675.4%",
"memory": "874MiB",
"rps": 27271,
"avg_latency": "36.35ms",
"p99_latency": "122.80ms",
"cpu": "1677.7%",
"memory": "1.3GiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "131.55MB/s",
"input_bw": "1.41MB/s",
"reconnects": 74953,
"status_2xx": 375225,
"bandwidth": "143.48MB/s",
"input_bw": "1.53MB/s",
"reconnects": 81736,
"status_2xx": 409072,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 140651,
"tpl_json": 140741,
"tpl_baseline": 153238,
"tpl_json": 153516,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 93833
"tpl_async_db": 102317
},
{
"framework": "ring-http-exchange",
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-4-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,28 +802,28 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 9974,
"avg_latency": "25.24ms",
"p99_latency": "98.90ms",
"cpu": "394.6%",
"memory": "309MiB",
"rps": 10407,
"avg_latency": "24.03ms",
"p99_latency": "95.20ms",
"cpu": "395.4%",
"memory": "438MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "52.43MB/s",
"input_bw": "574.67KB/s",
"reconnects": 29915,
"status_2xx": 149617,
"bandwidth": "54.69MB/s",
"input_bw": "599.62KB/s",
"reconnects": 31204,
"status_2xx": 156119,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 56124,
"tpl_json": 56125,
"tpl_baseline": 58595,
"tpl_json": 58531,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 37368
"tpl_async_db": 38993
},
{
"framework": "ring-http-exchange",
Expand Down
18 changes: 9 additions & 9 deletions site/data/async-db-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,19 +636,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 70016,
"avg_latency": "14.03ms",
"p99_latency": "30.40ms",
"cpu": "6400.0%",
"memory": "2.9GiB",
"rps": 73527,
"avg_latency": "13.26ms",
"p99_latency": "28.10ms",
"cpu": "6397.6%",
"memory": "3.6GiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "291.08MB/s",
"input_bw": "4.67MB/s",
"reconnects": 27721,
"status_2xx": 700163,
"bandwidth": "305.51MB/s",
"input_bw": "4.91MB/s",
"reconnects": 29152,
"status_2xx": 735270,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,19 +929,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 34491,
"avg_latency": "100.31ms",
"p99_latency": "346.90ms",
"cpu": "5030.2%",
"memory": "6.6GiB",
"rps": 33059,
"avg_latency": "103.88ms",
"p99_latency": "340.50ms",
"cpu": "4844.8%",
"memory": "6.4GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "7.27MB/s",
"input_bw": "2.66MB/s",
"bandwidth": "6.96MB/s",
"input_bw": "2.55MB/s",
"reconnects": 0,
"status_2xx": 172456,
"status_2xx": 165297,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/baseline-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,19 +929,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 80896,
"avg_latency": "6.34ms",
"p99_latency": "84.80ms",
"cpu": "5651.8%",
"memory": "6.8GiB",
"rps": 78005,
"avg_latency": "6.59ms",
"p99_latency": "86.90ms",
"cpu": "5834.7%",
"memory": "8.3GiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "17.04MB/s",
"input_bw": "6.25MB/s",
"reconnects": 307,
"status_2xx": 404484,
"bandwidth": "16.44MB/s",
"input_bw": "6.03MB/s",
"reconnects": 295,
"status_2xx": 390028,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/crud-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 61399,
"avg_latency": "64.18ms",
"p99_latency": "90.80ms",
"cpu": "4424.0%",
"memory": "4.3GiB",
"rps": 59399,
"avg_latency": "66.12ms",
"p99_latency": "90.20ms",
"cpu": "4350.6%",
"memory": "4.2GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "27.38MB/s",
"input_bw": "5.27MB/s",
"reconnects": 3877,
"status_2xx": 920997,
"bandwidth": "26.51MB/s",
"input_bw": "5.10MB/s",
"reconnects": 3257,
"status_2xx": 890989,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 120806,
"avg_latency": "30.45ms",
"p99_latency": "89.40ms",
"cpu": "6330.5%",
"memory": "3.7GiB",
"rps": 124367,
"avg_latency": "29.07ms",
"p99_latency": "74.20ms",
"cpu": "6419.2%",
"memory": "4.3GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "430.55MB/s",
"input_bw": "5.76MB/s",
"reconnects": 22297,
"status_2xx": 604033,
"bandwidth": "443.16MB/s",
"input_bw": "5.93MB/s",
"reconnects": 23008,
"status_2xx": 621836,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,19 +602,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 84414,
"avg_latency": "108.30ms",
"p99_latency": "556.90ms",
"cpu": "6245.2%",
"memory": "4.9GiB",
"rps": 84743,
"avg_latency": "113.19ms",
"p99_latency": "536.00ms",
"cpu": "6483.5%",
"memory": "4.4GiB",
"connections": 16384,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "123.36MB/s",
"input_bw": "6.28MB/s",
"reconnects": 11919,
"status_2xx": 422071,
"bandwidth": "123.87MB/s",
"input_bw": "6.30MB/s",
"reconnects": 11214,
"status_2xx": 423719,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,19 +602,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 82184,
"avg_latency": "44.70ms",
"p99_latency": "115.20ms",
"cpu": "6431.4%",
"memory": "3.8GiB",
"rps": 85272,
"avg_latency": "42.15ms",
"p99_latency": "78.50ms",
"cpu": "6487.5%",
"memory": "4.2GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "120.03MB/s",
"input_bw": "6.11MB/s",
"reconnects": 14674,
"status_2xx": 410923,
"bandwidth": "124.80MB/s",
"input_bw": "6.34MB/s",
"reconnects": 15291,
"status_2xx": 427217,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,19 +602,19 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 83902,
"avg_latency": "6.10ms",
"p99_latency": "24.50ms",
"cpu": "6435.9%",
"memory": "3.7GiB",
"rps": 81731,
"avg_latency": "6.26ms",
"p99_latency": "24.60ms",
"cpu": "6435.2%",
"memory": "3.4GiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "122.63MB/s",
"input_bw": "6.24MB/s",
"reconnects": 16740,
"status_2xx": 419511,
"bandwidth": "119.46MB/s",
"input_bw": "6.08MB/s",
"reconnects": 16276,
"status_2xx": 408658,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
12 changes: 6 additions & 6 deletions site/data/json-tls-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,18 @@
{
"framework": "rails",
"language": "Ruby",
"rps": 111658,
"avg_latency": "36.51ms",
"p99_latency": "36.51ms",
"cpu": "6424.5%",
"rps": 114275,
"avg_latency": "35.76ms",
"p99_latency": "35.76ms",
"cpu": "6461.4%",
"memory": "4.2GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "398.92MB",
"bandwidth": "408.28MB",
"reconnects": 0,
"status_2xx": 569630,
"status_2xx": 582681,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
Loading