-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Repo steps:
- Create a rack server like this:
require 'rubygems'
require 'rack'
gem 'puma'
require 'rack/handler/puma'
handler = ->(env) do
p env['rack.input']
[200, {"Content-Type" => "text/html"}, ["Hello Rack!"]]
end
Rack::Handler::Puma.run handler, :Port => 9292- POST a 200MB file to the server via curl:
dd if=/dev/urandom of=/tmp/bigfile bs=102400 count=2048
curl -X POST http://0.0.0.0:9292 -F file=@/tmp/bigfile
Hello Rack!- On server output, we can see the path of the tempfile:
Puma 2.11.2 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:9292
#<Tempfile:/var/folders/_p/ptzpwxgx6tg8dpb6w08l8t6j_tvbyv/T/puma20150420-43557-1uogav6>
- Don't shutdown the server, Just print the size of the tempfile:
du -sh /var/folders/_p/ptzpwxgx6tg8dpb6w08l8t6j_tvbyv/T/puma20150420-43557-1uogav6
200M /var/folders/_p/ptzpwxgx6tg8dpb6w08l8t6j_tvbyv/T/puma20150420-43557-1uogav6As you can see, if we don't shutdown the server, even the request is handled, the tempfile is still existed and occupy the disk space, which could cause the no disk space issue.
Metadata
Metadata
Assignees
Labels
No labels