FWIW, the wsgi.file_wrapper extension of WSGI is also very easily inadvertanyly defeated by a WSGI application stack and made useless. I have now added documentation about wsgi.file_wrapper at:
http://code.google.com/p/modwsgi/wiki/FileWrapperExtension and made brief mention of this. I have been intending to blog about the many ways that wsgi.file_wrapper is useless but just haven't got around to it. Now that I have added that documentation, maybe I will get around to writing the blog post and expanding on what the problems are. Graham On 28 March 2010 23:24, Graham Dumpleton <[email protected]> wrote: > All I can tell you at this point is that at the time it wasn't working > in the version of Ubuntu being used for testing. This may have been > due to older Linux kernel being used, or some other reason. I would > need to investigate further before can comment. > > Graham > > On 28 March 2010 22:56, Osi <[email protected]> wrote: >> I want to use mod_wsgi 3.1 /Apache 2.2 on a Linux machine to serve >> static files with the sendfile() system call. >> I've successfuly installed mod_xsendfile into apache and tested it in >> embedded mode. >> My next step is to use it in daemon mode. >> >> However, I see in the mod_wsgi.c source attached that sendfile() with >> mod_wsgi is not supported for daemon mode >> http://code.google.com/p/modwsgi/source/browse/trunk/mod_wsgi/mod_wsgi.c?spec=svn1546&r=1546 >> line 3658 >> /* >> * On some platforms, such as Linux, sendfile() system call >> * will not work on UNIX sockets. Thus when using daemon mode >> * cannot enable that feature. >> */ >> >> if (!wsgi_daemon_pool) >> apr_os_file_put(&tmpfile, &fd, APR_SENDFILE_ENABLED, self->r- >>>pool); >> else >> apr_os_file_put(&tmpfile, &fd, 0, self->r->pool); >> >> I tried using it anyway in daemon mode jsut to see what happens. >> I ran a simple sendfile test for large files (100MB) to a remote >> machine, both in embedded and daemon mode, and the results were very >> similar, indicating that the sendfile() sub-system actually worked in >> daemon mode. >> Obviuosly I ran tests beforehand for sending these files without using >> sendfiles() that resulted in siginifacntly slower transfer rates. So I >> think I can rule out the option of sendfile() not functioning at all >> for some reason. >> >> I should also mention that when running in daemon mode I switched on >> the WSGIRestrictEmbedded directive in my httpd.conf file, and also >> flushed all filesystem caches before every test, just in case. >> >> Does anyone have any idea how to find out whether sendfile() is >> actually working, >> or verify that sendfile() indeed does NOT work in deamon mode, and >> provide some alternative explanation for my results? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
