-
30. Re: Strange netty error when sending a lot of messages
timfox Oct 15, 2009 6:13 AM (in response to rnicholson10)"MrEasy" wrote:
I'm going into the same direction as thammoud.
Even if you would create one connection per send, this should not result in a problem.
Actually, I don't think that is correct.
As part of the TCP protocol, a TCP connection goes into the TIMED_WAIT state for a while after it has been closed by the user.
While in the TIMED_WAIT state the connection is still alive in the eyes of the operating system, so if you create and close a lot of TCP connections in quick succession you could reach the max allowable connections limit for your OS.
You could alleviate this somewhat by tuning the amount of time connections remain in the TIMED_WAIT state (default is a minute or two on most operating systems), but the bottom line is we cannot guarantee you won't hit the max connection limit, this is not the fault of HornetQ or Netty, it's just the way the TCP protocol works - summary: don't create so many connections: it's bad on several different levels.
Here's a good explanation of TIMED_WAIT:
http://www.developerweb.net/forum/showthread.php?t=2941 -
31. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 16, 2009 3:11 PM (in response to rnicholson10)Jira added for this issue:
Messages never being ACKed when using a core bridge and paging
https://jira.jboss.org/jira/browse/HORNETQ-182 -
32. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 16, 2009 3:12 PM (in response to rnicholson10)Example based on the bridge example also supplied to demonstrate the problem.
-
33. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 16, 2009 10:53 PM (in response to rnicholson10)I added this comment to the JIRA. Adding it here also for your convenience:
When using pageSize that small, you also need to make your WindowSize small.
In your case, you have ACK Batch Size = 1Mib, while page size / maxPageSize = 10K.
That means.. nothing is being actually ACKed and because of that, everything is staying where it is supposed to be (i.e. the paging system). What makes this a non issue.
I won't close this issue right now, as I will give you a few days to prove me I'm wrong. Otherwise I will close it next week. -
34. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 17, 2009 12:59 AM (in response to rnicholson10)Just fixing the terminology. I was referring to the ackBatchSize.
-
35. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 19, 2009 11:54 AM (in response to rnicholson10)Am I looking in the wrong place?
I can't find ackBatchSize anywhere in the manual.
How do I set this value? -
36. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 19, 2009 2:05 PM (in response to rnicholson10)I thought you were using the core API. That's defined at ClientSessionFactoryImpl.
You just need to ACK every message you receive immediately in your example. any message not ACKed will hold paging from working. -
37. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 20, 2009 7:20 AM (in response to rnicholson10)Now I'm getting more confused. If my session mode is AUTO_ACKNOWLEDGE I don't have the option of acknowledging do I?
Secondly, in a J2EE environment this is definitely not possible.
I think this is the bug I'm seeing. Messages are never ACKed, therefore pages can never be loaded into memory.
If acknowledgements must be sent immediately, then the only mode this will work with is CLIENT_ACKNOWLEDGE, which is not allowed to be used in an MDB. We only have the choice of AUTO_ACKNOWLEDGE and DUPS_OK_ACKNOWLEDGE in a bean. -
38. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 20, 2009 7:55 AM (in response to rnicholson10)In a J2EE environment, how do I set AckBatchSize?
I would like to set it to 1 so every ACK is sent immediately once a messsage is received in an MDB. -
39. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 20, 2009 2:01 PM (in response to rnicholson10)That's different from the core. That's encapsulated on the JMS Layer. for Dups OK, you define the DupsOKBatchSize.
For transactions, and other stuff you don't have how to do that on JMS Semantics.
That's why I keep saying your example is broken. It's not possible to use a 10K MAXSize on an Address. Anything in the memory will make you starve for more messages. (Memory full, waiting the ACK to be received). That's actually documented on the paging chapter. -
40. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 20, 2009 2:12 PM (in response to rnicholson10)Ok,
But we are seeing that messages sent to a JMS MDB where paging is used will always block once the memory is full.
Regardless of whether we use AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE. I will rewrite the example to show this using more reasonable sizes for memory queue size and paging size.
Would you agree that an in memory queue size of 2 MiB and a paging size of 1 MiB should work correctly?
Cheers,
R. -
41. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 20, 2009 2:14 PM (in response to rnicholson10)Would you agree that an in memory queue size of 2 MiB and a paging size of 1 MiB should work correctly?
As long as you ACK properly, yes. -
42. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 20, 2009 2:20 PM (in response to rnicholson10)Yes, this is the quandry.
It's the JMS layer that will be doing the ACKing, correct?
We can't call message.acknowledge(), it results in an exception. So how can I guarantee that a message will be acknowledged? -
43. Re: Strange netty error when sending a lot of messages
clebert.suconic Oct 20, 2009 2:21 PM (in response to rnicholson10)Also, keep the DupsOKBatchSize shorter than what would fit in memory.
-
44. Re: Strange netty error when sending a lot of messages
rnicholson10 Oct 20, 2009 2:24 PM (in response to rnicholson10)Is DupsOKBatchSize also used for AUTO_ACKNOWLEDGE?