How to bottle return binaries

I want to make a bottlepython web service to serve binary files like pdf, picture and exe with authentication.

Can I use all of these files with a bottle? I find it difficult to find a tutorial for this.

How about performance? Does a boot python handle hundreds of thousands of downloads at once?

I plan to use it with nginx uwsgi.

+5
source share
2 answers

You can definitely serve these files with a bottle. You just serve them as static files. As for authentication, I don't think the bottle comes with authentication support (as far as I know). When it comes to performance, this is an area where it really depends on how you deploy it. In a normal multi-threaded environment, where each request receives its own regular flow , I doubt very much that your server will be able to comfortably serve hundreds of thousands of requests at the same time. However, the documentation notes that it greenletsmay allow you to overcome this problem.

Resources:

Buffering Static Files: http://bottlepy.org/docs/dev/tutorial.html#routing-static-files

: http://bottlepy.org/docs/dev/async.html#greenlets-to-the-rescue

+2

, uWSGI 1.9 ( , 10 ) offload-threads = n ( ), , , ( ), , . 1.4, , 1.9

+1

All Articles