External component can not work when wildfire using nonblocking mode

Hi,

I am using whack as external component library and it works well when wildfire 3.0 is under blocking mode. But when nonblocking the component throw exception :

org.xmpp.component.ComponentException: java.net.SocketException: Software caused connection abort: recv failed

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:212)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:174)

at org.jivesoftware.weather.ExternalWeatherComponent.main(ExternalWeatherComponent .java:30)

Caused by: java.net.SocketException: Software caused connection abort: recv failed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:129)

at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)

at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)

at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)

at java.io.InputStreamReader.read(InputStreamReader.java:167)

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2971)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

at org.xmlpull.mxp1.MXParser.nextToken(MXParser.java:1100)

at org.dom4j.io.XPPPacketReader.parseDocument(XPPPacketReader.java:268)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:184)

… 2 more

org.xmpp.component.ComponentException: java.net.SocketException: Software caused connection abort: recv failed

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:212)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:174)

at org.jivesoftware.weather.ExternalWeatherComponent.main(ExternalWeatherComponent .java:30)

Caused by: java.net.SocketException: Software caused connection abort: recv failed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:129)

at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)

at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)

at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)

at java.io.InputStreamReader.read(InputStreamReader.java:167)

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2971)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

at org.xmlpull.mxp1.MXParser.nextToken(MXParser.java:1100)

at org.dom4j.io.XPPPacketReader.parseDocument(XPPPacketReader.java:268)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:184)

… 2 more

How to get the external component work? Any suggestion is welcomed:)

Thank you

Regards

He Qi

Hey He Qi,

Non-blocking mode is still in experimental status and not ready for production. We are planning to work on it soon though. Meanwhile your best bet for scalability would be to use Connection Managers. People running some stress tests are getting really good results. Which is the load you are expecting to get?

Regards,

– Gato

Hi Gato,

I want a server with 4GB memory to carry over 4000 connections. Could connection manager make it?

I wonder if the connection manager could use nonblocking mode. Could you tell me?

Thanks.

Cheers

He Qi

Hey He Qi,

Wildfire and Connection Managers share the same code (regarding socket/session management). That means that non-blocking code is the same in both parts thus have the same status: experimental. However, since CMs do a lot less work compared to Wildfire it has been tested that they can handle 15K client connections per JVM (or perhaps even more). To get 15K connections per JVM (in the CM) you will need to increase the max heap size and reduce the stack trace size.

Regards,

– Gato

Hello,

I have successfully connected 4000 users with a server with 2Gb even without CMs.

You should not have any problem.

If you have any question or need information about the configuration I used, I can try to help you

Rgds

Pascal

Hi pascal :

Thank you for response. Do you set the reading mode to nonblocking? Or how could you get 4000 connections?

Regards

He Qi

Hi, In fact I did not set non blocking mode, I used the standard way.

I made some similar tests on connection manager and reached 15000 connections.

Observations that can help:

Share the memory between Java and Native OS. For example with 4Gb set -Xmx and -Xms to 2Gb and let 2Gb to native threads.

I also played with -Xss value to reduce the java thread stack size and was able to manage more threads safely. I set it to 80K but you can probably set 128K. However I did not have to tune the Xss parameter to reach 4000 users. That becomes useful around 10K.

Hey Gato,

The XMLLightweightParser does not seem to work when the packet is like this:

or in other words it is

When will nonblocking get ready for production? I have managed the external component work but the xmllightweightparser does not work. Could you help me?

Thank you

Rgds

He Qi

Hi pascal:

Thanks for telling me the configurations. I’'ll try it

Cheers

He Qi