puma 2.0.0.b7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- data/History.txt +17 -0
- data/README.md +5 -5
- data/docs/nginx.md +2 -7
- data/lib/puma/binder.rb +1 -0
- data/lib/puma/capistrano.rb +7 -2
- data/lib/puma/cli.rb +14 -8
- data/lib/puma/const.rb +1 -1
- data/puma.gemspec +3 -3
- metadata +5 -5
data/History.txt
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
=== 2.0.0 / 2013-04-29
|
2
|
+
|
3
|
+
RailsConf 2013 edition!
|
4
|
+
|
5
|
+
* 2 doc changes:
|
6
|
+
* Start with rackup -s Puma, NOT rackup -s puma.
|
7
|
+
* Minor doc fixes in the README.md, Capistrano section
|
8
|
+
|
9
|
+
* 2 bug fixes:
|
10
|
+
* Fix reading RACK_ENV properly. Fixes #234
|
11
|
+
* Make cap recipe handle tmp/sockets; fixes #228
|
12
|
+
|
13
|
+
* 3 minor changes:
|
14
|
+
* Fix capistrano recipe
|
15
|
+
* Fix stdout/stderr logs to sync outputs
|
16
|
+
* allow binding to IPv6 addresses
|
17
|
+
|
1
18
|
=== 2.0.0.b7 / 2013-03-18
|
2
19
|
|
3
20
|
* 5 minor enhancements:
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ Then start your server with the `rails` command:
|
|
51
51
|
|
52
52
|
You can pass it as an option to `rackup`:
|
53
53
|
|
54
|
-
$ rackup -s
|
54
|
+
$ rackup -s Puma
|
55
55
|
|
56
56
|
Alternatively, you can modify your `config.ru` to choose Puma by default, by adding the following as the first line:
|
57
57
|
|
@@ -146,7 +146,7 @@ If you want an easy way to manage multiple scripts at once check [tools/jungle](
|
|
146
146
|
|
147
147
|
## Capistrano deployment
|
148
148
|
|
149
|
-
Puma has included Capistrano [deploy script](https://github.com/
|
149
|
+
Puma has included Capistrano [deploy script](https://github.com/puma/puma/blob/master/lib/puma/capistrano.rb), you just need require that:
|
150
150
|
|
151
151
|
config/deploy.rb
|
152
152
|
|
@@ -157,9 +157,9 @@ require 'puma/capistrano'
|
|
157
157
|
and then
|
158
158
|
|
159
159
|
```bash
|
160
|
-
$
|
161
|
-
$
|
162
|
-
$
|
160
|
+
$ bundle exec cap puma:start
|
161
|
+
$ bundle exec cap puma:restart
|
162
|
+
$ bundle exec cap puma:stop
|
163
163
|
```
|
164
164
|
|
165
165
|
|
data/docs/nginx.md
CHANGED
@@ -53,7 +53,7 @@ server {
|
|
53
53
|
# rewite the url to have explicit .html on the end
|
54
54
|
# and then send it on its way to the next config rule.
|
55
55
|
# if there is no file on the fs then it sets all the
|
56
|
-
# necessary headers and proxies to our upstream
|
56
|
+
# necessary headers and proxies to our upstream pumas
|
57
57
|
if (-f $request_filename.html) {
|
58
58
|
rewrite (.*) $1.html break;
|
59
59
|
}
|
@@ -66,12 +66,7 @@ server {
|
|
66
66
|
|
67
67
|
# Now this supposedly should work as it gets the filenames with querystrings that Rails provides.
|
68
68
|
# BUT there's a chance it could break the ajax calls.
|
69
|
-
location ~* \.(ico|css|gif|jpe?g|png)(\?[0-9]+)?$ {
|
70
|
-
expires max;
|
71
|
-
break;
|
72
|
-
}
|
73
|
-
|
74
|
-
location ~ ^/javascripts/.*\.js(\?[0-9]+)?$ {
|
69
|
+
location ~* \.(ico|css|gif|jpe?g|png|js)(\?[0-9]+)?$ {
|
75
70
|
expires max;
|
76
71
|
break;
|
77
72
|
}
|
data/lib/puma/binder.rb
CHANGED
@@ -163,6 +163,7 @@ module Puma
|
|
163
163
|
# allow to accumulate before returning connection refused.
|
164
164
|
#
|
165
165
|
def add_tcp_listener(host, port, optimize_for_latency=true, backlog=1024)
|
166
|
+
host = host[1..-2] if host[0..0] == '['
|
166
167
|
s = TCPServer.new(host, port)
|
167
168
|
if optimize_for_latency
|
168
169
|
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
data/lib/puma/capistrano.rb
CHANGED
@@ -3,6 +3,11 @@ Capistrano::Configuration.instance.load do
|
|
3
3
|
after 'deploy:start', 'puma:start'
|
4
4
|
after 'deploy:restart', 'puma:restart'
|
5
5
|
|
6
|
+
# Ensure the tmp/sockets directory is created by the deploy:setup task and
|
7
|
+
# symlinked in by the deploy:update task. This is not handled by Capistrano
|
8
|
+
# v2 but is fixed in v3.
|
9
|
+
shared_children.push('tmp/sockets')
|
10
|
+
|
6
11
|
_cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
|
7
12
|
_cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
|
8
13
|
_cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
|
@@ -17,12 +22,12 @@ Capistrano::Configuration.instance.load do
|
|
17
22
|
|
18
23
|
desc 'Stop puma'
|
19
24
|
task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
20
|
-
run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S fetch(:puma_state) stop"
|
25
|
+
run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} stop"
|
21
26
|
end
|
22
27
|
|
23
28
|
desc 'Restart puma'
|
24
29
|
task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
25
|
-
run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S fetch(:puma_state) restart"
|
30
|
+
run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} restart"
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
data/lib/puma/cli.rb
CHANGED
@@ -179,8 +179,7 @@ module Puma
|
|
179
179
|
:binds => [],
|
180
180
|
:workers => 0,
|
181
181
|
:daemon => false,
|
182
|
-
:worker_boot => []
|
183
|
-
:environment => "development"
|
182
|
+
:worker_boot => []
|
184
183
|
}
|
185
184
|
|
186
185
|
@parser = OptionParser.new do |o|
|
@@ -270,9 +269,6 @@ module Puma
|
|
270
269
|
|
271
270
|
o.on "-w", "--workers COUNT",
|
272
271
|
"Activate cluster mode: How many worker processes to create" do |arg|
|
273
|
-
unsupported "-w not supported on JRuby and Windows",
|
274
|
-
jruby? || windows?
|
275
|
-
|
276
272
|
@options[:workers] = arg.to_i
|
277
273
|
end
|
278
274
|
|
@@ -301,9 +297,12 @@ module Puma
|
|
301
297
|
# Try the user option first, then the environment variable,
|
302
298
|
# finally default to development
|
303
299
|
|
304
|
-
|
305
|
-
|
306
|
-
|
300
|
+
env = @options[:environment] ||
|
301
|
+
ENV['RACK_ENV'] ||
|
302
|
+
'development'
|
303
|
+
|
304
|
+
@options[:environment] = env
|
305
|
+
ENV['RACK_ENV'] = env
|
307
306
|
end
|
308
307
|
|
309
308
|
def delete_pidfile
|
@@ -346,6 +345,11 @@ module Puma
|
|
346
345
|
Puma.cli_config = @config
|
347
346
|
|
348
347
|
@config.load
|
348
|
+
|
349
|
+
if @options[:workers]
|
350
|
+
unsupported "worker mode not supported on JRuby and Windows",
|
351
|
+
jruby? || windows?
|
352
|
+
end
|
349
353
|
end
|
350
354
|
|
351
355
|
def graceful_stop(server)
|
@@ -364,11 +368,13 @@ module Puma
|
|
364
368
|
if stdout
|
365
369
|
@io_redirected = true
|
366
370
|
STDOUT.reopen stdout, (append ? "a" : "w")
|
371
|
+
STDOUT.sync = true
|
367
372
|
STDOUT.puts "=== puma startup: #{Time.now} ==="
|
368
373
|
end
|
369
374
|
|
370
375
|
if stderr
|
371
376
|
STDERR.reopen stderr, (append ? "a" : "w")
|
377
|
+
STDERR.sync = true
|
372
378
|
STDERR.puts "=== puma startup: #{Time.now} ==="
|
373
379
|
end
|
374
380
|
end
|
data/lib/puma/const.rb
CHANGED
data/puma.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "puma"
|
5
|
-
s.version = "2.0.0
|
5
|
+
s.version = "2.0.0"
|
6
6
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Phoenix"]
|
9
|
-
s.date = "2013-
|
9
|
+
s.date = "2013-04-29"
|
10
10
|
s.description = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.\n\nUnder the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!\n\nWith Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.\n\nOn MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like [Rubinius](http://rubini.us) or [JRuby](http://jruby.org)."
|
11
11
|
s.email = ["evan@phx.io"]
|
12
12
|
s.executables = ["puma", "pumactl"]
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Evan Phoenix
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -210,9 +210,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
211
|
none: false
|
212
212
|
requirements:
|
213
|
-
- - ! '
|
213
|
+
- - ! '>='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project: puma
|
218
218
|
rubygems_version: 1.8.25
|