https://issues.apache.org/bugzilla/show_bug.cgi?id=56513

            Bug ID: 56513
           Summary: Javadoc change for NIO compression and NIO sendfile
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: dev@tomcat.apache.org
          Reporter: mgai...@hotmail.com

In NIO Connector documentation
compression is mentioned
sendfile use is mentioned
but the 2 clearly do not work together in a NIO Connector

https://tomcat.apache.org/tomcat-7.0-doc/aio.html states

    When APR or NIO is enabled, Tomcat supports using sendfile to send large
static files. These writes, as soon as the system load increases, will be
performed asynchronously in the most efficient way. Instead of sending a large
response using blocking writes, it is possible to write content to a static
file, and write it using a sendfile code. A caching valve could take advantage
of this to cache the response data in a file rather than store it in memory.
Sendfile support is available if the request attribute
org.apache.tomcat.sendfile.support is set to Boolean.TRUE.

    Any servlet can instruct Tomcat to perform a sendfile call by setting the
appropriate request attributes. It is also necessary to correctly set the
content length for the response. When using sendfile, it is best to ensure that
neither the request or response have been wrapped, since as the response body
will be sent later by the connector itself, it cannot be filtered. Other than
setting the 3 needed request attributes, the servlet should not send any
response data, but it may use any method which will result in modifying the
response header (like setting cookies).

  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

Needs to state:

NIO works with either sendfile OR compression
NIO with Sendfile:

NIO with Compression:

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#NIO_specific_configuration
states

(with regards to compression)
Note: 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. You can turn off sendfile by setting
useSendfile attribute of the connector, as documented below, or change the
sendfile usage threshold in the configuration of the DefaultServlet in the
default conf/web.xml or in the web.xml of your web application. 

Needs to say:

NIO works with sendfile feature OR compression
NIO with Sendfile:

NIO with Compression:

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to