puma 5.6.7 → 6.4.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.
- checksums.yaml +4 -4
- data/History.md +269 -13
- data/README.md +78 -29
- data/bin/puma-wild +1 -1
- data/docs/compile_options.md +34 -0
- data/docs/fork_worker.md +1 -3
- data/docs/kubernetes.md +12 -0
- data/docs/nginx.md +1 -1
- data/docs/systemd.md +1 -2
- data/docs/testing_benchmarks_local_files.md +150 -0
- data/docs/testing_test_rackup_ci_files.md +36 -0
- data/ext/puma_http11/extconf.rb +11 -8
- data/ext/puma_http11/http11_parser.c +1 -1
- data/ext/puma_http11/http11_parser.h +1 -1
- data/ext/puma_http11/http11_parser.java.rl +2 -2
- data/ext/puma_http11/http11_parser.rl +2 -2
- data/ext/puma_http11/http11_parser_common.rl +2 -2
- data/ext/puma_http11/mini_ssl.c +122 -18
- data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +1 -1
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +156 -53
- data/ext/puma_http11/puma_http11.c +17 -9
- data/lib/puma/app/status.rb +4 -4
- data/lib/puma/binder.rb +50 -53
- data/lib/puma/cli.rb +16 -18
- data/lib/puma/client.rb +59 -19
- data/lib/puma/cluster/worker.rb +18 -11
- data/lib/puma/cluster/worker_handle.rb +4 -1
- data/lib/puma/cluster.rb +33 -30
- data/lib/puma/commonlogger.rb +21 -14
- data/lib/puma/configuration.rb +78 -58
- data/lib/puma/const.rb +129 -92
- data/lib/puma/control_cli.rb +15 -11
- data/lib/puma/detect.rb +4 -0
- data/lib/puma/dsl.rb +237 -56
- data/lib/puma/error_logger.rb +18 -9
- data/lib/puma/events.rb +6 -126
- data/lib/puma/io_buffer.rb +39 -4
- data/lib/puma/jruby_restart.rb +2 -1
- data/lib/puma/launcher/bundle_pruner.rb +104 -0
- data/lib/puma/launcher.rb +102 -175
- data/lib/puma/log_writer.rb +147 -0
- data/lib/puma/minissl/context_builder.rb +24 -12
- data/lib/puma/minissl.rb +99 -11
- data/lib/puma/plugin/systemd.rb +90 -0
- data/lib/puma/plugin/tmp_restart.rb +1 -1
- data/lib/puma/rack/builder.rb +6 -6
- data/lib/puma/rack/urlmap.rb +1 -1
- data/lib/puma/rack_default.rb +19 -4
- data/lib/puma/reactor.rb +19 -10
- data/lib/puma/request.rb +365 -170
- data/lib/puma/runner.rb +56 -20
- data/lib/puma/sd_notify.rb +149 -0
- data/lib/puma/server.rb +116 -89
- data/lib/puma/single.rb +13 -11
- data/lib/puma/state_file.rb +1 -4
- data/lib/puma/thread_pool.rb +57 -19
- data/lib/puma/util.rb +0 -11
- data/lib/puma.rb +9 -10
- data/lib/rack/handler/puma.rb +113 -86
- metadata +9 -5
- data/lib/puma/queue_close.rb +0 -26
- data/lib/puma/systemd.rb +0 -46
- data/lib/rack/version_restriction.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58946300296f4d215a5859fcadb101b4fcec6d9012b38fd0af10c5fdb3ce0c2
|
4
|
+
data.tar.gz: 397fa109025cbc87d7466be97ed91e44789d522db2c4b89d1ef5f4e40db9f772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0c6a4e6c10522de9a9c7d5eed57d5205a6d4acfe18e9d7c310044d5793a2a67a266c3b69f8ed4c5385559149dc858dbcf1b4307c86459b9723ea49303de5685
|
7
|
+
data.tar.gz: cf7a60331c499a1387414ca2d6955edbc239242a62ea06941bf912714ee4dcb9295a5a1bd9c3561fd396c54a2e04e5a0aa2194ef17b37accb78e049e4cb1ca6b
|
data/History.md
CHANGED
@@ -1,3 +1,149 @@
|
|
1
|
+
## 6.4.0 / 2023-09-21
|
2
|
+
|
3
|
+
* Features
|
4
|
+
* on_thread_exit hook ([#2920])
|
5
|
+
* on_thread_start_hook ([#3195])
|
6
|
+
* Shutdown on idle ([#3209], [#2580])
|
7
|
+
* New error message when control server port taken ([#3204])
|
8
|
+
|
9
|
+
* Refactor
|
10
|
+
* Remove `Forwardable` dependency ([#3191], #3190)
|
11
|
+
* Update URLMap Regexp usage for Ruby v3.3 ([#3165])
|
12
|
+
|
13
|
+
* Bugfixes
|
14
|
+
* Bring the cert_pem: parameter into parity with the cert: parameter to ssl_bind. ([#3174])
|
15
|
+
* Fix using control server with IPv6 host ([#3181])
|
16
|
+
* control_cli.rb - add require_relative 'log_writer' ([#3187])
|
17
|
+
* Fix cases where fallback Rack response wasn't sent to the client ([#3094])
|
18
|
+
|
19
|
+
## 6.3.1 / 2023-08-18
|
20
|
+
|
21
|
+
* Security
|
22
|
+
* Address HTTP request smuggling vulnerabilities with zero-length Content Length header and trailer fields ([GHSA-68xg-gqqm-vgj8](https://github.com/puma/puma/security/advisories/GHSA-68xg-gqqm-vgj8))
|
23
|
+
|
24
|
+
## 6.3.0 / 2023-05-31
|
25
|
+
|
26
|
+
* Features
|
27
|
+
* Add dsl method `supported_http_methods` ([#3106], [#3014])
|
28
|
+
* Puma error responses no longer have any fingerprints to indicate Puma ([#3161], [#3037])
|
29
|
+
* Support decryption of SSL key ([#3133], [#3132])
|
30
|
+
|
31
|
+
* Bugfixes
|
32
|
+
* Don't send 103 early hints response when only invalid headers are used ([#3163])
|
33
|
+
* Handle malformed request path ([#3155], [#3148])
|
34
|
+
* Misc lib file fixes - trapping additional errors, CI helper ([#3129])
|
35
|
+
* Fixup req form data file upload with "r\n" line endings ([#3137])
|
36
|
+
* Restore rack 1.6 compatibility ([#3156])
|
37
|
+
|
38
|
+
* Refactor
|
39
|
+
* const.rb - Update Puma::HTTP_STATUS_CODES ([#3162])
|
40
|
+
* Clarify Reactor#initialize ([#3151])
|
41
|
+
|
42
|
+
## 6.2.2 / 2023-04-17
|
43
|
+
|
44
|
+
* Bugfixes
|
45
|
+
* Fix Rack-related NameError by adding :: operator ([#3118], [#3117])
|
46
|
+
|
47
|
+
## 6.2.1 / 2023-03-31
|
48
|
+
|
49
|
+
* Bugfixes
|
50
|
+
* Fix java 8 compatibility ([#3109], [#3108])
|
51
|
+
* Always write io_buffer when in "enum bodies" branch. ([#3113], [#3112])
|
52
|
+
* Fix warn_if_in_single_mode incorrect message ([#3111])
|
53
|
+
|
54
|
+
## 6.2.0 / 2023-03-29
|
55
|
+
|
56
|
+
* Features
|
57
|
+
* Ability to supply a custom logger ([#2770], [#2511])
|
58
|
+
* Warn when clustered-only hooks are defined in single mode ([#3089])
|
59
|
+
* Adds the on_booted event ([#2709])
|
60
|
+
|
61
|
+
* Bugfixes
|
62
|
+
* Loggers - internal_write - catch Errno::EINVAL ([#3091])
|
63
|
+
* commonlogger.rb - fix HIJACK time format, use constants, not strings ([#3074])
|
64
|
+
* Fixed some edge cases regarding request hijacking ([#3072])
|
65
|
+
|
66
|
+
## 6.1.1 / 2023-02-28
|
67
|
+
|
68
|
+
* Bugfixes
|
69
|
+
* We no longer try to use the systemd plugin for JRuby ([#3079])
|
70
|
+
* Allow ::Rack::Handler::Puma.run to work regardless of whether Rack/Rackup are loaded ([#3080])
|
71
|
+
|
72
|
+
## 6.1.0 / 2023-02-12
|
73
|
+
|
74
|
+
* Features
|
75
|
+
* WebSocket support via partial hijack ([#3058], [#3007])
|
76
|
+
* Add built-in systemd notify support ([#3011])
|
77
|
+
* Periodically send status to systemd ([#3006], [#2604])
|
78
|
+
* Introduce the ability to return 413: payload too large for requests ([#3040])
|
79
|
+
* Log loaded extensions when `PUMA_DEBUG` is set ([#3036], [#3020])
|
80
|
+
|
81
|
+
* Bugfixes
|
82
|
+
* Fix issue with rack 3 compatibility re: rackup ([#3061], [#3057])
|
83
|
+
* Allow setting TCP low_latency with SSL listener ([#3065])
|
84
|
+
|
85
|
+
* Performance
|
86
|
+
* Reduce memory usage for large file uploads ([#3062])
|
87
|
+
|
88
|
+
## 6.0.2 / 2023-01-01
|
89
|
+
|
90
|
+
* Refactor
|
91
|
+
* Remove use of etc and time gems in Puma ([#3035], [#3033])
|
92
|
+
* Refactor const.rb - freeze ([#3016])
|
93
|
+
|
94
|
+
## 6.0.1 / 2022-12-20
|
95
|
+
|
96
|
+
* Bugfixes
|
97
|
+
* Handle waking up a closed selector in Reactor#add ([#3005])
|
98
|
+
* Fixup response processing, enumerable bodies ([#3004], [#3000])
|
99
|
+
* Correctly close app body for all code paths ([#3002], [#2999])
|
100
|
+
* Refactor
|
101
|
+
* Add IOBuffer to Client, remove from ThreadPool thread instances ([#3013])
|
102
|
+
|
103
|
+
## 6.0.0 / 2022-10-14
|
104
|
+
|
105
|
+
* Breaking Changes
|
106
|
+
* Dropping Ruby 2.2 and 2.3 support (now 2.4+) ([#2919])
|
107
|
+
* Remote_addr functionality has changed ([#2652], [#2653])
|
108
|
+
* No longer supporting Java 1.7 or below (JRuby 9.1 was the last release to support this) ([#2849])
|
109
|
+
* Remove nakayoshi GC ([#2933], [#2925])
|
110
|
+
* wait_for_less_busy_worker is now default on ([#2940])
|
111
|
+
* Prefix all environment variables with `PUMA_` ([#2924], [#2853])
|
112
|
+
* Removed some constants ([#2957], [#2958], [#2959], [#2960])
|
113
|
+
* The following classes are now part of Puma's private API: `Client`, `Cluster::Worker`, `Cluster::Worker`, `HandleRequest`. ([#2988])
|
114
|
+
* Configuration constants like `DefaultRackup` removed ([#2928])
|
115
|
+
* Extracted `LogWriter` from `Events` ([#2798])
|
116
|
+
* Only accept the standard 8 HTTP methods, others rejected with 501. ([#2932])
|
117
|
+
|
118
|
+
* Features
|
119
|
+
* Increase throughput on large (100kb+) response bodies by 3-10x ([#2896], [#2892])
|
120
|
+
* Increase throughput on file responses ([#2923])
|
121
|
+
* Add support for streaming bodies in Rack. ([#2740])
|
122
|
+
* Allow OpenSSL session reuse via a 'reuse' ssl_bind method or bind string query parameter ([#2845])
|
123
|
+
* Allow `run_hooks` to pass a hash to blocks for use later ([#2917], [#2915])
|
124
|
+
* Allow using `preload_app!` with `fork_worker` ([#2907])
|
125
|
+
* Support request_body_wait metric with higher precision ([#2953])
|
126
|
+
* Allow header values to be arrays (Rack 3) ([#2936], [#2931])
|
127
|
+
* Export Puma/Ruby versions in /stats ([#2875])
|
128
|
+
* Allow configuring request uri max length & request path max length ([#2840])
|
129
|
+
* Add a couple of public accessors ([#2774])
|
130
|
+
* Log entire backtrace when worker start fails ([#2891])
|
131
|
+
* [jruby] Enable TLSv1.3 support ([#2886])
|
132
|
+
* [jruby] support setting TLS protocols + rename ssl_cipher_list ([#2899])
|
133
|
+
* [jruby] Support a truststore option ([#2849], [#2904], [#2884])
|
134
|
+
|
135
|
+
* Bugfixes
|
136
|
+
* Load the configuration before passing it to the binder ([#2897])
|
137
|
+
* Do not raise error raised on HTTP methods we don't recognize or support, like CONNECT ([#2932], [#1441])
|
138
|
+
* Fixed a memory leak when creating a new SSL listener ([#2956])
|
139
|
+
|
140
|
+
* Refactor
|
141
|
+
* log_writer.rb - add internal_write method ([#2888])
|
142
|
+
* Extract prune_bundler code into it's own class. ([#2797])
|
143
|
+
* Refactor Launcher#run to increase readability (no logic change) ([#2795])
|
144
|
+
* Ruby 3.2 will have native IO#wait_* methods, don't require io/wait ([#2903])
|
145
|
+
* Various internal API refactorings ([#2942], [#2921], [#2922], [#2955])
|
146
|
+
|
1
147
|
## 5.6.7 / 2023-08-18
|
2
148
|
|
3
149
|
* Security
|
@@ -6,7 +152,7 @@
|
|
6
152
|
## 5.6.6 / 2023-06-21
|
7
153
|
|
8
154
|
* Bugfix
|
9
|
-
*
|
155
|
+
* Prevent loading with rack 3 ([#3166])
|
10
156
|
|
11
157
|
## 5.6.5 / 2022-08-23
|
12
158
|
|
@@ -330,6 +476,16 @@
|
|
330
476
|
* Support parallel tests in verbose progress reporting ([#2223])
|
331
477
|
* Refactor error handling in server accept loop ([#2239])
|
332
478
|
|
479
|
+
## 4.3.12 / 2022-03-30
|
480
|
+
|
481
|
+
* Security
|
482
|
+
* Close several HTTP Request Smuggling exploits (CVE-2022-24790)
|
483
|
+
|
484
|
+
## 4.3.11 / 2022-02-11
|
485
|
+
|
486
|
+
* Security
|
487
|
+
* Always close the response body (GHSA-rmj8-8hhh-gv5h)
|
488
|
+
|
333
489
|
## 4.3.10 / 2021-10-12
|
334
490
|
|
335
491
|
* Bugfixes
|
@@ -1873,16 +2029,123 @@ be added back in a future date when a java Puma::MiniSSL is added.
|
|
1873
2029
|
* Bugfixes
|
1874
2030
|
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
|
1875
2031
|
|
1876
|
-
[#
|
1877
|
-
[#
|
2032
|
+
[#2920]:https://github.com/puma/puma/pull/2920 "PR by @biinari, merged 2023-07-11"
|
2033
|
+
[#3195]:https://github.com/puma/puma/pull/3195 "PR by @binarygit, merged 2023-08-15"
|
2034
|
+
[#3209]:https://github.com/puma/puma/pull/3209 "PR by @joshuay03, merged 2023-09-04"
|
2035
|
+
[#2580]:https://github.com/puma/puma/issues/2580 "Issue by @schuetzm, closed 2023-09-04"
|
2036
|
+
[#3204]:https://github.com/puma/puma/pull/3204 "PR by @dhavalsingh, merged 2023-08-25"
|
2037
|
+
[#3191]:https://github.com/puma/puma/pull/3191 "PR by @MSP-Greg, merged 2023-08-31"
|
2038
|
+
[#3165]:https://github.com/puma/puma/pull/3165 "PR by @fallwith, merged 2023-06-06"
|
2039
|
+
[#3174]:https://github.com/puma/puma/pull/3174 "PR by @copiousfreetime, merged 2023-06-11"
|
2040
|
+
[#3181]:https://github.com/puma/puma/pull/3181 "PR by @MSP-Greg, merged 2023-06-23"
|
2041
|
+
[#3187]:https://github.com/puma/puma/pull/3187 "PR by @MSP-Greg, merged 2023-06-30"
|
2042
|
+
[#3094]:https://github.com/puma/puma/pull/3094 "PR by @Vuta, merged 2023-07-23"
|
2043
|
+
[#3106]:https://github.com/puma/puma/pull/3106 "PR by @MSP-Greg, merged 2023-05-29"
|
2044
|
+
[#3014]:https://github.com/puma/puma/issues/3014 "Issue by @kyledrake, closed 2023-05-29"
|
2045
|
+
[#3161]:https://github.com/puma/puma/pull/3161 "PR by @MSP-Greg, merged 2023-05-27"
|
2046
|
+
[#3037]:https://github.com/puma/puma/issues/3037 "Issue by @daisy1754, closed 2023-05-27"
|
2047
|
+
[#3133]:https://github.com/puma/puma/pull/3133 "PR by @stanhu, merged 2023-04-30"
|
2048
|
+
[#3132]:https://github.com/puma/puma/issues/3132 "Issue by @stanhu, closed 2023-04-30"
|
2049
|
+
[#3163]:https://github.com/puma/puma/pull/3163 "PR by @MSP-Greg, merged 2023-05-27"
|
2050
|
+
[#3155]:https://github.com/puma/puma/pull/3155 "PR by @dentarg, merged 2023-05-14"
|
2051
|
+
[#3148]:https://github.com/puma/puma/issues/3148 "Issue by @dentarg, closed 2023-05-14"
|
2052
|
+
[#3129]:https://github.com/puma/puma/pull/3129 "PR by @MSP-Greg, merged 2023-05-02"
|
2053
|
+
[#3137]:https://github.com/puma/puma/pull/3137 "PR by @MSP-Greg, merged 2023-04-30"
|
2054
|
+
[#3156]:https://github.com/puma/puma/pull/3156 "PR by @severin, merged 2023-05-16"
|
2055
|
+
[#3162]:https://github.com/puma/puma/pull/3162 "PR by @MSP-Greg, merged 2023-05-23"
|
2056
|
+
[#3151]:https://github.com/puma/puma/pull/3151 "PR by @nateberkopec, merged 2023-05-12"
|
2057
|
+
[#3118]:https://github.com/puma/puma/pull/3118 "PR by @ninoseki, merged 2023-04-01"
|
2058
|
+
[#3117]:https://github.com/puma/puma/issues/3117 "Issue by @ninoseki, closed 2023-04-01"
|
2059
|
+
[#3109]:https://github.com/puma/puma/pull/3109 "PR by @ahorek, merged 2023-03-31"
|
2060
|
+
[#3108]:https://github.com/puma/puma/issues/3108 "Issue by @treviateo, closed 2023-03-31"
|
2061
|
+
[#3113]:https://github.com/puma/puma/pull/3113 "PR by @collinsauve, merged 2023-03-31"
|
2062
|
+
[#3112]:https://github.com/puma/puma/issues/3112 "Issue by @dmke, closed 2023-03-31"
|
2063
|
+
[#3111]:https://github.com/puma/puma/pull/3111 "PR by @adzap, merged 2023-03-30"
|
2064
|
+
[#2770]:https://github.com/puma/puma/pull/2770 "PR by @vzajkov, merged 2023-03-29"
|
2065
|
+
[#2511]:https://github.com/puma/puma/issues/2511 "Issue by @jchristie55332, closed 2021-12-12"
|
2066
|
+
[#3089]:https://github.com/puma/puma/pull/3089 "PR by @Vuta, merged 2023-03-06"
|
2067
|
+
[#2709]:https://github.com/puma/puma/pull/2709 "PR by @rodzyn, merged 2023-02-20"
|
2068
|
+
[#3091]:https://github.com/puma/puma/pull/3091 "PR by @MSP-Greg, merged 2023-03-28"
|
2069
|
+
[#3074]:https://github.com/puma/puma/pull/3074 "PR by @MSP-Greg, merged 2023-03-14"
|
2070
|
+
[#3072]:https://github.com/puma/puma/pull/3072 "PR by @MSP-Greg, merged 2023-02-17"
|
2071
|
+
[#3079]:https://github.com/puma/puma/pull/3079 "PR by @mohamedhafez, merged 2023-02-24"
|
2072
|
+
[#3080]:https://github.com/puma/puma/pull/3080 "PR by @MSP-Greg, merged 2023-02-16"
|
2073
|
+
[#3058]:https://github.com/puma/puma/pull/3058 "PR by @dentarg, merged 2023-01-29"
|
2074
|
+
[#3007]:https://github.com/puma/puma/issues/3007 "Issue by @MSP-Greg, closed 2023-01-29"
|
2075
|
+
[#3011]:https://github.com/puma/puma/pull/3011 "PR by @joaomarcos96, merged 2023-01-03"
|
2076
|
+
[#3006]:https://github.com/puma/puma/pull/3006 "PR by @QWYNG, merged 2023-02-09"
|
2077
|
+
[#2604]:https://github.com/puma/puma/issues/2604 "Issue by @dgoetz, closed 2023-02-09"
|
2078
|
+
[#3040]:https://github.com/puma/puma/pull/3040 "PR by @shayonj, merged 2023-01-02"
|
2079
|
+
[#3036]:https://github.com/puma/puma/pull/3036 "PR by @MSP-Greg, merged 2023-01-13"
|
2080
|
+
[#3020]:https://github.com/puma/puma/issues/3020 "Issue by @dentarg, closed 2023-01-13"
|
2081
|
+
[#3061]:https://github.com/puma/puma/pull/3061 "PR by @MSP-Greg, merged 2023-02-12"
|
2082
|
+
[#3057]:https://github.com/puma/puma/issues/3057 "Issue by @mmarvb8h, closed 2023-02-12"
|
2083
|
+
[#3065]:https://github.com/puma/puma/pull/3065 "PR by @MSP-Greg, merged 2023-02-11"
|
2084
|
+
[#3062]:https://github.com/puma/puma/pull/3062 "PR by @willkoehler, merged 2023-01-29"
|
2085
|
+
[#3035]:https://github.com/puma/puma/pull/3035 "PR by @MSP-Greg, merged 2022-12-24"
|
2086
|
+
[#3033]:https://github.com/puma/puma/issues/3033 "Issue by @jules-w2, closed 2022-12-24"
|
2087
|
+
[#3016]:https://github.com/puma/puma/pull/3016 "PR by @MSP-Greg, merged 2022-12-24"
|
2088
|
+
[#3005]:https://github.com/puma/puma/pull/3005 "PR by @JuanitoFatas, merged 2022-11-04"
|
2089
|
+
[#3004]:https://github.com/puma/puma/pull/3004 "PR by @MSP-Greg, merged 2022-11-24"
|
2090
|
+
[#3000]:https://github.com/puma/puma/issues/3000 "Issue by @dentarg, closed 2022-11-24"
|
2091
|
+
[#3002]:https://github.com/puma/puma/pull/3002 "PR by @MSP-Greg, merged 2022-11-03"
|
2092
|
+
[#2999]:https://github.com/puma/puma/issues/2999 "Issue by @aymeric-ledorze, closed 2022-11-03"
|
2093
|
+
[#3013]:https://github.com/puma/puma/pull/3013 "PR by @MSP-Greg, merged 2022-11-13"
|
2094
|
+
[#2919]:https://github.com/puma/puma/pull/2919 "PR by @MSP-Greg, merged 2022-08-30"
|
2095
|
+
[#2652]:https://github.com/puma/puma/issues/2652 "Issue by @Roguelazer, closed 2022-09-04"
|
2096
|
+
[#2653]:https://github.com/puma/puma/pull/2653 "PR by @Roguelazer, closed 2022-03-07"
|
2097
|
+
[#2849]:https://github.com/puma/puma/pull/2849 "PR by @kares, merged 2022-04-09"
|
2098
|
+
[#2933]:https://github.com/puma/puma/pull/2933 "PR by @cafedomancer, merged 2022-09-09"
|
2099
|
+
[#2925]:https://github.com/puma/puma/issues/2925 "Issue by @nateberkopec, closed 2022-09-09"
|
2100
|
+
[#2940]:https://github.com/puma/puma/pull/2940 "PR by @cafedomancer, merged 2022-09-10"
|
2101
|
+
[#2924]:https://github.com/puma/puma/pull/2924 "PR by @cafedomancer, merged 2022-09-07"
|
2102
|
+
[#2853]:https://github.com/puma/puma/issues/2853 "Issue by @nateberkopec, closed 2022-09-07"
|
2103
|
+
[#2957]:https://github.com/puma/puma/pull/2957 "PR by @JuanitoFatas, merged 2022-09-16"
|
2104
|
+
[#2958]:https://github.com/puma/puma/pull/2958 "PR by @JuanitoFatas, merged 2022-09-16"
|
2105
|
+
[#2959]:https://github.com/puma/puma/pull/2959 "PR by @JuanitoFatas, merged 2022-09-16"
|
2106
|
+
[#2960]:https://github.com/puma/puma/pull/2960 "PR by @JuanitoFatas, merged 2022-09-16"
|
2107
|
+
[#2988]:https://github.com/puma/puma/pull/2988 "PR by @MSP-Greg, merged 2022-10-12"
|
2108
|
+
[#2928]:https://github.com/puma/puma/pull/2928 "PR by @nateberkopec, merged 2022-09-10"
|
2109
|
+
[#2798]:https://github.com/puma/puma/pull/2798 "PR by @johnnyshields, merged 2022-02-05"
|
2110
|
+
[#2932]:https://github.com/puma/puma/pull/2932 "PR by @mrzasa, merged 2022-09-12"
|
2111
|
+
[#2896]:https://github.com/puma/puma/pull/2896 "PR by @MSP-Greg, merged 2022-09-13"
|
2112
|
+
[#2892]:https://github.com/puma/puma/pull/2892 "PR by @guilleiguaran, closed 2022-09-13"
|
2113
|
+
[#2923]:https://github.com/puma/puma/pull/2923 "PR by @nateberkopec, merged 2022-09-09"
|
2114
|
+
[#2740]:https://github.com/puma/puma/pull/2740 "PR by @ioquatix, merged 2022-01-29"
|
2115
|
+
[#2845]:https://github.com/puma/puma/issues/2845 "Issue by @donv, closed 2022-03-22"
|
2116
|
+
[#2917]:https://github.com/puma/puma/pull/2917 "PR by @MSP-Greg, merged 2022-09-19"
|
2117
|
+
[#2915]:https://github.com/puma/puma/issues/2915 "Issue by @mperham, closed 2022-09-19"
|
2118
|
+
[#2907]:https://github.com/puma/puma/pull/2907 "PR by @casperisfine, merged 2022-09-15"
|
2119
|
+
[#2953]:https://github.com/puma/puma/pull/2953 "PR by @JuanitoFatas, merged 2022-09-14"
|
2120
|
+
[#2936]:https://github.com/puma/puma/pull/2936 "PR by @MSP-Greg, merged 2022-09-09"
|
2121
|
+
[#2931]:https://github.com/puma/puma/issues/2931 "Issue by @dentarg, closed 2022-09-09"
|
2122
|
+
[#2875]:https://github.com/puma/puma/pull/2875 "PR by @ylecuyer, merged 2022-05-19"
|
2123
|
+
[#2840]:https://github.com/puma/puma/pull/2840 "PR by @LukaszMaslej, merged 2022-04-13"
|
2124
|
+
[#2774]:https://github.com/puma/puma/pull/2774 "PR by @ob-stripe, merged 2022-01-31"
|
2125
|
+
[#2891]:https://github.com/puma/puma/pull/2891 "PR by @gingerlime, merged 2022-06-02"
|
2126
|
+
[#2886]:https://github.com/puma/puma/pull/2886 "PR by @kares, merged 2022-05-30"
|
2127
|
+
[#2899]:https://github.com/puma/puma/pull/2899 "PR by @kares, merged 2022-07-04"
|
2128
|
+
[#2904]:https://github.com/puma/puma/pull/2904 "PR by @kares, merged 2022-08-27"
|
2129
|
+
[#2884]:https://github.com/puma/puma/pull/2884 "PR by @kares, merged 2022-05-30"
|
2130
|
+
[#2897]:https://github.com/puma/puma/pull/2897 "PR by @Edouard-chin, merged 2022-08-27"
|
2131
|
+
[#1441]:https://github.com/puma/puma/issues/1441 "Issue by @nirvdrum, closed 2022-09-12"
|
2132
|
+
[#2956]:https://github.com/puma/puma/pull/2956 "PR by @MSP-Greg, merged 2022-09-15"
|
2133
|
+
[#2888]:https://github.com/puma/puma/pull/2888 "PR by @MSP-Greg, merged 2022-06-01"
|
2134
|
+
[#2797]:https://github.com/puma/puma/pull/2797 "PR by @johnnyshields, merged 2022-02-01"
|
2135
|
+
[#2795]:https://github.com/puma/puma/pull/2795 "PR by @johnnyshields, merged 2022-01-31"
|
2136
|
+
[#2903]:https://github.com/puma/puma/pull/2903 "PR by @MSP-Greg, merged 2022-08-27"
|
2137
|
+
[#2942]:https://github.com/puma/puma/pull/2942 "PR by @nateberkopec, merged 2022-09-15"
|
2138
|
+
[#2921]:https://github.com/puma/puma/issues/2921 "Issue by @MSP-Greg, closed 2022-09-15"
|
2139
|
+
[#2922]:https://github.com/puma/puma/issues/2922 "Issue by @MSP-Greg, closed 2022-09-10"
|
2140
|
+
[#2955]:https://github.com/puma/puma/pull/2955 "PR by @cafedomancer, merged 2022-09-15"
|
2141
|
+
[#3166]:https://github.com/puma/puma/pull/3166 "PR by @JoeDupuis, merged 2023-06-08"
|
1878
2142
|
[#2868]:https://github.com/puma/puma/pull/2868 "PR by @MSP-Greg, merged 2022-06-02"
|
1879
2143
|
[#2866]:https://github.com/puma/puma/issues/2866 "Issue by @slondr, closed 2022-06-02"
|
1880
|
-
[#
|
2144
|
+
[#2883]:https://github.com/puma/puma/pull/2883 "PR by @MSP-Greg, merged 2022-06-02"
|
1881
2145
|
[#2890]:https://github.com/puma/puma/pull/2890 "PR by @kares, merged 2022-06-01"
|
1882
2146
|
[#2729]:https://github.com/puma/puma/issues/2729 "Issue by @kares, closed 2022-06-01"
|
1883
2147
|
[#2885]:https://github.com/puma/puma/pull/2885 "PR by @MSP-Greg, merged 2022-05-30"
|
1884
2148
|
[#2839]:https://github.com/puma/puma/issues/2839 "Issue by @wlipa, closed 2022-05-30"
|
1885
|
-
[#2882]:https://github.com/puma/puma/pull/2882 "PR by @MSP-Greg, merged 2022-05-19"
|
1886
2149
|
[#2864]:https://github.com/puma/puma/pull/2864 "PR by @MSP-Greg, merged 2022-04-26"
|
1887
2150
|
[#2863]:https://github.com/puma/puma/issues/2863 "Issue by @eradman, closed 2022-04-26"
|
1888
2151
|
[#2861]:https://github.com/puma/puma/pull/2861 "PR by @BlakeWilliams, merged 2022-04-17"
|
@@ -1893,13 +2156,6 @@ be added back in a future date when a java Puma::MiniSSL is added.
|
|
1893
2156
|
[#2838]:https://github.com/puma/puma/pull/2838 "PR by @epsilon-0, merged 2022-03-03"
|
1894
2157
|
[#2817]:https://github.com/puma/puma/pull/2817 "PR by @khustochka, merged 2022-02-20"
|
1895
2158
|
[#2810]:https://github.com/puma/puma/pull/2810 "PR by @kzkn, merged 2022-01-27"
|
1896
|
-
[#2899]:https://github.com/puma/puma/pull/2899 "PR by @kares, merged 2022-07-04"
|
1897
|
-
[#2891]:https://github.com/puma/puma/pull/2891 "PR by @gingerlime, merged 2022-06-02"
|
1898
|
-
[#2886]:https://github.com/puma/puma/pull/2886 "PR by @kares, merged 2022-05-30"
|
1899
|
-
[#2884]:https://github.com/puma/puma/pull/2884 "PR by @kares, merged 2022-05-30"
|
1900
|
-
[#2875]:https://github.com/puma/puma/pull/2875 "PR by @ylecuyer, merged 2022-05-19"
|
1901
|
-
[#2840]:https://github.com/puma/puma/pull/2840 "PR by @LukaszMaslej, merged 2022-04-13"
|
1902
|
-
[#2849]:https://github.com/puma/puma/pull/2849 "PR by @kares, merged 2022-04-09"
|
1903
2159
|
[#2809]:https://github.com/puma/puma/pull/2809 "PR by @dentarg, merged 2022-01-26"
|
1904
2160
|
[#2764]:https://github.com/puma/puma/pull/2764 "PR by @dentarg, merged 2022-01-18"
|
1905
2161
|
[#2708]:https://github.com/puma/puma/issues/2708 "Issue by @erikaxel, closed 2022-01-18"
|
@@ -1909,7 +2165,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
|
|
1909
2165
|
[#2794]:https://github.com/puma/puma/pull/2794 "PR by @johnnyshields, merged 2022-01-10"
|
1910
2166
|
[#2759]:https://github.com/puma/puma/pull/2759 "PR by @ob-stripe, merged 2021-12-11"
|
1911
2167
|
[#2731]:https://github.com/puma/puma/pull/2731 "PR by @baelter, merged 2021-11-02"
|
1912
|
-
[#2341]:https://github.com/puma/puma/issues/2341 "Issue by @cjlarose, closed
|
2168
|
+
[#2341]:https://github.com/puma/puma/issues/2341 "Issue by @cjlarose, closed 2023-07-23"
|
1913
2169
|
[#2728]:https://github.com/puma/puma/pull/2728 "PR by @dalibor, merged 2021-10-31"
|
1914
2170
|
[#2733]:https://github.com/puma/puma/pull/2733 "PR by @ob-stripe, merged 2021-12-12"
|
1915
2171
|
[#2807]:https://github.com/puma/puma/pull/2807 "PR by @MSP-Greg, merged 2022-01-25"
|
data/README.md
CHANGED
@@ -4,21 +4,23 @@
|
|
4
4
|
|
5
5
|
# Puma: A Ruby Web Server Built For Parallelism
|
6
6
|
|
7
|
-
[![Actions
|
8
|
-
[![Actions non MRI](https://github.com/puma/puma/workflows/non_MRI/badge.svg?branch=master)](https://github.com/puma/puma/actions?query=workflow%3Anon_MRI)
|
7
|
+
[![Actions](https://github.com/puma/puma/workflows/Tests/badge.svg?branch=master)](https://github.com/puma/puma/actions?query=workflow%3ATests)
|
9
8
|
[![Code Climate](https://codeclimate.com/github/puma/puma.svg)](https://codeclimate.com/github/puma/puma)
|
10
|
-
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=puma&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=puma&package-manager=bundler&version-scheme=semver)
|
11
9
|
[![StackOverflow](https://img.shields.io/badge/stackoverflow-Puma-blue.svg)]( https://stackoverflow.com/questions/tagged/puma )
|
12
10
|
|
13
11
|
Puma is a **simple, fast, multi-threaded, and highly parallel HTTP 1.1 server for Ruby/Rack applications**.
|
14
12
|
|
15
13
|
## Built For Speed & Parallelism
|
16
14
|
|
17
|
-
Puma
|
15
|
+
Puma is a server for [Rack](https://github.com/rack/rack)-powered HTTP applications written in Ruby. It is:
|
16
|
+
* **Multi-threaded**. Each request is served in a separate thread. This helps you serve more requests per second with less memory use.
|
17
|
+
* **Multi-process**. "Pre-forks" in cluster mode, using less memory per-process thanks to copy-on-write memory.
|
18
|
+
* **Standalone**. With SSL support, zero-downtime rolling restarts and a built-in request bufferer, you can deploy Puma without any reverse proxy.
|
19
|
+
* **Battle-tested**. Our HTTP parser is inherited from Mongrel and has over 15 years of production use. Puma is currently the most popular Ruby webserver, and is the default server for Ruby on Rails.
|
18
20
|
|
19
21
|
Originally designed as a server for [Rubinius](https://github.com/rubinius/rubinius), Puma also works well with Ruby (MRI) and JRuby.
|
20
22
|
|
21
|
-
On MRI, there is a Global VM Lock (GVL) that ensures only one thread can run Ruby code 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 IO waiting to be done in parallel.
|
23
|
+
On MRI, there is a Global VM Lock (GVL) that ensures only one thread can run Ruby code 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 IO waiting to be done in parallel. Truly parallel Ruby implementations (TruffleRuby, JRuby) don't have this limitation.
|
22
24
|
|
23
25
|
## Quick Start
|
24
26
|
|
@@ -108,15 +110,25 @@ Puma also offers "clustered mode". Clustered mode `fork`s workers from a master
|
|
108
110
|
$ puma -t 8:32 -w 3
|
109
111
|
```
|
110
112
|
|
113
|
+
Or with the `WEB_CONCURRENCY` environment variable:
|
114
|
+
|
115
|
+
```
|
116
|
+
$ WEB_CONCURRENCY=3 puma -t 8:32
|
117
|
+
```
|
118
|
+
|
111
119
|
Note that threads are still used in clustered mode, and the `-t` thread flag setting is per worker, so `-w 2 -t 16:16` will spawn 32 threads in total, with 16 in each worker process.
|
112
120
|
|
113
|
-
|
121
|
+
For an in-depth discussion of the tradeoffs of thread and process count settings, [see our docs](https://github.com/puma/puma/blob/9282a8efa5a0c48e39c60d22ca70051a25df9f55/docs/kubernetes.md#workers-per-pod-and-other-config-issues).
|
122
|
+
|
123
|
+
In clustered mode, Puma can "preload" your application. This loads all the application code *prior* to forking. Preloading reduces total memory usage of your application via an operating system feature called [copy-on-write](https://en.wikipedia.org/wiki/Copy-on-write).
|
124
|
+
|
125
|
+
If the `WEB_CONCURRENCY` environment variable is set to a value > 1 (and `--prune-bundler` has not been specified), preloading will be enabled by default. Otherwise, you can use the `--preload` flag from the command line:
|
114
126
|
|
115
127
|
```
|
116
128
|
$ puma -w 3 --preload
|
117
129
|
```
|
118
130
|
|
119
|
-
|
131
|
+
Or, if you're using a configuration file, you can use the `preload_app!` method:
|
120
132
|
|
121
133
|
```ruby
|
122
134
|
# config/puma.rb
|
@@ -124,7 +136,9 @@ workers 3
|
|
124
136
|
preload_app!
|
125
137
|
```
|
126
138
|
|
127
|
-
|
139
|
+
Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preloading copies the code of master into the workers.
|
140
|
+
|
141
|
+
When using clustered mode, you can specify a block in your configuration file that will be run on boot of each worker:
|
128
142
|
|
129
143
|
```ruby
|
130
144
|
# config/puma.rb
|
@@ -137,12 +151,10 @@ This code can be used to setup the process before booting the application, allow
|
|
137
151
|
you to do some Puma-specific things that you don't want to embed in your application.
|
138
152
|
For instance, you could fire a log notification that a worker booted or send something to statsd. This can be called multiple times.
|
139
153
|
|
140
|
-
Constants loaded by your application (such as `Rails`) will not be available in `on_worker_boot
|
141
|
-
|
142
|
-
using 2 or more workers in cluster mode.
|
143
|
-
If `preload_app!` is not enabled and 1 worker is used, then `on_worker_boot` will fire, but your app will not be preloaded and constants will not be available.
|
154
|
+
Constants loaded by your application (such as `Rails`) will not be available in `on_worker_boot`
|
155
|
+
unless preloading is enabled.
|
144
156
|
|
145
|
-
|
157
|
+
You can also specify a block to be run before workers are forked, using `before_fork`:
|
146
158
|
|
147
159
|
```ruby
|
148
160
|
# config/puma.rb
|
@@ -151,7 +163,14 @@ before_fork do
|
|
151
163
|
end
|
152
164
|
```
|
153
165
|
|
154
|
-
|
166
|
+
You can also specify a block to be run after puma is booted using `on_booted`:
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
# config/puma.rb
|
170
|
+
on_booted do
|
171
|
+
# configuration here
|
172
|
+
end
|
173
|
+
```
|
155
174
|
|
156
175
|
### Error handling
|
157
176
|
|
@@ -192,35 +211,38 @@ Need a bit of security? Use SSL sockets:
|
|
192
211
|
```
|
193
212
|
$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
|
194
213
|
```
|
195
|
-
#### Self-signed SSL certificates (via the [`localhost`] gem, for development use):
|
214
|
+
#### Self-signed SSL certificates (via the [`localhost`] gem, for development use):
|
196
215
|
|
197
|
-
Puma supports the [`localhost`] gem for self-signed certificates. This is particularly useful if you want to use Puma with SSL locally, and self-signed certificates will work for your use-case. Currently, the integration can only be used in MRI.
|
216
|
+
Puma supports the [`localhost`] gem for self-signed certificates. This is particularly useful if you want to use Puma with SSL locally, and self-signed certificates will work for your use-case. Currently, the integration can only be used in MRI.
|
198
217
|
|
199
218
|
Puma automatically configures SSL when the [`localhost`] gem is loaded in a `development` environment:
|
200
219
|
|
220
|
+
Add the gem to your Gemfile:
|
201
221
|
```ruby
|
202
|
-
|
203
|
-
group(:development) do
|
222
|
+
group(:development) do
|
204
223
|
gem 'localhost'
|
205
224
|
end
|
225
|
+
```
|
206
226
|
|
207
|
-
|
227
|
+
And require it implicitly using bundler:
|
228
|
+
```ruby
|
208
229
|
require "bundler"
|
209
230
|
Bundler.require(:default, ENV["RACK_ENV"].to_sym)
|
231
|
+
```
|
210
232
|
|
211
|
-
|
212
|
-
|
233
|
+
Alternatively, you can require the gem in your configuration file, either `config/puma/development.rb`, `config/puma.rb`, or set via the `-C` cli option:
|
234
|
+
```ruby
|
213
235
|
require 'localhost'
|
214
|
-
|
236
|
+
# configuration methods (from Puma::DSL) as needed
|
215
237
|
```
|
216
238
|
|
217
239
|
Additionally, Puma must be listening to an SSL socket:
|
218
240
|
|
219
241
|
```shell
|
220
|
-
$ puma -b 'ssl://localhost:9292' config.
|
242
|
+
$ puma -b 'ssl://localhost:9292' -C config/use_local_host.rb
|
221
243
|
|
222
244
|
# The following options allow you to reach Puma over HTTP as well:
|
223
|
-
$ puma -b ssl://localhost:9292 -b tcp://localhost:9393 config.
|
245
|
+
$ puma -b ssl://localhost:9292 -b tcp://localhost:9393 -C config/use_local_host.rb
|
224
246
|
```
|
225
247
|
|
226
248
|
[`localhost`]: https://github.com/socketry/localhost
|
@@ -266,6 +288,30 @@ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_f
|
|
266
288
|
List of available flags: `USE_CHECK_TIME`, `CRL_CHECK`, `CRL_CHECK_ALL`, `IGNORE_CRITICAL`, `X509_STRICT`, `ALLOW_PROXY_CERTS`, `POLICY_CHECK`, `EXPLICIT_POLICY`, `INHIBIT_ANY`, `INHIBIT_MAP`, `NOTIFY_POLICY`, `EXTENDED_CRL_SUPPORT`, `USE_DELTAS`, `CHECK_SS_SIGNATURE`, `TRUSTED_FIRST`, `SUITEB_128_LOS_ONLY`, `SUITEB_192_LOS`, `SUITEB_128_LOS`, `PARTIAL_CHAIN`, `NO_ALT_CHAINS`, `NO_CHECK_TIME`
|
267
289
|
(see https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_hostflags.html#VERIFICATION-FLAGS).
|
268
290
|
|
291
|
+
#### Controlling OpenSSL Password Decryption
|
292
|
+
|
293
|
+
To enable runtime decryption of an encrypted SSL key (not available for JRuby), use `key_password_command`:
|
294
|
+
|
295
|
+
```
|
296
|
+
$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&key_password_command=/path/to/command.sh'
|
297
|
+
```
|
298
|
+
|
299
|
+
`key_password_command` must:
|
300
|
+
|
301
|
+
1. Be executable by Puma.
|
302
|
+
2. Print the decryption password to stdout.
|
303
|
+
|
304
|
+
For example:
|
305
|
+
|
306
|
+
```shell
|
307
|
+
#!/bin/sh
|
308
|
+
|
309
|
+
echo "this is my password"
|
310
|
+
```
|
311
|
+
|
312
|
+
`key_password_command` can be used with `key` or `key_pem`. If the key
|
313
|
+
is not encrypted, the executable will not be called.
|
314
|
+
|
269
315
|
### Control/Status Server
|
270
316
|
|
271
317
|
Puma has a built-in status and control app that can be used to query and control Puma.
|
@@ -341,16 +387,18 @@ end
|
|
341
387
|
|
342
388
|
## Deployment
|
343
389
|
|
344
|
-
Puma has support for Capistrano with an [external gem](https://github.com/seuros/capistrano-puma).
|
390
|
+
* Puma has support for Capistrano with an [external gem](https://github.com/seuros/capistrano-puma).
|
391
|
+
|
392
|
+
* Additionally, Puma has support for built-in daemonization via the [puma-daemon](https://github.com/kigster/puma-daemon) ruby gem. The gem restores the `daemonize` option that was removed from Puma starting version 5, but only for MRI Ruby.
|
393
|
+
|
345
394
|
|
346
395
|
It is common to use process monitors with Puma. Modern process monitors like systemd or rc.d
|
347
|
-
provide continuous monitoring and restarts for increased
|
348
|
-
reliability in production environments:
|
396
|
+
provide continuous monitoring and restarts for increased reliability in production environments:
|
349
397
|
|
350
398
|
* [rc.d](docs/jungle/rc.d/README.md)
|
351
399
|
* [systemd](docs/systemd.md)
|
352
400
|
|
353
|
-
Community guides:
|
401
|
+
Community guides:
|
354
402
|
|
355
403
|
* [Deploying Puma on OpenBSD using relayd and httpd](https://gist.github.com/anon987654321/4532cf8d6c59c1f43ec8973faa031103)
|
356
404
|
|
@@ -360,7 +408,8 @@ Community guides:
|
|
360
408
|
|
361
409
|
* [puma-metrics](https://github.com/harmjanblok/puma-metrics) — export Puma metrics to Prometheus
|
362
410
|
* [puma-plugin-statsd](https://github.com/yob/puma-plugin-statsd) — send Puma metrics to statsd
|
363
|
-
* [puma-plugin-systemd](https://github.com/sj26/puma-plugin-systemd) — deeper integration with systemd for notify, status and watchdog
|
411
|
+
* [puma-plugin-systemd](https://github.com/sj26/puma-plugin-systemd) — deeper integration with systemd for notify, status and watchdog. Puma 5.1.0 integrated notify and watchdog, which probably conflicts with this plugin. Puma 6.1.0 added status support which obsoletes the plugin entirely.
|
412
|
+
* [puma-plugin-telemetry](https://github.com/babbel/puma-plugin-telemetry) - telemetry plugin for Puma offering various targets to publish
|
364
413
|
|
365
414
|
### Monitoring
|
366
415
|
|
data/bin/puma-wild
CHANGED
data/docs/compile_options.md
CHANGED
@@ -19,3 +19,37 @@ For Bundler, use its configuration system:
|
|
19
19
|
```
|
20
20
|
bundle config build.puma "--with-cflags='-D PUMA_QUERY_STRING_MAX_LENGTH=64000'"
|
21
21
|
```
|
22
|
+
|
23
|
+
## Request Path, `PUMA_REQUEST_PATH_MAX_LENGTH`
|
24
|
+
|
25
|
+
By default, the max length of `REQUEST_PATH` is `8192`. But you may want to
|
26
|
+
adjust it to accept longer paths in requests.
|
27
|
+
|
28
|
+
For manual install, pass the `PUMA_REQUEST_PATH_MAX_LENGTH` option like this:
|
29
|
+
|
30
|
+
```
|
31
|
+
gem install puma -- --with-cflags="-D PUMA_REQUEST_PATH_MAX_LENGTH=64000"
|
32
|
+
```
|
33
|
+
|
34
|
+
For Bundler, use its configuration system:
|
35
|
+
|
36
|
+
```
|
37
|
+
bundle config build.puma "--with-cflags='-D PUMA_REQUEST_PATH_MAX_LENGTH=64000'"
|
38
|
+
```
|
39
|
+
|
40
|
+
## Request URI, `PUMA_REQUEST_URI_MAX_LENGTH`
|
41
|
+
|
42
|
+
By default, the max length of `REQUEST_URI` is `1024 * 12`. But you may want to
|
43
|
+
adjust it to accept longer URIs in requests.
|
44
|
+
|
45
|
+
For manual install, pass the `PUMA_REQUEST_URI_MAX_LENGTH` option like this:
|
46
|
+
|
47
|
+
```
|
48
|
+
gem install puma -- --with-cflags="-D PUMA_REQUEST_URI_MAX_LENGTH=64000"
|
49
|
+
```
|
50
|
+
|
51
|
+
For Bundler, use its configuration system:
|
52
|
+
|
53
|
+
```
|
54
|
+
bundle config build.puma "--with-cflags='-D PUMA_REQUEST_URI_MAX_LENGTH=64000'"
|
55
|
+
```
|
data/docs/fork_worker.md
CHANGED
@@ -10,7 +10,7 @@ Puma 5 introduces an experimental new cluster-mode configuration option, `fork_w
|
|
10
10
|
10004 \_ puma: cluster worker 3: 10000 [puma]
|
11
11
|
```
|
12
12
|
|
13
|
-
|
13
|
+
The `fork_worker` option allows your application to be initialized only once for copy-on-write memory savings, and it has two additional advantages:
|
14
14
|
|
15
15
|
1. **Compatible with phased restart.** Because the master process itself doesn't preload the application, this mode works with phased restart (`SIGUSR1` or `pumactl phased-restart`). When worker 0 reloads as part of a phased restart, it initializes a new copy of your application first, then the other workers reload by forking from this new worker already containing the new preloaded application.
|
16
16
|
|
@@ -24,8 +24,6 @@ Similar to the `preload_app!` option, the `fork_worker` option allows your appli
|
|
24
24
|
|
25
25
|
### Limitations
|
26
26
|
|
27
|
-
- Not compatible with the `preload_app!` option
|
28
|
-
|
29
27
|
- This mode is still very experimental so there may be bugs or edge-cases, particularly around expected behavior of existing hooks. Please open a [bug report](https://github.com/puma/puma/issues/new?template=bug_report.md) if you encounter any issues.
|
30
28
|
|
31
29
|
- In order to fork new workers cleanly, worker 0 shuts down its server and stops serving requests so there are no open file descriptors or other kinds of shared global state between processes, and to maximize copy-on-write efficiency across the newly-forked workers. This may temporarily reduce total capacity of the cluster during a phased restart / refork.
|