I think GridFS is great as a file storage, specially small files, like
images.
My only concern is about get files fast from it without compromise the
server.
Imagine a gallery page with, for example, 40 images.
Each image will be a request to a script in the server, like:
<img src="getimage.php?id=123456" />
The script must do a connection to Mongo and output the binary stream.
Now multiply this by the number of concurrent users.
How much RAM will be used in this case?
How fast is that compared to images served directly from the
filesystem by a web server?
On Jun 14, 12:19 am, Min <
mini...@gmail.com> wrote:
> I'm heavily using the GridFS to store files as a distribute file storage. It
> works excellent.
> But it doesn't mean it is a silver bullet as a distribute file storage.
>
> IMHO, storing files to GridFS and accessing the files through multiple web
> servers could be good approach. Also to boost performance, a http cache
> could reduce accessing to mongodb every time.
> I've also tested nginx-gridfs, its a inspiring project. I don't know how big
> files your service should support. For small files, it will work very well
> but would have poor performance for bigger files.
> Nginx is asynchronous server and nginx-gridfs uses blocking mongoding
> C-library. If it is not re-written with Nginx upstream or a similar way, it
> might have a concurrency issue at higher requests.
>
> Thanks
>
> 2011/6/14 Andrew Armstrong <
phpla...@gmail.com>
>
>
>
>
>
>
>
> > A problem with having a distributed file system (instead of just using
> > built-in mongo sharding/replication) is that you can only have the one
> > physical server serving requests (concurrent access to the same files
> > isn't allowed).
>
> > That means you will sometime reach a limit as to what a single server
> > can handle (# of requests/sec etc) at which point you can't do
> > anything about it.
>
> > Using sharding/replication fixes this problem by letting you have
> > independent machines and isolating points of failure.
>
> > On Jun 14, 11:05 am, EdemilsonLima <
puls...@gmail.com> wrote:
> > > I was thinking about this. Maybe using MongoDB on top of a distributed
> > > file system will not work if we want to run multiple daemons over the
> > > same database, because of file locking. The best feature of MongoDB is
> > > to run paralell queries over many nodes. We can't give up of this! :)
>
> > > About storing files in MongoDB I am not sure about using it for
> > > images, since is much faster to Apache load images directly from the
> > > file system than run a script to get each image. Think about a gallery
> > > page for example, the overhead it could cause (well, we still have
> > > options like cache or Ngix plugin for GridFS). For other types of
> > > files (i.e. downloadable files) I think is much better to store it in
> > > the database.
>
> > > About moving the session to MongoDB I saw some performance tests
> > athttps://
github.com/mostlygeek/MongoSessionthatMongoDB performs very