On Wed, Jan 6, 2010 at 10:42 PM, Satish Kaveti <satish.kav...@sick.com> wrote:
> I have a FtpServer application in which images to transferred from the
> client. The client is sending roughly 3 images per second. Each image is
> roughly 300 kbytes long. For some reason the server is not able to keep up
> with the incoming images. Looking at the sniffer output, it seems that
> there  is a delay of roughly 200 ms in sending '226 - Transfer complete'
> reply after completing the image transfer.

I think we need some more details. What do you mean by the client
sending 3 images per second? A session in FtpServer is
"single-threaded" in that a file transfer will block the control
socket. Thus, you can not send more than the server can handle.

The delay your seeing, how do you detect it?

What OS are you on? What JVM version?

> Do I need to enable / disable TCP_NODELAY ? If so, how do I enable /
> disable TCP_NODELAY.

We do not currently provide a configuration for it, But, you can patch
the source code yourself. Please let us know the results.

Index: src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
===================================================================
--- src/main/java/org/apache/ftpserver/listener/nio/NioListener.java    
(revision
835894)
+++ src/main/java/org/apache/ftpserver/listener/nio/NioListener.java    (working
copy)
@@ -136,7 +136,8 @@
             // Decrease the default receiver buffer size
             ((SocketSessionConfig) acceptor.getSessionConfig())
                     .setReceiveBufferSize(512);
-
+            acceptor.getSessionConfig().setTcpNoDelay(true);
+
             MdcInjectionFilter mdcFilter = new MdcInjectionFilter();

             acceptor.getFilterChain().addLast("mdcFilter", mdcFilter);

/niklas

Reply via email to