talko/httpcbench — pull request #1 by andytill (2014-05-05 16:24:53+00:00)
Title: Minor changes to make httpc seem a lot faster than the other libs.  In p...

Minor changes to make httpc seem a lot faster than the other libs. In particular httpc is sensitve to the serving closing persistent connections which causes a `socket_closed_remotely`. The cowboy HTTP server does this every 50 connections, this has been set so it will never close the connection (unless there is an error etc.).

Increased max session count in httpc to 100, where default was 2. httpc will now allow 100 concurrent socket connections.

Setting body_format to binary (default was string) does nothing and under some runs actually made things worse in runtime and memory! So much for micro optimisations.

Painting go faster stripes on other libs like I have done with httpc will probably yield similar results for them.

### Before changes

##### httpc
31000: 6280 rt, 97709 ct, 19.411 MB (9.737 increase), 5 failures
Gave up after 31k, results are awful.

##### lhttpc
100000: 10670 rt, 34087 ct, 13.927 MB (4.458 increase), 0 failures

### After changes

##### httpc
100000: 10600 rt, 32638 ct, 14.646 MB (5.202 increase), 0 failures

##### lhttpc
100000: 10420 rt, 32243 ct, 14.391 MB (4.947 increase), 0 failures

Running Erlang R16B03-1 (erts-5.10.4) on Ubuntu, 3 cores.

I understand that you're testing vanilla client setups so no worries if you do not want to merge, just thought I'd offer my hackings.