puma 5.5.2 → 6.3.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.

Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +336 -3
  3. data/README.md +61 -16
  4. data/bin/puma-wild +1 -1
  5. data/docs/architecture.md +4 -4
  6. data/docs/compile_options.md +34 -0
  7. data/docs/fork_worker.md +1 -3
  8. data/docs/nginx.md +1 -1
  9. data/docs/signals.md +1 -0
  10. data/docs/systemd.md +1 -2
  11. data/docs/testing_benchmarks_local_files.md +150 -0
  12. data/docs/testing_test_rackup_ci_files.md +36 -0
  13. data/ext/puma_http11/extconf.rb +28 -14
  14. data/ext/puma_http11/http11_parser.c +1 -1
  15. data/ext/puma_http11/http11_parser.h +1 -1
  16. data/ext/puma_http11/http11_parser.java.rl +2 -2
  17. data/ext/puma_http11/http11_parser.rl +2 -2
  18. data/ext/puma_http11/http11_parser_common.rl +2 -2
  19. data/ext/puma_http11/mini_ssl.c +135 -23
  20. data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
  21. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +1 -1
  22. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +188 -102
  23. data/ext/puma_http11/puma_http11.c +18 -10
  24. data/lib/puma/app/status.rb +7 -4
  25. data/lib/puma/binder.rb +62 -51
  26. data/lib/puma/cli.rb +19 -20
  27. data/lib/puma/client.rb +108 -26
  28. data/lib/puma/cluster/worker.rb +23 -16
  29. data/lib/puma/cluster/worker_handle.rb +8 -1
  30. data/lib/puma/cluster.rb +62 -41
  31. data/lib/puma/commonlogger.rb +21 -14
  32. data/lib/puma/configuration.rb +76 -55
  33. data/lib/puma/const.rb +133 -97
  34. data/lib/puma/control_cli.rb +21 -18
  35. data/lib/puma/detect.rb +12 -2
  36. data/lib/puma/dsl.rb +270 -55
  37. data/lib/puma/error_logger.rb +18 -9
  38. data/lib/puma/events.rb +6 -126
  39. data/lib/puma/io_buffer.rb +39 -4
  40. data/lib/puma/jruby_restart.rb +2 -1
  41. data/lib/puma/launcher/bundle_pruner.rb +104 -0
  42. data/lib/puma/launcher.rb +114 -175
  43. data/lib/puma/log_writer.rb +147 -0
  44. data/lib/puma/minissl/context_builder.rb +30 -16
  45. data/lib/puma/minissl.rb +126 -17
  46. data/lib/puma/null_io.rb +5 -0
  47. data/lib/puma/plugin/systemd.rb +90 -0
  48. data/lib/puma/plugin/tmp_restart.rb +1 -1
  49. data/lib/puma/plugin.rb +1 -1
  50. data/lib/puma/rack/builder.rb +6 -6
  51. data/lib/puma/rack_default.rb +19 -4
  52. data/lib/puma/reactor.rb +19 -10
  53. data/lib/puma/request.rb +365 -161
  54. data/lib/puma/runner.rb +55 -22
  55. data/lib/puma/sd_notify.rb +149 -0
  56. data/lib/puma/server.rb +91 -94
  57. data/lib/puma/single.rb +13 -11
  58. data/lib/puma/state_file.rb +39 -7
  59. data/lib/puma/thread_pool.rb +25 -21
  60. data/lib/puma/util.rb +12 -14
  61. data/lib/puma.rb +12 -11
  62. data/lib/rack/handler/puma.rb +113 -86
  63. data/tools/Dockerfile +1 -1
  64. metadata +11 -6
  65. data/lib/puma/queue_close.rb +0 -26
  66. data/lib/puma/systemd.rb +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0ef12e973901d1ef05ea411057d82c5dc3e3c6fbe471402abfea5cb9e9a5da
4
- data.tar.gz: 32b6b9e7a34748bd8facf5d6bb2bb8fc0b3aedda83823b4db826d9b16fdf9290
3
+ metadata.gz: fee07e30f79d6f40104c1265c78bba2ba7f91cd6aff53d4df7d7bcbe62f052da
4
+ data.tar.gz: 3f3d8d6107481ffc4e545c7f976ec3480c2c5876a4ba8b7c50e1f7b5a7b3d286
5
5
  SHA512:
