falcon 0.18.13 → 0.18.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9659bc49dc82bda41ea6368df1b92cd11d53c4da7bf2b22df8655545db060746
4
- data.tar.gz: 0be64f7c3375c0bef7780d3ec436e342290bded22737c298bbbe0cfe05f25606
3
+ metadata.gz: 00d78cf28ce29545aadf35ae46f9c74d9a17d735104a0ae14e89e65d4971b9cf
4
+ data.tar.gz: bb8ebf365e2c1b509e02d59e5f3777f2afd7dc93ba36766093115a12276f73f7
5
5
  SHA512:
6
- metadata.gz: 7edd8ae1b5b6d4888cc534c0944dd41e71470b491b86cc8087fd067ddfc07a358fcef9f983dc93bfbf060cc33b9e6eba3305a26fa062034f1f071738094baeff
7
- data.tar.gz: 38581cf232942801f4aa51e1644406c9d512f5e878073ea8232de6e8e3a8daa5941fd93b3c16b91b063e361189b5e1cdb2e766b4e130064171794e0438a06532
6
+ metadata.gz: 5815df38ef80aec5070a315513e90507c1e6e012d8f4ae72b3346fe04f2370f3bcc54d9b58f33d5159c5360abb2a4768561593a153477cf3cc93874a947e0c28
7
+ data.tar.gz: 1ebfc78ee21151b7e7f4c119b910bac160e2c33e178a4d706bb8367c73964b1d6247cc3bf54304ebdc7b520f4775f269f70f6791c4c66fc3506b58a4e1bed792
@@ -9,6 +9,9 @@ addons:
9
9
  - wrk
10
10
  - apache2-utils
11
11
 
12
+ after_success:
13
+ - bundle exec rake benchmark:compare
14
+
12
15
  matrix:
13
16
  include:
14
17
  - rvm: 2.3
data/Gemfile CHANGED
@@ -11,4 +11,6 @@ group :test do
11
11
  gem 'coveralls', require: false
12
12
 
13
13
  gem 'async-process', '~> 1.1.0'
14
+
15
+ gem 'puma'
14
16
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ![Falcon](logo.svg)
2
2
 
