> Date: Sat, 22 Mar 2014 14:24:01 -0400
> Subject: Effects of turning off sendFile in the NIO connector
> From: tomcat.ran...@gmail.com
> To: users@tomcat.apache.org
>
> What effect would setting useSendfile=false have on a web application using
> the NIO connector? I'm asking because I may want to use gzip compression in
> the connector. The docs state:
>
> *"There is a tradeoff between using compression (saving your bandwidth) and
> using the sendfile feature (saving your CPU cycles). If the connector
> supports the sendfile feature, e.g. the NIO connector, using sendfile will
> take precedence over compression. The symptoms will be that static files
> greater that 48 Kb will be sent uncompressed."*
>
> It's trivial that adding compression uses CPU cycles, but does that imply
> that turning sendFile off even without enabling compression would increase
> CPU cycles? It's worth mentioning that the site serves a large (8mg) SWF
> file. I believe that was one of the pluses of NIO/sendFile, that it was
> good with sending large files under heavy traffic?
MG>when you enable sendfile support with request attr
org.apache.tomcat.sendfile.support = true
MG>You will need to set these 3 header attributes
org.apache.tomcat.sendfile.filename: Canonical filename of the file which will
be sent as a String
org.apache.tomcat.sendfile.start: Start offset as a Long
org.apache.tomcat.sendfile.end: End offset as a Long
MG>htitps://tomcat.apache.org/tomcat-6.0-doc/aio.html
MG>Compression:
MG>set compression="on" @ Connector
MG>https://tomcat.apache.org/tomcat-7.0-doc/config/http.html
MG>I did not read that TC cannot use sendfile with any compressed Stream?
MG>can you show us the URL?
MG>Thanks
> We also only really need compression on XML data, the site has minimal
> HTML, SWF's don't really benefit from gzip and some binary data we send
> back and forth is already compressed. I could manually implement
> compression on XML at the application level and within the SWF, if turning
> off sendFile will have negative consequences.
>
> Tomcat 7.0.42
> RHEL6
> ~4T outbound traffic/day
>
> Best,
> John