6
- metadata.gz: a7792db683a263be5a0bd226578f98d55bcfb9ecab6fcdd1fc09da8b903f7960f149711b5174660ff6ebfa5402e2eb0e0d75ff1b5ce1110dfbec85e0532ed078
7
- data.tar.gz: 344ad1f7eae75c085e42e24583a77a2444e8a92386fa8ac66ad7ea8d35ae3a72d7db0c01da60a2d20bc04330608b260685eb934603c9440df7208f809a6994f1
6
+ metadata.gz: a312fd8f5e8b8a146d40bca643fd22639bb3a67f7e2acd995e000e4c82b159c68b78547e3b48340cf747c0c2666cd3897581e19ff5a4a752dcb6c07cf8618562
7
+ data.tar.gz: a8136c073d50d1c1b8f7f4ff831bcd2f2aa0cfea1a233e9c88bf4900c120f3131e61245632dd55f5357ca5217203d64d7cef4285d19adce33bff4c5e18640f05
data/History.md CHANGED
@@ -1,3 +1,182 @@
1
+ ## 6.3.0 / 2023-05-31
2
+
3
+ * Features
4
+ * Add dsl method `supported_http_methods` ([#3106], [#3014])
5
+ * Puma error responses no longer have any fingerprints to indicate Puma ([#3161], [#3037])
6
+ * Support decryption of SSL key ([#3133], [#3132])
7
+
8
+ * Bugfixes
9
+ * Don't send 103 early hints response when only invalid headers are used ([#3163])
10
+ * Handle malformed request path ([#3155], [#3148])
11
+ * Misc lib file fixes - trapping additional errors, CI helper ([#3129])
12
+ * Fixup req form data file upload with "r\n" line endings ([#3137])
13
+ * Restore rack 1.6 compatibility Restore rack 1.6 compatibility ([#3156])
14
+
15
+ * Refactor
16
+ * const.rb - Update Puma::HTTP_STATUS_CODES ([#3162])
17
+ * Clarify Reactor#initialize ([#3151])
18
+
19
+ ## 6.2.2 / 2023-04-17
20
+
21
+ * Bugfixes
22
+ * Fix Rack-related NameError by adding :: operator ([#3118], [#3117])
23
+
24
+ ## 6.2.1 / 2023-03-31
25
+
26
+ * Bugfixes
27
+ * Fix java 8 compatibility ([#3109], [#3108])
28
+ * Always write io_buffer when in "enum bodies" branch. ([#3113], [#3112])
29
+ * Fix warn_if_in_single_mode incorrect message ([#3111])
30
+
31
+ ## 6.2.0 / 2023-03-29
32
+
33
+ * Features
34
+ * Ability to supply a custom logger ([#2770], [#2511])
35
+ * Warn when clustered-only hooks are defined in single mode ([#3089])
36
+ * Adds the on_booted event ([#2709])
37
+
38
+ * Bugfixes
39
+ * Loggers - internal_write - catch Errno::EINVAL ([#3091])
40
+ * commonlogger.rb - fix HIJACK time format, use constants, not strings ([#3074])
41
+ * Fixed some edge cases regarding request hijacking ([#3072])
42
+
43
+ ## 6.1.1 / 2023-02-28
44
+
45
+ * Bugfixes
46
+ * We no longer try to use the systemd plugin for JRuby ([#3079])
47
+ * Allow ::Rack::Handler::Puma.run to work regardless of whether Rack/Rackup are loaded ([#3080])
48
+
49
+ ## 6.1.0 / 2023-02-12
50
+
51
+ * Features
52
+ * WebSocket support via partial hijack ([#3058], [#3007])
53
+ * Add built-in systemd notify support ([#3011])
54
+ * Periodically send status to systemd ([#3006], [#2604])
55
+ * Introduce the ability to return 413: payload too large for requests ([#3040])
56
+ * Log loaded extensions when `PUMA_DEBUG` is set ([#3036], [#3020])
57
+
58
+ * Bugfixes
59
+ * Fix issue with rack 3 compatibility re: rackup ([#3061], [#3057])
60
+ * Allow setting TCP low_latency with SSL listener ([#3065])
61
+
62
+ * Performance
63
+ * Reduce memory usage for large file uploads ([#3062])
64
+
65
+ ## 6.0.2 / 2023-01-01
66
+
67
+ * Refactor
68
+ * Remove use of etc and time gems in Puma ([#3035], [#3033])
69
+ * Refactor const.rb - freeze ([#3016])
70
+
71
+ ## 6.0.1 / 2022-12-20
72
+
73
+ * Bugfixes
74
+ * Handle waking up a closed selector in Reactor#add ([#3005])
75
+ * Fixup response processing, enumerable bodies ([#3004], [#3000])
76
+ * Correctly close app body for all code paths ([#3002], [#2999])
77
+ * Refactor
78
+ * Add IOBuffer to Client, remove from ThreadPool thread instances ([#3013])
79
+
80
+ ## 6.0.0 / 2022-10-14
81
+
82
+ * Breaking Changes
83
+ * Dropping Ruby 2.2 and 2.3 support (now 2.4+) ([#2919])
84
+ * Remote_addr functionality has changed ([#2652], [#2653])
85
+ * No longer supporting Java 1.7 or below (JRuby 9.1 was the last release to support this) ([#2849])
86
+ * Remove nakayoshi GC ([#2933], [#2925])
87
+ * wait_for_less_busy_worker is now default on ([#2940])
88
+ * Prefix all environment variables with `PUMA_` ([#2924], [#2853])
89
+ * Removed some constants ([#2957], [#2958], [#2959], [#2960])
90
+ * The following classes are now part of Puma's private API: `Client`, `Cluster::Worker`, `Cluster::Worker`, `HandleRequest`. ([#2988])
91
+ * Configuration constants like `DefaultRackup` removed ([#2928])
92
+ * Extracted `LogWriter` from `Events` ([#2798])
93
+ * Only accept the standard 8 HTTP methods, others rejected with 501. ([#2932])
94
+
95
+ * Features
96
+ * Increase throughput on large (100kb+) response bodies by 3-10x ([#2896], [#2892])
97
+ * Increase throughput on file responses ([#2923])
98
+ * Add support for streaming bodies in Rack. ([#2740])
99
+ * Allow OpenSSL session reuse via a 'reuse' ssl_bind method or bind string query parameter ([#2845])
100
+ * Allow `run_hooks` to pass a hash to blocks for use later ([#2917], [#2915])
101
+ * Allow using `preload_app!` with `fork_worker` ([#2907])
102
+ * Support request_body_wait metric with higher precision ([#2953])
103
+ * Allow header values to be arrays (Rack 3) ([#2936], [#2931])
104
+ * Export Puma/Ruby versions in /stats ([#2875])
105
+ * Allow configuring request uri max length & request path max length ([#2840])
106
+ * Add a couple of public accessors ([#2774])
107
+ * Log entire backtrace when worker start fails ([#2891])
108
+ * [jruby] Enable TLSv1.3 support ([#2886])
109
+ * [jruby] support setting TLS protocols + rename ssl_cipher_list ([#2899])
110
+ * [jruby] Support a truststore option ([#2849], [#2904], [#2884])
111
+
112
+ * Bugfixes
113
+ * Load the configuration before passing it to the binder ([#2897])
114
+ * Do not raise error raised on HTTP methods we don't recognize or support, like CONNECT ([#2932], [#1441])
115
+ * Fixed a memory leak when creating a new SSL listener ([#2956])
116
+
117
+ * Refactor
118
+ * log_writer.rb - add internal_write method ([#2888])
119
+ * Extract prune_bundler code into it's own class. ([#2797])
120
+ * Refactor Launcher#run to increase readability (no logic change) ([#2795])
121
+ * Ruby 3.2 will have native IO#wait_* methods, don't require io/wait ([#2903])
122
+ * Various internal API refactorings ([#2942], [#2921], [#2922], [#2955])
123
+
124
+ ## 5.6.5 / 2022-08-23
125
+
126
+ * Feature
127
+ * Puma::ControlCLI - allow refork command to be sent as a request ([#2868], [#2866])
128
+
129
+ * Bugfixes
130
+ * NullIO#closed should return false ([#2883])
131
+ * [jruby] Fix TLS verification hang ([#2890], [#2729])
132
+ * extconf.rb - don't use pkg_config('openssl') if '--with-openssl-dir' is used ([#2885], [#2839])
133
+ * MiniSSL - detect SSL_CTX_set_dh_auto ([#2864], [#2863])
134
+ * Fix rack.after_reply exceptions breaking connections ([#2861], [#2856])
135
+ * Escape SSL cert and filenames ([#2855])
136
+ * Fail hard if SSL certs or keys are invalid ([#2848])
137
+ * Fail hard if SSL certs or keys cannot be read by user ([#2847])
138
+ * Fix build with Opaque DH in LibreSSL 3.5. ([#2838])
139
+ * Pre-existing socket file removed when TERM is issued after USR2 (if puma is running in cluster mode) ([#2817])
140
+ * Fix Puma::StateFile#load incompatibility ([#2810])
141
+
142
+ ## 5.6.4 / 2022-03-30
143
+
144
+ * Security
145
+ * Close several HTTP Request Smuggling exploits (CVE-2022-24790)
146
+
147
+ ## 5.6.2 / 2022-02-11
148
+
149
+ * Bugfix/Security
150
+ * Response body will always be `close`d. (GHSA-rmj8-8hhh-gv5h, related to [#2809])
151
+
152
+ ## 5.6.1 / 2022-01-26
153
+
154
+ * Bugfixes
155
+ * Reverted a commit which appeared to be causing occasional blank header values ([#2809])
156
+
157
+ ## 5.6.0 / 2022-01-25
158
+
159
+ * Features
160
+ * Support `localhost` integration in `ssl_bind` ([#2764], [#2708])
161
+ * Allow backlog parameter to be set with ssl_bind DSL ([#2780])
162
+ * Remove yaml (psych) requirement in StateFile ([#2784])
163
+ * Allow culling of oldest workers, previously was only youngest ([#2773], [#2794])
164
+ * Add worker_check_interval configuration option ([#2759])
165
+ * Always send lowlevel_error response to client ([#2731], [#2341])
166
+ * Support for cert_pem and key_pem with ssl_bind DSL ([#2728])
167
+
168
+ * Bugfixes
169
+ * Keep thread names under 15 characters, prevents breakage on some OSes ([#2733])
170
+ * Fix two 'old-style-definition' compile warning ([#2807], [#2806])
171
+ * Log environment correctly using option value ([#2799])
172
+ * Fix warning from Ruby master (will be 3.2.0) ([#2785])
173
+ * extconf.rb - fix openssl with old Windows builds ([#2757])
174
+ * server.rb - rescue handling (`Errno::EBADF`) for `@notify.close` ([#2745])
175
+
176
+ * Refactor
177
+ * server.rb - refactor code using @options[:remote_address] ([#2742])
178
+ * [jruby] a couple refactorings - avoid copy-ing bytes ([#2730])
179
+
1
180
  ## 5.5.2 / 2021-10-12
2
181
 
3
182
  * Bugfixes
@@ -5,6 +184,9 @@
5
184
 
6
185
  ## 5.5.1 / 2021-10-12
7
186
 
187
+ * Feature (added as mistake - we don't normally do this on bugfix releases, sorry!)
188
+ * Allow setting APP_ENV in preference to RACK_ENV or RAILS_ENV ([#2702])
189
+
8
190
  * Security
9
191
  * Do not allow LF as a line ending in a header (CVE-2021-41136)
10
192
 
@@ -261,6 +443,21 @@
261
443
  * Support parallel tests in verbose progress reporting ([#2223])
262
444
  * Refactor error handling in server accept loop ([#2239])
263
445
 
446
+ ## 4.3.12 / 2022-03-30
447
+
448
+ * Security
449
+ * Close several HTTP Request Smuggling exploits (CVE-2022-24790)
450
+
451
+ ## 4.3.11 / 2022-02-11
452
+
453
+ * Security
454
+ * Always close the response body (GHSA-rmj8-8hhh-gv5h)
455
+
456
+ ## 4.3.10 / 2021-10-12
457
+
458
+ * Bugfixes
459
+ * Allow UTF-8 in HTTP header values
460
+
264
461
  ## 4.3.9 / 2021-10-12
265
462
 
266
463
  * Security
@@ -1799,6 +1996,142 @@ be added back in a future date when a java Puma::MiniSSL is added.
1799
1996
  * Bugfixes
1800
1997
  * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
1801
1998
 
1999
+ [#3106]:https://github.com/puma/puma/pull/3106 "PR by @MSP-Greg, merged 2023-05-29"
2000
+ [#3014]:https://github.com/puma/puma/issues/3014 "Issue by @kyledrake, closed 2023-05-29"
2001
+ [#3161]:https://github.com/puma/puma/pull/3161 "PR by @MSP-Greg, merged 2023-05-27"
2002
+ [#3037]:https://github.com/puma/puma/issues/3037 "Issue by @daisy1754, closed 2023-05-27"
2003
+ [#3133]:https://github.com/puma/puma/pull/3133 "PR by @stanhu, merged 2023-04-30"
2004
+ [#3132]:https://github.com/puma/puma/issues/3132 "Issue by @stanhu, closed 2023-04-30"
2005
+ [#3163]:https://github.com/puma/puma/pull/3163 "PR by @MSP-Greg, merged 2023-05-27"
2006
+ [#3155]:https://github.com/puma/puma/pull/3155 "PR by @dentarg, merged 2023-05-14"
2007
+ [#3148]:https://github.com/puma/puma/issues/3148 "Issue by @dentarg, closed 2023-05-14"
2008
+ [#3129]:https://github.com/puma/puma/pull/3129 "PR by @MSP-Greg, merged 2023-05-02"
2009
+ [#3137]:https://github.com/puma/puma/pull/3137 "PR by @MSP-Greg, merged 2023-04-30"
2010
+ [#3156]:https://github.com/puma/puma/pull/3156 "PR by @severin, merged 2023-05-16"
2011
+ [#3162]:https://github.com/puma/puma/pull/3162 "PR by @MSP-Greg, merged 2023-05-23"
2012
+ [#3151]:https://github.com/puma/puma/pull/3151 "PR by @nateberkopec, merged 2023-05-12"
2013
+ [#3118]:https://github.com/puma/puma/pull/3118 "PR by @ninoseki, merged 2023-04-01"
2014
+ [#3117]:https://github.com/puma/puma/issues/3117 "Issue by @ninoseki, closed 2023-04-01"
2015
+ [#3109]:https://github.com/puma/puma/pull/3109 "PR by @ahorek, merged 2023-03-31"
2016
+ [#3108]:https://github.com/puma/puma/issues/3108 "Issue by @treviateo, closed 2023-03-31"
2017
+ [#3113]:https://github.com/puma/puma/pull/3113 "PR by @collinsauve, merged 2023-03-31"
2018
+ [#3112]:https://github.com/puma/puma/issues/3112 "Issue by @dmke, closed 2023-03-31"
2019
+ [#3111]:https://github.com/puma/puma/pull/3111 "PR by @adzap, merged 2023-03-30"
2020
+ [#2770]:https://github.com/puma/puma/pull/2770 "PR by @vzajkov, merged 2023-03-29"
2021
+ [#2511]:https://github.com/puma/puma/issues/2511 "Issue by @jchristie55332, closed 2021-12-12"
2022
+ [#3089]:https://github.com/puma/puma/pull/3089 "PR by @Vuta, merged 2023-03-06"
2023
+ [#2709]:https://github.com/puma/puma/pull/2709 "PR by @rodzyn, merged 2023-02-20"
2024
+ [#3091]:https://github.com/puma/puma/pull/3091 "PR by @MSP-Greg, merged 2023-03-28"
2025
+ [#3074]:https://github.com/puma/puma/pull/3074 "PR by @MSP-Greg, merged 2023-03-14"
2026
+ [#3072]:https://github.com/puma/puma/pull/3072 "PR by @MSP-Greg, merged 2023-02-17"
2027
+ [#3079]:https://github.com/puma/puma/pull/3079 "PR by @mohamedhafez, merged 2023-02-24"
2028
+ [#3080]:https://github.com/puma/puma/pull/3080 "PR by @MSP-Greg, merged 2023-02-16"
2029
+ [#3058]:https://github.com/puma/puma/pull/3058 "PR by @dentarg, merged 2023-01-29"
2030
+ [#3007]:https://github.com/puma/puma/issues/3007 "Issue by @MSP-Greg, closed 2023-01-29"
2031
+ [#3011]:https://github.com/puma/puma/pull/3011 "PR by @joaomarcos96, merged 2023-01-03"
2032
+ [#3006]:https://github.com/puma/puma/pull/3006 "PR by @QWYNG, merged 2023-02-09"
2033
+ [#2604]:https://github.com/puma/puma/issues/2604 "Issue by @dgoetz, closed 2023-02-09"
2034
+ [#3040]:https://github.com/puma/puma/pull/3040 "PR by @shayonj, merged 2023-01-02"
2035
+ [#3036]:https://github.com/puma/puma/pull/3036 "PR by @MSP-Greg, merged 2023-01-13"
2036
+ [#3020]:https://github.com/puma/puma/issues/3020 "Issue by @dentarg, closed 2023-01-13"
2037
+ [#3061]:https://github.com/puma/puma/pull/3061 "PR by @MSP-Greg, merged 2023-02-12"
2038
+ [#3057]:https://github.com/puma/puma/issues/3057 "Issue by @mmarvb8h, closed 2023-02-12"
2039
+ [#3065]:https://github.com/puma/puma/pull/3065 "PR by @MSP-Greg, merged 2023-02-11"
2040
+ [#3062]:https://github.com/puma/puma/pull/3062 "PR by @willkoehler, merged 2023-01-29"
2041
+ [#3035]:https://github.com/puma/puma/pull/3035 "PR by @MSP-Greg, merged 2022-12-24"
2042
+ [#3033]:https://github.com/puma/puma/issues/3033 "Issue by @jules-w2, closed 2022-12-24"
2043
+ [#3016]:https://github.com/puma/puma/pull/3016 "PR by @MSP-Greg, merged 2022-12-24"
2044
+ [#3005]:https://github.com/puma/puma/pull/3005 "PR by @JuanitoFatas, merged 2022-11-04"
2045
+ [#3004]:https://github.com/puma/puma/pull/3004 "PR by @MSP-Greg, merged 2022-11-24"
2046
+ [#3000]:https://github.com/puma/puma/issues/3000 "Issue by @dentarg, closed 2022-11-24"
2047
+ [#3002]:https://github.com/puma/puma/pull/3002 "PR by @MSP-Greg, merged 2022-11-03"
2048
+ [#2999]:https://github.com/puma/puma/issues/2999 "Issue by @aymeric-ledorze, closed 2022-11-03"
2049
+ [#3013]:https://github.com/puma/puma/pull/3013 "PR by @MSP-Greg, merged 2022-11-13"
2050
+ [#2919]:https://github.com/puma/puma/pull/2919 "PR by @MSP-Greg, merged 2022-08-30"
2051
+ [#2652]:https://github.com/puma/puma/issues/2652 "Issue by @Roguelazer, closed 2022-09-04"
2052
+ [#2653]:https://github.com/puma/puma/pull/2653 "PR by @Roguelazer, closed 2022-03-07"
2053
+ [#2849]:https://github.com/puma/puma/pull/2849 "PR by @kares, merged 2022-04-09"
2054
+ [#2933]:https://github.com/puma/puma/pull/2933 "PR by @cafedomancer, merged 2022-09-09"
2055
+ [#2925]:https://github.com/puma/puma/issues/2925 "Issue by @nateberkopec, closed 2022-09-09"
2056
+ [#2940]:https://github.com/puma/puma/pull/2940 "PR by @cafedomancer, merged 2022-09-10"
2057
+ [#2924]:https://github.com/puma/puma/pull/2924 "PR by @cafedomancer, merged 2022-09-07"
2058
+ [#2853]:https://github.com/puma/puma/issues/2853 "Issue by @nateberkopec, closed 2022-09-07"
2059
+ [#2957]:https://github.com/puma/puma/pull/2957 "PR by @JuanitoFatas, merged 2022-09-16"
2060
+ [#2958]:https://github.com/puma/puma/pull/2958 "PR by @JuanitoFatas, merged 2022-09-16"
2061
+ [#2959]:https://github.com/puma/puma/pull/2959 "PR by @JuanitoFatas, merged 2022-09-16"
2062
+ [#2960]:https://github.com/puma/puma/pull/2960 "PR by @JuanitoFatas, merged 2022-09-16"
2063
+ [#2988]:https://github.com/puma/puma/pull/2988 "PR by @MSP-Greg, merged 2022-10-12"
2064
+ [#2928]:https://github.com/puma/puma/pull/2928 "PR by @nateberkopec, merged 2022-09-10"
2065
+ [#2798]:https://github.com/puma/puma/pull/2798 "PR by @johnnyshields, merged 2022-02-05"
2066
+ [#2932]:https://github.com/puma/puma/pull/2932 "PR by @mrzasa, merged 2022-09-12"
2067
+ [#2896]:https://github.com/puma/puma/pull/2896 "PR by @MSP-Greg, merged 2022-09-13"
2068
+ [#2892]:https://github.com/puma/puma/pull/2892 "PR by @guilleiguaran, closed 2022-09-13"
2069
+ [#2923]:https://github.com/puma/puma/pull/2923 "PR by @nateberkopec, merged 2022-09-09"
2070
+ [#2740]:https://github.com/puma/puma/pull/2740 "PR by @ioquatix, merged 2022-01-29"
2071
+ [#2845]:https://github.com/puma/puma/issues/2845 "Issue by @donv, closed 2022-03-22"
2072
+ [#2917]:https://github.com/puma/puma/pull/2917 "PR by @MSP-Greg, merged 2022-09-19"
2073
+ [#2915]:https://github.com/puma/puma/issues/2915 "Issue by @mperham, closed 2022-09-19"
2074
+ [#2907]:https://github.com/puma/puma/pull/2907 "PR by @casperisfine, merged 2022-09-15"
2075
+ [#2953]:https://github.com/puma/puma/pull/2953 "PR by @JuanitoFatas, merged 2022-09-14"
2076
+ [#2936]:https://github.com/puma/puma/pull/2936 "PR by @MSP-Greg, merged 2022-09-09"
2077
+ [#2931]:https://github.com/puma/puma/issues/2931 "Issue by @dentarg, closed 2022-09-09"
2078
+ [#2875]:https://github.com/puma/puma/pull/2875 "PR by @ylecuyer, merged 2022-05-19"
2079
+ [#2840]:https://github.com/puma/puma/pull/2840 "PR by @LukaszMaslej, merged 2022-04-13"
2080
+ [#2774]:https://github.com/puma/puma/pull/2774 "PR by @ob-stripe, merged 2022-01-31"
2081
+ [#2891]:https://github.com/puma/puma/pull/2891 "PR by @gingerlime, merged 2022-06-02"
2082
+ [#2886]:https://github.com/puma/puma/pull/2886 "PR by @kares, merged 2022-05-30"
2083
+ [#2899]:https://github.com/puma/puma/pull/2899 "PR by @kares, merged 2022-07-04"
2084
+ [#2904]:https://github.com/puma/puma/pull/2904 "PR by @kares, merged 2022-08-27"
2085
+ [#2884]:https://github.com/puma/puma/pull/2884 "PR by @kares, merged 2022-05-30"
2086
+ [#2897]:https://github.com/puma/puma/pull/2897 "PR by @Edouard-chin, merged 2022-08-27"
2087
+ [#1441]:https://github.com/puma/puma/issues/1441 "Issue by @nirvdrum, closed 2022-09-12"
2088
+ [#2956]:https://github.com/puma/puma/pull/2956 "PR by @MSP-Greg, merged 2022-09-15"
2089
+ [#2888]:https://github.com/puma/puma/pull/2888 "PR by @MSP-Greg, merged 2022-06-01"
2090
+ [#2797]:https://github.com/puma/puma/pull/2797 "PR by @johnnyshields, merged 2022-02-01"
2091
+ [#2795]:https://github.com/puma/puma/pull/2795 "PR by @johnnyshields, merged 2022-01-31"
2092
+ [#2903]:https://github.com/puma/puma/pull/2903 "PR by @MSP-Greg, merged 2022-08-27"
2093
+ [#2942]:https://github.com/puma/puma/pull/2942 "PR by @nateberkopec, merged 2022-09-15"
2094
+ [#2921]:https://github.com/puma/puma/issues/2921 "Issue by @MSP-Greg, closed 2022-09-15"
2095
+ [#2922]:https://github.com/puma/puma/issues/2922 "Issue by @MSP-Greg, closed 2022-09-10"
2096
+ [#2955]:https://github.com/puma/puma/pull/2955 "PR by @cafedomancer, merged 2022-09-15"
2097
+ [#2868]:https://github.com/puma/puma/pull/2868 "PR by @MSP-Greg, merged 2022-06-02"
2098
+ [#2866]:https://github.com/puma/puma/issues/2866 "Issue by @slondr, closed 2022-06-02"
2099
+ [#2883]:https://github.com/puma/puma/pull/2883 "PR by @MSP-Greg, merged 2022-06-02"
2100
+ [#2890]:https://github.com/puma/puma/pull/2890 "PR by @kares, merged 2022-06-01"
2101
+ [#2729]:https://github.com/puma/puma/issues/2729 "Issue by @kares, closed 2022-06-01"
2102
+ [#2885]:https://github.com/puma/puma/pull/2885 "PR by @MSP-Greg, merged 2022-05-30"
2103
+ [#2839]:https://github.com/puma/puma/issues/2839 "Issue by @wlipa, closed 2022-05-30"
2104
+ [#2864]:https://github.com/puma/puma/pull/2864 "PR by @MSP-Greg, merged 2022-04-26"
2105
+ [#2863]:https://github.com/puma/puma/issues/2863 "Issue by @eradman, closed 2022-04-26"
2106
+ [#2861]:https://github.com/puma/puma/pull/2861 "PR by @BlakeWilliams, merged 2022-04-17"
2107
+ [#2856]:https://github.com/puma/puma/issues/2856 "Issue by @nateberkopec, closed 2022-04-17"
2108
+ [#2855]:https://github.com/puma/puma/pull/2855 "PR by @stanhu, merged 2022-04-09"
2109
+ [#2848]:https://github.com/puma/puma/pull/2848 "PR by @stanhu, merged 2022-04-02"
2110
+ [#2847]:https://github.com/puma/puma/pull/2847 "PR by @stanhu, merged 2022-04-02"
2111
+ [#2838]:https://github.com/puma/puma/pull/2838 "PR by @epsilon-0, merged 2022-03-03"
2112
+ [#2817]:https://github.com/puma/puma/pull/2817 "PR by @khustochka, merged 2022-02-20"
2113
+ [#2810]:https://github.com/puma/puma/pull/2810 "PR by @kzkn, merged 2022-01-27"
2114
+ [#2809]:https://github.com/puma/puma/pull/2809 "PR by @dentarg, merged 2022-01-26"
2115
+ [#2764]:https://github.com/puma/puma/pull/2764 "PR by @dentarg, merged 2022-01-18"
2116
+ [#2708]:https://github.com/puma/puma/issues/2708 "Issue by @erikaxel, closed 2022-01-18"
2117
+ [#2780]:https://github.com/puma/puma/pull/2780 "PR by @dalibor, merged 2022-01-01"
2118
+ [#2784]:https://github.com/puma/puma/pull/2784 "PR by @MSP-Greg, merged 2022-01-01"
2119
+ [#2773]:https://github.com/puma/puma/pull/2773 "PR by @ob-stripe, merged 2022-01-01"
2120
+ [#2794]:https://github.com/puma/puma/pull/2794 "PR by @johnnyshields, merged 2022-01-10"
2121
+ [#2759]:https://github.com/puma/puma/pull/2759 "PR by @ob-stripe, merged 2021-12-11"
2122
+ [#2731]:https://github.com/puma/puma/pull/2731 "PR by @baelter, merged 2021-11-02"
2123
+ [#2341]:https://github.com/puma/puma/issues/2341 "Issue by @cjlarose, opened 2020-08-18"
2124
+ [#2728]:https://github.com/puma/puma/pull/2728 "PR by @dalibor, merged 2021-10-31"
2125
+ [#2733]:https://github.com/puma/puma/pull/2733 "PR by @ob-stripe, merged 2021-12-12"
2126
+ [#2807]:https://github.com/puma/puma/pull/2807 "PR by @MSP-Greg, merged 2022-01-25"
2127
+ [#2806]:https://github.com/puma/puma/issues/2806 "Issue by @olleolleolle, closed 2022-01-25"
2128
+ [#2799]:https://github.com/puma/puma/pull/2799 "PR by @ags, merged 2022-01-22"
2129
+ [#2785]:https://github.com/puma/puma/pull/2785 "PR by @MSP-Greg, merged 2022-01-02"
2130
+ [#2757]:https://github.com/puma/puma/pull/2757 "PR by @MSP-Greg, merged 2021-11-24"
2131
+ [#2745]:https://github.com/puma/puma/pull/2745 "PR by @MSP-Greg, merged 2021-11-03"
2132
+ [#2742]:https://github.com/puma/puma/pull/2742 "PR by @MSP-Greg, merged 2021-12-12"
2133
+ [#2730]:https://github.com/puma/puma/pull/2730 "PR by @kares, merged 2021-11-01"
2134
+ [#2702]:https://github.com/puma/puma/pull/2702 "PR by @jacobherrington, merged 2021-09-21"
1802
2135
  [#2610]:https://github.com/puma/puma/pull/2610 "PR by @ye-lin-aung, merged 2021-08-18"
1803
2136
  [#2257]:https://github.com/puma/puma/issues/2257 "Issue by @nateberkopec, closed 2021-08-18"
1804
2137
  [#2654]:https://github.com/puma/puma/pull/2654 "PR by @Roguelazer, merged 2021-09-07"
@@ -1863,7 +2196,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
1863
2196
  [#2519]:https://github.com/puma/puma/pull/2519 "PR by @MSP-Greg, merged 2021-01-26"
1864
2197
  [#2522]:https://github.com/puma/puma/pull/2522 "PR by @jcmfernandes, merged 2021-01-12"
1865
2198
  [#2490]:https://github.com/puma/puma/pull/2490 "PR by @Bonias, merged 2020-12-07"
1866
- [#2486]:https://github.com/puma/puma/pull/2486 "PR by @ccverak, merged 2020-12-02"
2199
+ [#2486]:https://github.com/puma/puma/pull/2486 "PR by @karloscodes, merged 2020-12-02"
1867
2200
  [#2535]:https://github.com/puma/puma/pull/2535 "PR by @MSP-Greg, merged 2021-01-27"
1868
2201
  [#2529]:https://github.com/puma/puma/pull/2529 "PR by @MSP-Greg, merged 2021-01-24"
1869
2202
  [#2533]:https://github.com/puma/puma/pull/2533 "PR by @MSP-Greg, merged 2021-01-24"
@@ -1873,7 +2206,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
1873
2206
  [#2521]:https://github.com/puma/puma/pull/2521 "PR by @ojab, merged 2021-01-04"
1874
2207
  [#2531]:https://github.com/puma/puma/pull/2531 "PR by @wjordan, merged 2021-01-19"
1875
2208
  [#2510]:https://github.com/puma/puma/pull/2510 "PR by @micke, merged 2020-12-10"
1876
- [#2472]:https://github.com/puma/puma/pull/2472 "PR by @ccverak, merged 2020-11-02"
2209
+ [#2472]:https://github.com/puma/puma/pull/2472 "PR by @karloscodes, merged 2020-11-02"
1877
2210
  [#2438]:https://github.com/puma/puma/pull/2438 "PR by @ekohl, merged 2020-10-26"
1878
2211
  [#2406]:https://github.com/puma/puma/pull/2406 "PR by @fdel15, merged 2020-10-19"
1879
2212
  [#2449]:https://github.com/puma/puma/pull/2449 "PR by @MSP-Greg, merged 2020-10-28"
@@ -2300,7 +2633,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
2300
2633
  [#709]:https://github.com/puma/puma/pull/709 "PR by @lian, merged 2015-06-10"
2301
2634
  [#711]:https://github.com/puma/puma/pull/711 "PR by @julik, merged 2015-06-10"
2302
2635
  [#712]:https://github.com/puma/puma/pull/712 "PR by @chewi, merged 2015-07-14"
2303
- [#715]:https://github.com/puma/puma/pull/715 "PR by @0RaymondJiang0, merged 2015-07-14"
2636
+ [#715]:https://github.com/puma/puma/pull/715 "PR by @raymondmars, merged 2015-07-14"
2304
2637
  [#725]:https://github.com/puma/puma/pull/725 "PR by @rwz, merged 2015-07-14"
2305
2638
  [#726]:https://github.com/puma/puma/pull/726 "PR by @jshafton, merged 2015-07-14"
2306
2639
  [#729]:https://github.com/puma/puma/pull/729 "PR by @allaire, merged 2015-07-14"
data/README.md CHANGED
@@ -4,10 +4,8 @@
4
4
 
5
5
  # Puma: A Ruby Web Server Built For Parallelism
6
6
 
7
- [![Actions MRI](https://github.com/puma/puma/workflows/MRI/badge.svg?branch=master)](https://github.com/puma/puma/actions?query=workflow%3AMRI)
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**.
@@ -108,15 +106,23 @@ Puma also offers "clustered mode". Clustered mode `fork`s workers from a master
108
106
  $ puma -t 8:32 -w 3
109
107
  ```
110
108
 
109
+ Or with the `WEB_CONCURRENCY` environment variable:
110
+
111
+ ```
112
+ $ WEB_CONCURRENCY=3 puma -t 8:32
113
+ ```
114
+
111
115
  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
116
 
113
- 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) (Ruby 2.0+ only). Use the `--preload` flag from the command line:
117
+ 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).
118
+
119
+ 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
120
 
115
121
  ```
116
122
  $ puma -w 3 --preload
117
123
  ```
118
124
 
119
- If you're using a configuration file, use the `preload_app!` method:
125
+ Or, if you're using a configuration file, you can use the `preload_app!` method:
120
126
 
121
127
  ```ruby
122
128
  # config/puma.rb
@@ -124,7 +130,9 @@ workers 3
124
130
  preload_app!
125
131
  ```
126
132
 
127
- Additionally, you can specify a block in your configuration file that will be run on boot of each worker:
133
+ 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.
134
+
135
+ When using clustered mode, you can specify a block in your configuration file that will be run on boot of each worker:
128
136
 
129
137
  ```ruby
130
138
  # config/puma.rb
@@ -137,7 +145,10 @@ This code can be used to setup the process before booting the application, allow
137
145
  you to do some Puma-specific things that you don't want to embed in your application.
138
146
  For instance, you could fire a log notification that a worker booted or send something to statsd. This can be called multiple times.
139
147
 
140
- `before_fork` specifies a block to be run before workers are forked:
148
+ Constants loaded by your application (such as `Rails`) will not be available in `on_worker_boot`
149
+ unless preloading is enabled.
150
+
151
+ You can also specify a block to be run before workers are forked, using `before_fork`:
141
152
 
142
153
  ```ruby
143
154
  # config/puma.rb
@@ -146,7 +157,14 @@ before_fork do
146
157
  end
147
158
  ```
148
159
 
149
- Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and `preload_app!` copies the code of master into the workers.
160
+ You can also specify a block to be run after puma is booted using `on_booted`:
161
+
162
+ ```ruby
163
+ # config/puma.rb
164
+ on_booted do
165
+ # configuration here
166
+ end
167
+ ```
150
168
 
151
169
  ### Error handling
152
170
 
@@ -187,15 +205,15 @@ Need a bit of security? Use SSL sockets:
187
205
  ```
188
206
  $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
189
207
  ```
190
- #### Self-signed SSL certificates (via the [`localhost`] gem, for development use):
208
+ #### Self-signed SSL certificates (via the [`localhost`] gem, for development use):
191
209
 
192
- 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.
210
+ 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.
193
211
 
194
212
  Puma automatically configures SSL when the [`localhost`] gem is loaded in a `development` environment:
195
213
 
196
214
  ```ruby
197
215
  # Add the gem to your Gemfile
198
- group(:development) do
216
+ group(:development) do
199
217
  gem 'localhost'
200
218
  end
201
219
 
@@ -261,6 +279,30 @@ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_f
261
279
  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`
262
280
  (see https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_hostflags.html#VERIFICATION-FLAGS).
263
281
 
282
+ #### Controlling OpenSSL Password Decryption
283
+
284
+ To enable runtime decryption of an encrypted SSL key (not available for JRuby), use `key_password_command`:
285
+
286
+ ```
287
+ $ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&key_password_command=/path/to/command.sh'
288
+ ```
289
+
290
+ `key_password_command` must:
291
+
292
+ 1. Be executable by Puma.
293
+ 2. Print the decryption password to stdout.
294
+
295
+ For example:
296
+
297
+ ```shell
298
+ #!/bin/sh
299
+
300
+ echo "this is my password"
301
+ ```
302
+
303
+ `key_password_command` can be used with `key` or `key_pem`. If the key
304
+ is not encrypted, the executable will not be called.
305
+
264
306
  ### Control/Status Server
265
307
 
266
308
  Puma has a built-in status and control app that can be used to query and control Puma.
@@ -336,16 +378,18 @@ end
336
378
 
337
379
  ## Deployment
338
380
 
339
- Puma has support for Capistrano with an [external gem](https://github.com/seuros/capistrano-puma).
381
+ * Puma has support for Capistrano with an [external gem](https://github.com/seuros/capistrano-puma).
382
+
383
+ * 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.
384
+
340
385
 
341
386
  It is common to use process monitors with Puma. Modern process monitors like systemd or rc.d
342
- provide continuous monitoring and restarts for increased
343
- reliability in production environments:
387
+ provide continuous monitoring and restarts for increased reliability in production environments:
344
388
 
345
389
  * [rc.d](docs/jungle/rc.d/README.md)
346
390
  * [systemd](docs/systemd.md)
347
391
 
348
- Community guides:
392
+ Community guides:
349
393
 
350
394
  * [Deploying Puma on OpenBSD using relayd and httpd](https://gist.github.com/anon987654321/4532cf8d6c59c1f43ec8973faa031103)
351
395
 
@@ -355,7 +399,8 @@ Community guides:
355
399
 
356
400
  * [puma-metrics](https://github.com/harmjanblok/puma-metrics) — export Puma metrics to Prometheus
357
401
  * [puma-plugin-statsd](https://github.com/yob/puma-plugin-statsd) — send Puma metrics to statsd
358
- * [puma-plugin-systemd](https://github.com/sj26/puma-plugin-systemd) — deeper integration with systemd for notify, status and watchdog
402
+ * [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.
403
+ * [puma-plugin-telemetry](https://github.com/babbel/puma-plugin-telemetry) - telemetry plugin for Puma offering various targets to publish
359
404
 
360
405
  ### Monitoring
361
406
 
data/bin/puma-wild CHANGED
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  module Puma; end
18
18
 
19
- Puma.const_set("WILD_ARGS", ["-I", inc])
19
+ Puma.const_set(:WILD_ARGS, ["-I", inc])
20
20
 
21
21
  require 'puma/cli'
22
22
 
data/docs/architecture.md CHANGED
@@ -31,10 +31,10 @@ _workers_, and we sometimes call the threads created by Puma's
31
31
  ![https://bit.ly/2zwzhEK](images/puma-connection-flow.png)
32
32
 
33
33
  * Upon startup, Puma listens on a TCP or UNIX socket.
34
- * The backlog of this socket is configured (with a default of 1024). The
35
- backlog determines the size of the queue for unaccepted connections.
36
- Generally, you'll never hit the backlog cap in production. If the backlog is
37
- full, the operating system refuses new connections.
34
+ * The backlog of this socket is configured with a default of 1024, but the
35
+ actual backlog value is capped by the `net.core.somaxconn` sysctl value.
36
+ The backlog determines the size of the queue for unaccepted connections. If
37
+ the backlog is full, the operating system is not accepting new connections.
38
38
  * This socket backlog is distinct from the `backlog` of work as reported by
39
39
  `Puma.stats` or the control server. The backlog that `Puma.stats` refers to
40
40
  represents the number of connections in the process' `todo` set waiting for
@@ -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
- Similar to the `preload_app!` option, the `fork_worker` option allows your application to be initialized only once for copy-on-write memory savings, and it has two additional advantages:
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.