3
- Falcon is a multi-process, multi-fiber rack-compatible HTTP server built on top of [async], [async-io], [async-container] and [async-http]. Each request is run within a light weight fiber and can block on up-stream requests without stalling the entire server process. Supports HTTP/1 and HTTP/2 natively. [Paid business support](#business-support) is available.
3
+ Falcon is a multi-process, multi-fiber rack-compatible HTTP server built on top of [async], [async-io], [async-container] and [async-http]. Each request is run within a lightweight fiber and can block on up-stream requests without stalling the entire server process. Supports HTTP/1 and HTTP/2 natively. [Priority Business Support](#priority-business-support) is available.
4
4
 
5
5
  [![Build Status](https://secure.travis-ci.org/socketry/falcon.svg)](http://travis-ci.org/socketry/falcon)
6
6
  [![Code Climate](https://codeclimate.com/github/socketry/falcon.svg)](https://codeclimate.com/github/socketry/falcon)
@@ -76,7 +76,7 @@ Falcon supports `rack.hijack` for HTTP/1.x connections. You can thus use [async-
76
76
 
77
77
  #### ActionCable
78
78
 
79
- The `rack.hijack` functionality is compatible with ActionCable. If you use the `async` adapter, you should run falcon in threaded mode, or in forked mode with `--concurrency 1`. Otherwise, your messaging system will be distributed over several processes with no IPC mechanism.
79
+ The `rack.hijack` functionality is compatible with ActionCable. If you use the `async` adapter, you should run falcon in threaded mode, or in forked mode with `--concurrency 1`. Otherwise, your messaging system will be distributed over several processes with no IPC mechanism. You might like to try out [async-redis](https://github.com/socketry/async-redis) as an asynchronous message bus.
80
80
 
81
81
  ### Integration with Guard
82
82
 
@@ -112,21 +112,21 @@ Falcon uses a pre-fork model which loads the entire rack application before fork
112
112
 
113
113
  [async-http] has been designed carefully to minimize IO related garbage. This avoids large per-request memory allocations or disk usage, provided that you use streaming IO.
114
114
 
115
- ## Business Support
115
+ ## Priority Business Support
116
116
 
117
- If you use this software for business purposes, please consider purchasing Business Support. The agreement will give you:
117
+ Falcon can be an important part of your business or project, both improving performance and saving money. As such, priority business support is available to make every project a success. The agreement will give you:
118
118
 
119
- - Better software through funded development and testing.
120
- - Access to advanced features (outlined below).
119
+ - Better software by funding development and testing.
120
+ - Access to "Stretch" goals as outlined below.
121
121
  - Advance notification of bugs and security issues.
122
122
  - Priority consideration of feature requests and bug reports.
123
123
  - Private support and assistance via direct email.
124
124
 
125
- The price for business support is $600.00 USD / project / year. Please [contact us](mailto:context@oriontransfer.co.nz?subject=Falcon%20Business%20Support) for more details.
125
+ The standard price for business support is $120.00 USD / year / production instance (including reserve instances). Please [contact us](mailto:context@oriontransfer.net?subject=Falcon%20Business%20Support) for more details.
126
126
 
127
127
  ### "Stretch" Goals
128
128
 
129
- I would like to invest more time in business specific features. For each paying project as outlined above, one vote is available to prioritize the below work.
129
+ Each paying business customer is entitled to one vote to prioritize the below work.
130
130
 
131
131
  - Add support for push promises and stream prioritization in [async-http].
132
132
  - Add support for rolling restarts in [async-container].
@@ -146,6 +146,14 @@ I would like to invest more time in business specific features. For each paying
146
146
  4. Push to the branch (`git push origin my-new-feature`)
147
147
  5. Create new Pull Request
148
148
 
149
+ ### Donations
150
+
151
+ If you want to donate to this project, you may do so using [BitCoin](https://www.blockchain.com/btc/payment_request?address=1BU3RnjB7fS9XmiTHgbmLKL36S5kccovs8). All money donated this way will be used to further development of this and related open source projects.
152
+
153
+ ### Responsible Disclosure
154
+
155
+ We take the security of our systems seriously, and we value input from the security community. The disclosure of security vulnerabilities helps us ensure the security and privacy of our users. If you believe you've found a security vulnerability in one of our products or platforms please [tell us via email](mailto:security@oriontransfer.net).
156
+
149
157
  ## License
150
158
 
151
159
  Released under the MIT license.
data/Rakefile CHANGED
@@ -5,6 +5,9 @@ RSpec::Core::RakeTask.new(:test)
5
5
 
6
6
  task :default => :test
7
7
 
8
+ # Load all rake tasks:
9
+ import(*Dir.glob('tasks/**/*.rake'))
10
+
8
11
  task :server do
9
12
  require 'async/reactor'
10
13
  require 'async/http/server'
@@ -68,4 +71,5 @@ task :wrk do
68
71
  Process.kill(:KILL, pid)
69
72
  Process.wait pid
70
73
  end
71
- end
74
+ end
75
+
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env falcon --verbose serve -c
2
+
3
+ class Benchmark
4
+ def initialize(app)
5
+ @app = app
6
+ end
7
+
8
+ PATH_INFO = 'PATH_INFO'.freeze
9
+
10
+ SMALL = [200, {}, ["Hello World\n" * 10] * 10].freeze
11
+
12
+ def small(env)
13
+ SMALL
14
+ end
15
+
16
+ BIG = [200, {}, ["Hello World\n" * 100] * 100].freeze
17
+
18
+ def big(env)
19
+ BIG
20
+ end
21
+
22
+ def call(env)
23
+ _, name, *path = env[PATH_INFO].split("/")
24
+
25
+ method = name&.to_sym
26
+
27
+ if method and self.respond_to?(method)
28
+ self.send(method, env)
29
+ else
30
+ @app.call(env)
31
+ end
32
+ end
33
+ end
34
+
35
+ use Benchmark
36
+
37
+ run lambda {|env| [200, {}, ["Hello World"]]}
38
+
@@ -1,4 +1,3 @@
1
1
  #!/usr/bin/env falcon --verbose serve -c
2
2
 
3
- run lambda {|env| [200, {}, ["Hello World"]]}
4
-
3
+ run lambda {|env| [200, {}, ["Hello World"]]}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.add_dependency("http-protocol", "~> 0.6.0")
20
20
 
21
21
  spec.add_dependency("async-io", "~> 1.9")
22
- spec.add_dependency("async-http", "~> 0.33.0")
22
+ spec.add_dependency("async-http", "~> 0.34.0")
23
23
  spec.add_dependency("async-container", "~> 0.6.0")
24
24
 
25
25
  spec.add_dependency("rack", ">= 1.0")
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.18.13"
22
+ VERSION = "0.18.14"
23
23
  end
@@ -0,0 +1,76 @@
1
+
2
+ namespace :benchmark do
3
+ task :compare do
4
+ require 'etc'
5
+
6
+ require 'async/reactor'
7
+ require 'async/process'
8
+ require 'async/clock'
9
+ require 'async/io/stream'
10
+ require 'async/http/url_endpoint'
11
+
12
+ host = "http://127.0.0.1:9292"
13
+ config_path = File.expand_path("../examples/benchmark/config.ru", __dir__)
14
+
15
+ threads = Etc.nprocessors
16
+
17
+ servers = [
18
+ ["puma", "--bind", host.gsub("http", "tcp")],
19
+ ["puma", "--workers", threads.to_s, "--bind", host.gsub("http", "tcp")],
20
+ ["falcon", "--bind", host, "--config"]
21
+ ]
22
+
23
+ endpoint = Async::HTTP::URLEndpoint.parse(host)
24
+
25
+ servers.each do |command|
26
+ ::Async::Reactor.run do |task|
27
+ begin
28
+ server_status = nil
29
+
30
+ # This computes the startup time:
31
+ start_time = Async::Clock.now
32
+
33
+ server_task = task.async do
34
+ $stderr.puts "Starting #{command.first}"
35
+ server_status = Async::Process.spawn(*command, config_path)
36
+ end
37
+
38
+ begin
39
+ unless server_status.nil?
40
+ raise RuntimeError, "Server failed to start: #{server_status}"
41
+ end
42
+
43
+ socket = endpoint.connect
44
+
45
+ request = Async::HTTP::Request.new("localhost", "GET", "/small")
46
+ stream = Async::IO::Stream.new(socket)
47
+ protocol = Async::HTTP::Protocol::HTTP1.client(stream)
48
+
49
+ response = protocol.call(request)
50
+
51
+ response.close
52
+
53
+ socket.close
54
+ rescue Errno::ECONNREFUSED
55
+ task.sleep 0.01
56
+
57
+ retry
58
+ end
59
+
60
+ end_time = Async::Clock.now
61
+
62
+ $stderr.puts "** Took #{end_time - start_time}s to start #{command.first}."
63
+
64
+ threads.times do |n|
65
+ c = (2**n).to_s
66
+ puts "Running #{command.first} with #{c} concurrent connections..."
67
+
68
+ status = Async::Process.spawn("wrk", "-c", c.to_s, "-t", (n+1).to_s, "-d", "1", "#{host}/big")
69
+ end
70
+ ensure
71
+ server_task.stop
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.13
4
+ version: 0.18.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-02 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-protocol
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.33.0
47
+ version: 0.34.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.33.0
54
+ version: 0.34.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: async-container
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -194,6 +194,7 @@ files:
194
194
  - Rakefile
195
195
  - bin/falcon
196
196
  - examples/beer/config.ru
197
+ - examples/benchmark/config.ru
197
198
  - examples/hello/config.ru
198
199
  - examples/sinatra/Gemfile
199
200
  - examples/sinatra/Gemfile.lock
@@ -217,6 +218,7 @@ files:
217
218
  - logo.afdesign
218
219
  - logo.svg
219
220
  - server.rb
221
+ - tasks/benchmark.rake
220
222
  homepage: https://github.com/socketry/falcon
221
223
  licenses: []
222
224
  metadata: {}