On Wednesday, March 4, 2015 at 6:55:36 AM UTC-5, Michael Kliewe wrote:
>
> Hi there,
>  
> I'm trying to improve the performance of my WebDAV server, and I noticed a 
> problem when downloading big files.
>  
> I have an nginx as reverse proxy in front of an Apache, on which SabreDAV 
> runs.
>  
> In SabreDAV I have my App_DAV_File class:
>  
> public function get()
> {
>     return fopen($this->getInternalPhysicalPath($this->myPath), 'r');
> }
>  
> This is working fine, but it seems that Apache will send the whole 800 MB 
> file to nginx, and nginx starts to send the file to the client. But it 
> takes a bit (5-10 seconds) until nginx serves the file, and I guess the 
> problem is that the 800 MB have to be read by apache, sent to the nginx, 
> which saves the file to local harddisc. It also adds 800 MB of internal 
> network traffic, from Apache to nginx.
>  
> I would like to improve that, and use nginx' feature X-Accel-Redirect. 
> Apache should just send the local file path to nginx, and then nginx serves 
> the file. Then there is no 800 MB internal traffic, and I guess the 
> download starts faster.
> http://wiki.nginx.org/X-accel
>  
> How can I do this? I cannot set this HTTP-Header in my App_DAV_File class 
> as far as I can see.
> And then I have to check if range-Requests still work correctly if I use 
> X-Accel-Redirect…
>  
> I'm still running SabreDAV 1.3.4 ;-/ But the same "problem" exists in the 
> current version as far as I can see.
>  
> (I'm planning to upgrade to 2.0/2.1, it seems to be pretty stable today, 
> but it's a huge step and much work)
>

There's a 1.3.4 version? Did you mean 1.3.0? That's way old though, oh my. 
Also has lots of security bugs so I hope you're not using it in production.

Regardless, take a look at this ticket:

https://github.com/fruux/sabre-dav/issues/120

It talks about X-SendFile, but X-Accel-Redirect is similar. The main point 
is that you are trying to implement this all in a node, where a node should 
only really be responsible for sharing information about itself.
A separate plugin should take that information and implement the 
appropriate behavior.

That's why that branch as a node with a getPhysicalPath function, similar 
to yours:

https://github.com/fruux/sabre-dav/blob/sendfile/lib/Sabre/DAV/IPhysicalFile.php

But has a separate plugin that implements the related behavior:

https://github.com/fruux/sabre-dav/blob/sendfile/lib/Sabre/DAV/XSendFile/Plugin.php#L30

Evert

-- 
You received this message because you are subscribed to the Google Groups 
"SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sabredav-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sabredav-discuss/c310eff1-1792-461d-a211-8612165589c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to