ahoward/mongoid-grid_fs — pull request #3 by johnbintz (2012-10-18 18:20:15+00:00)
Title: Match 10gen driver's chunk size

I was having an issue when uploading very large files, multi-megabyte files via Carrierwave, where the connection to the server would simply quit. I noticed the chunk size being sent was extremely large, on the order of hundreds of megabytes. Since I also send GridFS IO objects directly as Rack responses to be delivered incrementally using Thin, this large chunk size wouldn't work well either for reading or writing. 10gen's driver sets the chunk size to 256 * 1024 bytes, which, when I was using their driver, performed quite well when both reading and writing. I changed the chunk size in `mongoid-grid_fs` and extracted it out into a constant so it's more visible in the code, and I got the tests working again to ensure the change didn't break anything.