api-fairy 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +109 -2
- data/VERSION +1 -1
- data/api-fairy.gemspec +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -4,7 +4,114 @@ api-fairy
|
|
4
4
|
[![Build Status](https://secure.travis-ci.org/aq1018/api-fairy.png?branch=master)](http://travis-ci.org/aq1018/api-fairy)
|
5
5
|
|
6
6
|
|
7
|
-
api-fairy is a Rack Middleware that **magically** speeds up your slow backend services just by including it
|
7
|
+
api-fairy is a Rack Middleware that **magically** speeds up your slow backend services just by including it in your rack based application. It can be used to speed up API services with slow backends, but you can also use it in any generic rack apps including Ruby On Rails.
|
8
|
+
|
9
|
+
api-fairy packs the following features in a small package:
|
10
|
+
|
11
|
+
* Localized dynamic cache. No memcache server needed.
|
12
|
+
* Efficient memory usage. The memory usage rate is constant.
|
13
|
+
* Multi-thread safe. Supports threaded ruby applications.
|
14
|
+
* Works on ruby 1.8.7, 1.9.2, and 1.9.3
|
15
|
+
* Dramatically increase your applciation speed by 5 - 10 times depending on the backend.
|
16
|
+
* It literally turns your application into **magic**
|
17
|
+
|
18
|
+
Benchmark
|
19
|
+
---------
|
20
|
+
|
21
|
+
Here is a brief benchmark on my company's API service without api-fairy:
|
22
|
+
|
23
|
+
```
|
24
|
+
Benchmarking localhost (be patient).....done
|
25
|
+
|
26
|
+
|
27
|
+
Server Software:
|
28
|
+
Server Hostname: localhost
|
29
|
+
Server Port: 3000
|
30
|
+
|
31
|
+
Document Path: /listings?g=glendale+ca&q=pizza
|
32
|
+
Document Length: 60678 bytes
|
33
|
+
|
34
|
+
Concurrency Level: 5
|
35
|
+
Time taken for tests: 7.897 seconds
|
36
|
+
Complete requests: 100
|
37
|
+
Failed requests: 0
|
38
|
+
Write errors: 0
|
39
|
+
Total transferred: 6087400 bytes
|
40
|
+
HTML transferred: 6067800 bytes
|
41
|
+
Requests per second: 12.66 [#/sec] (mean)
|
42
|
+
Time per request: 394.844 [ms] (mean)
|
43
|
+
Time per request: 78.969 [ms] (mean, across all concurrent requests)
|
44
|
+
Transfer rate: 752.79 [Kbytes/sec] received
|
45
|
+
|
46
|
+
Connection Times (ms)
|
47
|
+
min mean[+/-sd] median max
|
48
|
+
Connect: 0 0 0.0 0 0
|
49
|
+
Processing: 211 389 64.4 388 584
|
50
|
+
Waiting: 208 379 63.6 373 581
|
51
|
+
Total: 211 389 64.4 388 584
|
52
|
+
|
53
|
+
Percentage of the requests served within a certain time (ms)
|
54
|
+
50% 388
|
55
|
+
66% 415
|
56
|
+
75% 432
|
57
|
+
80% 448
|
58
|
+
90% 462
|
59
|
+
95% 504
|
60
|
+
98% 552
|
61
|
+
99% 584
|
62
|
+
100% 584 (longest request)
|
63
|
+
```
|
64
|
+
|
65
|
+
With api-fairy:
|
66
|
+
|
67
|
+
```
|
68
|
+
Benchmarking localhost (be patient).....done
|
69
|
+
|
70
|
+
|
71
|
+
Server Software:
|
72
|
+
Server Hostname: localhost
|
73
|
+
Server Port: 3000
|
74
|
+
|
75
|
+
Document Path: /listings?g=glendale+ca&q=pizza
|
76
|
+
Document Length: 5 bytes
|
77
|
+
|
78
|
+
Concurrency Level: 5
|
79
|
+
Time taken for tests: 1.187 seconds
|
80
|
+
Complete requests: 100
|
81
|
+
Failed requests: 0
|
82
|
+
Write errors: 0
|
83
|
+
Total transferred: 12200 bytes
|
84
|
+
HTML transferred: 500 bytes
|
85
|
+
Requests per second: 84.24 [#/sec] (mean)
|
86
|
+
Time per request: 59.357 [ms] (mean)
|
87
|
+
Time per request: 11.871 [ms] (mean, across all concurrent requests)
|
88
|
+
Transfer rate: 10.04 [Kbytes/sec] received
|
89
|
+
|
90
|
+
Connection Times (ms)
|
91
|
+
min mean[+/-sd] median max
|
92
|
+
Connect: 0 0 0.0 0 0
|
93
|
+
Processing: 0 59 238.4 2 1092
|
94
|
+
Waiting: 0 57 238.5 0 1092
|
95
|
+
Total: 0 59 238.4 2 1092
|
96
|
+
|
97
|
+
Percentage of the requests served within a certain time (ms)
|
98
|
+
50% 2
|
99
|
+
66% 3
|
100
|
+
75% 4
|
101
|
+
80% 5
|
102
|
+
90% 43
|
103
|
+
95% 1092
|
104
|
+
98% 1092
|
105
|
+
99% 1092
|
106
|
+
100% 1092 (longest request)
|
107
|
+
|
108
|
+
```
|
109
|
+
|
110
|
+
Note
|
111
|
+
----
|
112
|
+
|
113
|
+
Rubinus support will be included in the future.
|
114
|
+
|
8
115
|
|
9
116
|
Install
|
10
117
|
-------
|
@@ -12,7 +119,7 @@ Install
|
|
12
119
|
**Bundler**
|
13
120
|
|
14
121
|
```ruby
|
15
|
-
gem "api-fairy", ">= 0.
|
122
|
+
gem "api-fairy", ">= 0.2.0"
|
16
123
|
```
|
17
124
|
|
18
125
|
Usage
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/api-fairy.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-fairy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash:
|
147
|
+
hash: 2925224066698913283
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|