There are different issues with streaming. web2py supportes https streaming, if modified since, and range requests. This means that if the client is smart enough it will cache previously downloaded data and will request data in chunks (range requests) which will then be streamed by the server.
Server side this is robust but there are things that can go wrong. If the client makes a request, does not stream in data, but does not close the connection, the web2py thread is wasted/idle until killed by the web server. You have some parameters you can play with (min/max number of threads, time before they get killed, response.stream(chunk_size=...)). With an async server (like node.js) you do not have to worry about loss of resources when a connection is open and the client is idle. Massimo On Sunday, 30 December 2012 14:32:44 UTC-6, Magnitus wrote: > > I am currently in the process of writing a netflix/youtube-like app that > allows you stream movies on your local LAN (eventually, perhaps over the > internet even, but that is not an immediate priority, especially given my > limited data transfer allowance by my ISP) using a web interface. > > I am writing this mostly for personal use as a spare time project, but > intent to release the code over some Creative Commons when done. > > However, I encountered a massive roadblock with Web2py. Streaming large > video files (over 1GB) is painfully slow (sometimes, the movie doesn't load > at all and either way, the framework doesn't recover from attempting to > stream such a file in a graceful manner when the user aborts by clicking > back in the browser window). > > At this point, I'm not sure if it's because of the Framework itself or the > underlying server. > > I tried with both Rocket and Tornado to no avail. I was tempted to try > with Apache, but then thought that if I wanted to make the app available > for regular Joes to use, that might not be the most user-friendly way to > distribute it. > > I tried with various client-side technologies (in-browser video with > html5, VLC plugin, embeded DivX player, embedded WMP) to no avail. > > Then, just for kicks, I picked up a Node.js introductory book (Learning > Node by O'Reilly) which I'm in the process of reading and tried their > streaming example with a large video file and it worked a lot better. > > At this point, I'm tempted to use web2py for most of the app, but delegate > video streaming to node (they can communicate via the database and/or > sockets). > > Am I crazy or does my idea make sense? > --