thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-4494) Increase Java Socket Buffer Size
Date Tue, 13 Feb 2018 16:08:00 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-4494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16362559#comment-16362559
] 

BELUGA BEHR commented on THRIFT-4494:
-------------------------------------

Here, the buffer is hard-coded to 8192 (which matches the default value on most JDK implementations).
 You may wish to remove this magic number and let the JDK decide the size.

https://github.com/apache/thrift/blob/19baeefd8c38d62085891d7956349601f79448b3/lib/java/src/org/apache/thrift/transport/TFileTransport.java#L369

> Increase Java Socket Buffer Size
> --------------------------------
>
>                 Key: THRIFT-4494
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4494
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>    Affects Versions: 0.11.0
>            Reporter: BELUGA BEHR
>            Priority: Minor
>
> {code:title=TSocket.java}
>   if (isOpen()) {
>       try {
>         inputStream_ = new BufferedInputStream(socket_.getInputStream(), 1024);
>         outputStream_ = new BufferedOutputStream(socket_.getOutputStream(), 1024);
>       } catch (IOException iox) {
>         close();
>         throw new TTransportException(TTransportException.NOT_OPEN, iox);
>       }
>     }
> {code}
> The 1024 buffer size is pretty narrow, especially for modern servers with TCP/IP send
and receive buffers ranging from 16K to 64K.  Please remove these hard coded values and rely
on the underlying JVM default buffer sizes: 8Kib on most implementations.
> https://github.com/apache/thrift/blob/19baeefd8c38d62085891d7956349601f79448b3/lib/java/src/org/apache/thrift/transport/TSocket.java



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message