tl;dr - Improvement from 16s down to < 1s
With 6 months of well license data: start_date: 2014-10-18, end_date: 2015-03-05 and a single filter by operator name: Standard Exploration Ltd.
Request:
bcurl 'http://localhost:3000/api/v1/maps/asset_list' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'X-CSRF-Token: ZvnjmboKTk/1Q00175Bh3aUaU6Gn04GBrWCZXSWT3cM=' \
-H 'Accept-Language: en-US,en;q=0.8,pt;q=0.6' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Connection: keep-alive' \
-H 'DNT: 1' \
--compressed --concurrency 2 --requests 30 \
--data '{"start_date":"2014-10-18","end_date":"2015-03-05","filters":{"story_types":["well_licenses"],"filter_set_attributes":{"filters_attributes":[{"entity":"wells", "filter_field":"operator_name", "filter_values":["Standard Exploration Ltd."]}]}}}'
# Without Fix:
Summary:
Total: 265.3317 secs.
Slowest: 18.8894 secs.
Fastest: 16.5859 secs.
Average: 17.6509 secs.
Requests/sec: 0.1131
Status code distribution:
[200] 30 responses
Response time histogram:
16.586 [1] |∎∎∎∎∎∎
16.816 [2] |∎∎∎∎∎∎∎∎∎∎∎∎∎
17.047 [5] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
17.277 [2] |∎∎∎∎∎∎∎∎∎∎∎∎∎
17.507 [3] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
17.738 [5] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
17.968 [2] |∎∎∎∎∎∎∎∎∎∎∎∎∎
18.198 [3] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
18.429 [1] |∎∎∎∎∎∎
18.659 [0] |
18.889 [6] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
Latency distribution:
10% in 16.8319 secs.
25% in 17.1345 secs.
50% in 17.5281 secs.
75% in 18.2657 secs.
90% in 18.7712 secs.
95% in 18.8894 secs.
# With Fix:
Summary:
Total: 5.0707 secs.
Slowest: 0.5725 secs.
Fastest: 0.2393 secs.
Average: 0.3341 secs.
Requests/sec: 5.9163
Status code distribution:
[200] 30 responses
Response time histogram:
0.239 [1] |∎∎∎
0.273 [11] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
0.306 [2] |∎∎∎∎∎∎∎
0.339 [5] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
0.373 [2] |∎∎∎∎∎∎∎
0.406 [2] |∎∎∎∎∎∎∎
0.439 [0] |
0.473 [5] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
0.506 [0] |
0.539 [1] |∎∎∎
0.572 [1] |∎∎∎
Latency distribution:
10% in 0.2470 secs.
25% in 0.2531 secs.
50% in 0.3099 secs.
75% in 0.4465 secs.
90% in 0.4580 secs.
95% in 0.5725 secs.