You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Alex C. (JIRA)" <ji...@apache.org> on 2010/06/16 16:07:23 UTC

[jira] Created: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

2.0.0M6 + 2.0.0RC1: Win7 performance issue
------------------------------------------

                 Key: DIRMINA-790
                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
             Project: MINA
          Issue Type: Bug
    Affects Versions: 2.0.0-RC1, 2.0.0-M6
         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
Ubuntu Linux 64bit mit JRE6U20 64bit
            Reporter: Alex C.
            Priority: Blocker
         Attachments: MINASocketTransfer.zip

Hi there,

I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.

I tried to create an reproducer: 
First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.

Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
If I run the application on WinXP via localhost, it's very fast. <1sec runtime.

If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 

Please find attached the test application.
Just extract and run:

java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server

The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
Java-Source files are included in the MINASocketTransfer.jar ...

I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Alex C. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex C. updated DIRMINA-790:
----------------------------

    Attachment: MINASocketTransfer.zip

The testapplication as mentioned in the description

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M6, 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Priority: Blocker
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRMINA-790:
--------------------------------------

    Fix Version/s:     (was: 2.0.1)
                   2.0.2

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 2.0.2
>
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Alex C. (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881147#action_12881147 ] 

Alex C. commented on DIRMINA-790:
---------------------------------

Tested and analyzed the issue a bit more:

On Win7 and XP:
Java IO uses by default a receive buffer size of 8192 bytes
Same counts for Java NIO.

Testclass for NIO:

----
import java.io.IOException;
import java.net.ServerSocket;
import java.nio.channels.ServerSocketChannel;

public class Test {
    public static void main(String[] args) throws IOException {
        ServerSocketChannel channel = ServerSocketChannel.open();
        channel.configureBlocking(false);
        ServerSocket socket = channel.socket();
        System.out.println(socket.getReceiveBufferSize());
    }
}
----

MINA by default has 1024 configured and overwrites the OS default value:

class NioSocketAcceptor:
----
    protected ServerSocketChannel open(SocketAddress localAddress)
            throws Exception {
        // Creates the listening ServerSocket
        ServerSocketChannel channel = ServerSocketChannel.open();
        
        boolean success = false;
        
        try {
            // This is a non blocking socket channel
            channel.configureBlocking(false);
        
            // Configure the server socket,
            ServerSocket socket = channel.socket();
            
            // Set the reuseAddress flag accordingly with the setting
            socket.setReuseAddress(isReuseAddress());
            
            // XXX: Do we need to provide this property? (I think we need to remove it.)
            socket.setReceiveBufferSize(getSessionConfig().getReceiveBufferSize());
            
            // and bind.
            socket.bind(localAddress, getBacklog());
            
            // Register the channel within the selector for ACCEPT event
            channel.register(selector, SelectionKey.OP_ACCEPT);
            success = true;
        } finally {
            if (!success) {
                close(channel);
            }
        }
        return channel;
    }
----

For WinXP this work, as WinXP can handle a server hat uses a receive buffer size of 1024 quite well.
But as soon the server runs in Win7, there's the issue explained above in the "Description" field. 

If MINA would not set such values by default, the socket would use the system (OS?) default value which would be 8192 on WinXp and Win7 (did not check Vista ... assume that  it's equal to Win7) and the server would run fine, even with Win7.

I suggest that the NioSocketAcceptor does not set any valuue by default, but use the systems default settings for the socket. The SocketSessionCOnfig should reflect the values from the socket, so that the developer can later on ask the config about the current used buffer sizes, even if there was no explicit call to set one.



> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M6, 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Priority: Blocker
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRMINA-790:
--------------------------------------

        Fix Version/s: 2.0.0-RC1
    Affects Version/s:     (was: 2.0.0-M6)

Agreed : no reason to set the default value to 1024.

Will rfix that as soon as I have a working computer.

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 2.0.0-RC1
>
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Alex C. (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881148#action_12881148 ] 

Alex C. commented on DIRMINA-790:
---------------------------------

Ah, forgot to mention: Java IO has the same problem as Java NIO/MINA on Win7 when the receive buffer size is forced to 1024. With 8192 it's not a problem.

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M6, 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Priority: Blocker
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRMINA-790:
--------------------------------------

    Fix Version/s: 2.0.1
                       (was: 2.0.0-RC1)

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 2.0.1
>
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DIRMINA-790) 2.0.0M6 + 2.0.0RC1: Win7 performance issue

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny reassigned DIRMINA-790:
-----------------------------------------

    Assignee: Emmanuel Lecharny

> 2.0.0M6 + 2.0.0RC1: Win7 performance issue
> ------------------------------------------
>
>                 Key: DIRMINA-790
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-790
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-RC1
>         Environment: WinXP SP3 with disabled Firewall + Virusscanner, Win7 64bit with disabled Virusscanner and Firewall, Win7 32bit with absolutely no virusscanner and with disabled firewall, all Systems with 32bit JRE6U20
> Ubuntu Linux 64bit mit JRE6U20 64bit
>            Reporter: Alex C.
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 2.0.0-RC1
>
>         Attachments: MINASocketTransfer.zip
>
>
> Hi there,
> I've written a kind of RMI replacement uses MINA for network communication layer that is also able to transfer files very fast (without reflection and complex serialisation stuff). One of my customers faced a performance problem as soon as the receiving application part is running in Win7.
> I tried to create an reproducer: 
> First I wrote a small test application using Java IO that simply transfers 1.000.000 bytes of random data from a client to a server. That's very fast. It doesn't matter if I try on localhost, or from WinXP->Win7 oder Win7->WinXP. Even Linux->Win7 is fast.
> Then I wrote the same kind of application with mina. No additional codec, nothing complex. I just transfer 100 IoBuffers with 10.000 bytes each from A to B.
> If I run the application on WinXP via localhost, it's very fast. <1sec runtime.
> If I run client and server in Win7, it's f*cking slow. Takes >1min to complete. 
> Please find attached the test application.
> Just extract and run:
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Client <IP or Hostname of Server>
> java -cp MINASocketTransfer.jar;./lib/* minasockettransfer.Server
> The lib folder contains 2.0.0M6 and 2.0.0RC1. To switch from the one to the other version, simple "move" the tailing "_" to exclude the specified lib from classpath.
> Java-Source files are included in the MINASocketTransfer.jar ...
> I tested it with 2.0.0M6 and 2.0.0RC1. It's reproducible with both versions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.