[Flask] REST based File Sharing server Implementation in Flask ub at artfacts.net

G.S.Vijay Raajaa gsvijayraajaa at gmail.com
Sun Jun 25 13:31:45 EDT 2017


The number of non-block servings will correspond to the max number of
workers in that case? Hypothetically if one user uploads multiple
files that keeps all the workers busy, I am blocked when rest of the
users online trying to upload files. Any thoughts to delegate it
asynchronously?

Regards,

Vijay Raajaa GS

On 25.06.2017 18:43, G.S.Vijay Raajaa wrote:

>* Hi UB,
*> >* Thanks for the idea. I shall probe more into the same. But I have quick
*>* clarifications, even with mongo/gridfs and having the connectionI/O
*>* delegated to the database driver makes the transaction blocking? Kindly
*>* correct me if I am wrong. Is there a async way of handling the upload to
*>* mongo and keep flask serve other incoming request?
*well, there will be workers. if you deploy your app in uwsgi or gunicorn,
you set the number of workers in you config. these will then handle
requests (more or less) indepently.
pymongo will have a connection pool to also handle multiple connections. [2]


>* On the same note, w.r.t mongodb-gridFS, how do you think the write
*>* performance is when compared to storing them directly on the filesystem,
*>* same w.r.t to read for serving?
*i guess here's the bad news. it might be slower than writing directly to
the file system, but it might be better when you have app and storage
separated and need to write your files over the network. but you need to
consult benchmarks to be sure.

>* I like to idea of scalability when you have file store within DB.
*i think here's the upside. also seems, mongodb can help you to store and
organize 8search) file metadata. if that is a concern at all.

[2]http://api.mongodb.com/python/current/faq.html#how-does-connection-pooling-work-in-pymongo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170625/10e1c664/attachment.html>


More information about the Flask mailing list