From 4c1f1924271dc828bb5eb22461b2b02390b11f6f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 3 Sep 2008 15:24:13 -0700 Subject: [PATCH] HTTPFile: more reasonable chunk size for big files 16M for a chunk is a huge amount of memory to slurp at once. 64K is much more reasonable and chunk sizes above this lead to dimishing returns in performance. --- lib/mogilefs/httpfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mogilefs/httpfile.rb b/lib/mogilefs/httpfile.rb index acfd1e0..636833e 100644 --- a/lib/mogilefs/httpfile.rb +++ b/lib/mogilefs/httpfile.rb @@ -88,7 +88,7 @@ class MogileFS::HTTPFile < StringIO file_size = File.size(@bigfile) @socket.write "PUT #{@path.request_uri} HTTP/1.0\r\nContent-Length: #{file_size}\r\n\r\n" while not fp.eof? - chunk = fp.read 16384000 + chunk = fp.read 0x10000 @socket.write chunk end fp.close -- 2.11.4.GIT