pitchfork 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pitchfork might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +5 -1
- data/LICENSE +2 -3
- data/README.md +12 -3
- data/benchmark/README.md +32 -0
- data/benchmark/cow_benchmark.rb +17 -0
- data/examples/constant_caches.ru +1 -1
- data/examples/pitchfork.conf.minimal.rb +1 -1
- data/ext/pitchfork_http/extconf.rb +1 -1
- data/lib/pitchfork/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c060e231677f29e29d84ea24a0d3bad9f8a34b8474245530bc229b4c64abd89
|
4
|
+
data.tar.gz: 3c0f01f68d4abacc0f6fc1898937f4f614291ea59e716c3e9423f1919dd70607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca437b006db57240a9cacb91c365894741c340a351bc3770b3e131e2789712cac6e00c029596f45f2ee6fc2b68bd3464bd3af2450a889a4d105a816c5fdc2a5
|
7
|
+
data.tar.gz: 49ac19bfe8caa4b62d513a65ba1103a9610ec8034170636420a6bb93edd99c48e07f0436771a2fa73c9f67181e0f69a28bb6f7bea37519631445ebe00e6470f2
|
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pitchfork (0.1.
|
4
|
+
pitchfork (0.1.1)
|
5
5
|
rack (>= 2.0)
|
6
6
|
raindrops (~> 0.7)
|
7
7
|
|
@@ -9,6 +9,9 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
minitest (5.16.3)
|
12
|
+
nio4r (2.5.8)
|
13
|
+
puma (5.6.5)
|
14
|
+
nio4r (~> 2.0)
|
12
15
|
rack (3.0.0)
|
13
16
|
raindrops (0.20.0)
|
14
17
|
rake (13.0.6)
|
@@ -23,6 +26,7 @@ PLATFORMS
|
|
23
26
|
DEPENDENCIES
|
24
27
|
minitest
|
25
28
|
pitchfork!
|
29
|
+
puma
|
26
30
|
rake
|
27
31
|
rake-compiler
|
28
32
|
|
data/LICENSE
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
|
1
|
+
Pitchfork is copyrighted free software by all contributors, see logs in
|
2
2
|
revision control for names and email addresses of all of them.
|
3
3
|
|
4
4
|
You can redistribute it and/or modify it under either the terms of the
|
5
5
|
GNU General Public License (GPL) as published by the Free Software
|
6
6
|
Foundation (FSF), either version 2 of the License, or (at your option)
|
7
|
-
any later version.
|
8
|
-
derivative works, but the GPLv2 is fine.
|
7
|
+
any later version.
|
9
8
|
|
10
9
|
The complete texts of the GPLv2 and GPLv3 are below:
|
11
10
|
GPLv2 - https://www.gnu.org/licenses/gpl-2.0.txt
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
`pitchfork` is a preforking HTTP server for Rack applications designed
|
4
4
|
to minimize memory usage by maximizing Copy-on-Write performance.
|
5
5
|
|
6
|
-
Like [`unicorn`](https://yhbt.net/unicorn/README.html) (which `pitchfork` is a derivative
|
6
|
+
Like [`unicorn`](https://yhbt.net/unicorn/README.html) (of which `pitchfork` is a derivative), it is designed to
|
7
7
|
only serve fast clients on low-latency, high-bandwidth connections and take
|
8
8
|
advantage of features in Unix/Unix-like kernels. Slow clients should
|
9
9
|
only be served by placing a reverse proxy capable of fully buffering
|
@@ -99,6 +99,16 @@ compatibility with existing applications.
|
|
99
99
|
Most command-line options for other Rack applications (above) are also
|
100
100
|
supported. Run `pitchfork -h` to see command-line options.
|
101
101
|
|
102
|
+
## Relation to Unicorn
|
103
|
+
|
104
|
+
Pitchfork initially started as a Unicorn patch, however some of Unicorn features
|
105
|
+
as well as Unicorn policy of supporting extremely old Ruby version made it challenging.
|
106
|
+
|
107
|
+
Forking was the occasion to significantly reduce the complexity.
|
108
|
+
|
109
|
+
However some large parts of Pitchfork like the HTTP parser are still mostly unchanged from Unicorn, and Unicorn
|
110
|
+
is fairly stable these days. As such we aim to backport any Unicorn patches that may apply to Pitchfork and vice versa.
|
111
|
+
|
102
112
|
## License
|
103
113
|
|
104
114
|
pitchfork is copyright 2022 Shopify Inc and all contributors.
|
@@ -108,8 +118,7 @@ Unicorn is copyright 2009-2018 by all contributors (see logs in git).
|
|
108
118
|
It is based on Mongrel 1.1.5.
|
109
119
|
Mongrel is copyright 2007 Zed A. Shaw and contributors.
|
110
120
|
|
111
|
-
pitchfork is licensed under
|
112
|
-
(GPLv3+ preferred), or Ruby (1.8)-specific terms.
|
121
|
+
pitchfork is licensed under the GPLv2 or later or Ruby (1.8)-specific terms.
|
113
122
|
See the included LICENSE file for details.
|
114
123
|
|
115
124
|
## Thanks
|
data/benchmark/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Benchmarks
|
2
|
+
|
3
|
+
## Copy on Write Efficiency
|
4
|
+
|
5
|
+
This benchmark aimed to compare real memory usage of differnet servers.
|
6
|
+
|
7
|
+
For instance, Puma 2 workers + 2 threads:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
$ PORT=9292 bundle exec benchmark/cow_benchmark.rb puma -w 2 -t 2 --preload
|
11
|
+
Booting server...
|
12
|
+
Warming the app with ab...
|
13
|
+
Memory Usage:
|
14
|
+
Single Worker Memory Usage: 207.5 MiB
|
15
|
+
Total Cluster Memory Usage: 601.6 MiB
|
16
|
+
```
|
17
|
+
|
18
|
+
Pitchfork 4 workers:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
$ PORT=8080 bundle exec benchmark/cow_benchmark.rb pitchfork -c examples/pitchfork.conf.minimal.rb
|
22
|
+
Booting server...
|
23
|
+
Warming the app with ab...
|
24
|
+
Memory Usage:
|
25
|
+
Single Worker Memory Usage: 62.6 MiB
|
26
|
+
Total Cluster Memory Usage: 320.3 MiB
|
27
|
+
```
|
28
|
+
|
29
|
+
The `constant_caches.ru` application is specifically crafted to demonstrate how shared memory regions
|
30
|
+
get invalidated as applications execute more and more code.
|
31
|
+
|
32
|
+
It is an extreme example for benchmark purposes.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "net/http"
|
3
|
+
|
4
|
+
app_path = File.expand_path('../examples/constant_caches.ru', __dir__)
|
5
|
+
|
6
|
+
puts "Booting server..."
|
7
|
+
pid = Process.spawn(*ARGV, app_path, out: File::NULL, err: File::NULL)
|
8
|
+
sleep 5
|
9
|
+
app_url = "http://localhost:#{ENV.fetch('PORT')}/"
|
10
|
+
puts "Warming the app with ab..."
|
11
|
+
system("ab", "-c", "4", "-n", "500", app_url, out: File::NULL, err: File::NULL)
|
12
|
+
sleep 3
|
13
|
+
puts "Memory Usage:"
|
14
|
+
puts Net::HTTP.get(URI(app_url))
|
15
|
+
|
16
|
+
Process.kill("TERM", pid)
|
17
|
+
Process.wait
|
data/examples/constant_caches.ru
CHANGED
data/lib/pitchfork/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pitchfork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: raindrops
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- ".gitattributes"
|
54
54
|
- ".github/workflows/ci.yml"
|
55
55
|
- ".gitignore"
|
56
|
+
- CHANGELOG.md
|
56
57
|
- COPYING
|
57
58
|
- Dockerfile
|
58
59
|
- Gemfile
|
@@ -60,6 +61,8 @@ files:
|
|
60
61
|
- LICENSE
|
61
62
|
- README.md
|
62
63
|
- Rakefile
|
64
|
+
- benchmark/README.md
|
65
|
+
- benchmark/cow_benchmark.rb
|
63
66
|
- docs/Application_Timeouts.md
|
64
67
|
- docs/CONFIGURATION.md
|
65
68
|
- docs/DESIGN.md
|