Crystalnix/omaha-server — pull request #9 by yurtaev (2014-11-25 11:59:46+00:00)
Title: Refactoring for perfomance optimization

## Omaha

**Before:**

```shell
Running 10s test @ http://192.168.59.103:9090/service/update2
6 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 155.80ms 7.50ms 198.07ms 94.61%
Req/Sec 5.97 1.26 9.00 84.43%
385 requests in 10.02s, 352.29KB read
Requests/sec: 38.41
Transfer/sec: 35.15KB
```

**After:**

```shell
Running 10s test @ http://192.168.59.103:9090/service/update2
6 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 55.97ms 5.27ms 79.53ms 71.12%
Req/Sec 17.70 3.75 26.00 73.96%
1079 requests in 10.02s, 0.96MB read
Requests/sec: 107.66
Transfer/sec: 98.51KB
```

## Sparkle

**Before:**

```shell
ab -n 2000 -c 100 http://docker:9090/sparkle/chrome/stable/appcast.xml

Server Software: nginx/1.4.6
Server Hostname: docker
Server Port: 9090

Document Path: /sparkle/chrome/stable/appcast.xml
Document Length: 936 bytes

Concurrency Level: 100
Time taken for tests: 7.385 seconds
Complete requests: 2000
Failed requests: 0
Total transferred: 2246000 bytes
HTML transferred: 1872000 bytes
Requests per second: 270.82 [#/sec] (mean)
Time per request: 369.252 [ms] (mean)
Time per request: 3.693 [ms] (mean, across all concurrent requests)
Transfer rate: 297.00 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 1.9 5 12
Processing: 15 356 46.2 363 408
Waiting: 15 356 46.2 363 408
Total: 19 361 45.6 366 411

Percentage of the requests served within a certain time (ms)
50% 366
66% 375
75% 379
80% 380
90% 389
95% 395
98% 400
99% 402
100% 411 (longest request)
```

**After:**

```shell
ab -n 2000 -c 100 http://docker:9090/sparkle/chrome/stable/appcast.xml

Server Software: nginx/1.4.6
Server Hostname: docker
Server Port: 9090

Document Path: /sparkle/chrome/stable/appcast.xml
Document Length: 936 bytes

Concurrency Level: 100
Time taken for tests: 0.760 seconds
Complete requests: 2000
Failed requests: 0
Total transferred: 2246000 bytes
HTML transferred: 1872000 bytes
Requests per second: 2631.24 [#/sec] (mean)
Time per request: 38.005 [ms] (mean)
Time per request: 0.380 [ms] (mean, across all concurrent requests)
Transfer rate: 2885.63 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 15 5.5 15 33
Processing: 9 22 5.8 22 51
Waiting: 9 22 5.8 22 51
Total: 15 37 8.1 38 69

Percentage of the requests served within a certain time (ms)
50% 38
66% 40
75% 41
80% 42
90% 48
95% 50
98% 61
99% 64
100% 69 (longest request)
```