World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
wrapper.javaio.buffer_size Property

wrapper.javaio.buffer_size

Compatibility :3.5.21
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSX (Not Supported)Linux (Not Supported)IBM AIX (Not Supported)FreeBSD (Not Supported)HP-UX (Not Supported)Solaris (Not Supported)IBM z/OS (Not Supported)IBM z/Linux (Not Supported)

This property controls the size of the buffer used by the pipe between the JVM and Wrapper processes. When the JVM writes console output, the thread attempting to write will block if the pipe ever becomes full. This can lead to performance degradation in applications with lots of output.

All versions of the Wrapper prior to 3.5.21 used the system default buffer size which appears to be about 4KB. This was fine for most applications, however applications with very long lines of console output, or very large quantities of output would experience some performance degradation caused by blocking.

Starting with Wrapper version 3.5.21, the default buffer size was set to 65536 (64KB). The buffer size can be any value between 1024 (1KB) and 10485760 (10MB), a value of "0" (zero) is also valid and will tell the Wrapper to once again use the system default size. The default value will work for most applications and was chosen to avoid wasting too much memory when not needed.

Example:
wrapper.javaio.buffer_size=1048576

Note that there is a lot of overhead by the system to render console log output. This is especially true on Windows. If your application is experiencing performance issues logging large amounts of console output, we recommend either reducing the log output or disabling the console log output by setting the wrapper.console.loglevel property to STATUS.

Another way to improve performance is to increase the interval at which the buffered console output is processed by asking the Wrapper to use a dedicated thread. See the wrapper.javaio.use_thread property for more information.

WARNING

All Java output is sent across into own stdout/stderr pipes to the Wrapper process. If the Wrapper is slow writing to the console or file, then it will also slow down the ability to read output from the Java. If the pipe becomes full because the Wrapper has not read everything then the Java end of the pipe will block trying to write its output. This can have a performance impact on your application, and it is important to be aware of it. Any application will have this problem, including a standalone Java process.

You can alleviate this problem by enabling the wrapper.console.direct property, increasing the size of the pipe buffer with the wrapper.javaio.buffer_size property. It is also possible to completely disable the console output using the wrapper.console.loglevel property.

NOTE

The ability to set the pipe buffer size is currently only possible on Windows. UNIX platforms handle pipe sizes a bit differently. They can be set using ulimit.

Reference: Console