Nginx的上传模块有什么用?

我已经使Nginx上传正常使用Python(Tornado)。 我将上传的文件的path保存在数据库中。

但是,我不知道为什么上传模块必须拆分我的上传,并把它们放到10个不同的文件夹/var/www/.../uploads/0,1,2,3,4,5...9 ? 下面的评论说,这些文件被哈希,模块做什么和为什么这样做?

  # Store files to this directory # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist upload_store /var/www/...uploads 1; 

 # filesystem location where we store uploads # # The second argument is the level of "hashing" that nginx will perform # on the filenames before storing them to the filesystem. I can't find # any documentation online, so as an example, say we were using this # configuration: # # upload_store /tmp/uploads 2 1; # # A file named '43829042' would be written to this path: # # /tmp/uploads/42/0/43829042 # # I hope that's clear enough. The argument is required and must be # greater than 0. You can see the implementation here: # # http://lxr.evanmiller.org/http/source/core/ngx_file.c#L118 

资料来源: http : //bclennox.com/extremely-large-file-uploads-with-nginx-passenger-rails-and-jquery