[JBoss JIRA] (WFLY-9524) Messaging - default max client threads
by David Lloyd (JIRA)
[ https://issues.jboss.org/browse/WFLY-9524?page=com.atlassian.jira.plugin.... ]
David Lloyd commented on WFLY-9524:
-----------------------------------
With VMs/taskset/cgroups/etc. it is possible (and common) to have one (logical) CPU.
> Messaging - default max client threads
> --------------------------------------
>
> Key: WFLY-9524
> URL: https://issues.jboss.org/browse/WFLY-9524
> Project: WildFly
> Issue Type: Enhancement
> Components: JMS
> Affects Versions: 11.0.0.Final
> Reporter: Martin Styk
> Assignee: Jeff Mesnil
>
> By default, size of client thread pool is configured as 8 * number of CPU cores.
> On 1 CPU machine, with default configuration and MDB deployed on server, resource starvation is possible
> On one CPU there are by default
> * 8 ActiveMQ client threads (8 * CPU count)
> * 4 MDB instances (mdb-strict-max-pool = 4 * CPU count)
> * 15 JCA RA sessions consuming messages from queue (default value of maxSession)
> Consuming of messages by MDB gets stuck because all 8 client threads are awaiting large message completion and there is no other thread to handle other tasks.
> {code:title=Client thread waiting for large message completion}
> "Thread-7 (ActiveMQ-client-global-threads)" #475 daemon prio=5 os_prio=0
> tid=0x000000000590f000 nid=0x7c7a in Object.wait() [0x00007fda43413000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.waitCompletion(LargeMessageControllerImpl.java:302)
> - locked <0x00000000b0083e88> (a
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl)
> at
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.saveBuffer(LargeMessageControllerImpl.java:276)
> - locked <0x00000000b0083e88> (a
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl)
> at
> org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.checkBuffer(ClientLargeMessageImpl.java:159)
> at
> org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.checkCompletion(ClientLargeMessageImpl.java:84)
> at
> org.apache.activemq.artemis.jms.client.ActiveMQMessage.doBeforeReceive(ActiveMQMessage.java:786)
> at
> org.apache.activemq.artemis.jms.client.ActiveMQTextMessage.doBeforeReceive(ActiveMQTextMessage.java:110)
> at
> org.apache.activemq.artemis.ra.inflow.ActiveMQMessageHandler.onMessage(ActiveMQMessageHandler.java:295)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1001)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1124)
> at
> org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:122)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748)
> {code}
> This can be fixed by adjusting default values for these parameters.
> In this case, we need more client threads than JCA RA sessions (maxSession).
> To avoid resource starvation, number of client threads must be greater than sum of {{maxSession}} for each MDB deployed on server.
> We should check number of client threads required by deployments (MDBs), and at least print warning message that size of client thread pool may be insufficient.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 8 months
[JBoss JIRA] (WFLY-9529) Using injected JMS in a background task/thread leads to NameNotFoundException: java:comp/TransactionSynchronizationRegistry
by Eduardo Martins (JIRA)
[ https://issues.jboss.org/browse/WFLY-9529?page=com.atlassian.jira.plugin.... ]
Eduardo Martins commented on WFLY-9529:
---------------------------------------
[~jmesnil] JNDI should be available, it may be that some thread context needs to be added, or the injected context needs to be aware of it when doing the lookup, please reassign to me if you want me to look at it.
> Using injected JMS in a background task/thread leads to NameNotFoundException: java:comp/TransactionSynchronizationRegistry
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-9529
> URL: https://issues.jboss.org/browse/WFLY-9529
> Project: WildFly
> Issue Type: Bug
> Components: JMS
> Affects Versions: 10.1.0.Final, 11.0.0.Final
> Environment: Running on Windows 10, Java 64-bit 1.8.0_131
> Reporter: Scott Van Wart
> Assignee: Jeff Mesnil
> Labels: ActiveMQ, jms, transaction
> Attachments: injected-jms.zip, wildfly-11-injected-jms.txt
>
>
> If I try to use an @Injected JMSContext while executing within a background task (ManagedExecutorService) or thread (ManagedThreadFactory), I get the attached stacktrace. I've experienced this a number of times with Wildfly 10.1.0, including messages sent in Infinispan's expiry task thread.
> My original workaround was to submit an additional task on a separate thread to send the message, then wait for it to complete. That seemed unreliable (sometimes it would still produce NameNotFoundException). I've resorted to creating my own JMSContext by using @Resource( lookup="java:/ConnectionFactory" ) and sending messages that way. Both workarounds prevent the message sending logic from participating in any ongoing transactions.
> I'm also attaching a sample EAR project. It can be built with Maven. It creates a background task that waits 3 seconds and then tries to send a JMS message in a new transaction using an injected JMS context. I use the standalone-full.xml profile to run it.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 8 months
[JBoss JIRA] (ELY-252) Take into account username after failed authentication for available mechs
by Jan Kalina (JIRA)
[ https://issues.jboss.org/browse/ELY-252?page=com.atlassian.jira.plugin.sy... ]
Jan Kalina commented on ELY-252:
--------------------------------
This could be in theory implemented in ServerAuthenticationContext, as default value in NameCallback - but I dont think there are some SASL mechanims for which this would be useful - all mechs I remember have to obtain username from client by protocol and protocol does not allow server to provide default to the client...
> Take into account username after failed authentication for available mechs
> --------------------------------------------------------------------------
>
> Key: ELY-252
> URL: https://issues.jboss.org/browse/ELY-252
> Project: WildFly Elytron
> Issue Type: Task
> Components: SASL
> Reporter: Darran Lofthouse
> Fix For: 1.2.0.Beta11
>
>
> This is something we would need to be cautious about as it does risk revealing information to an attacker but after a files attempt we may have more information and be able to offer mechanisms based on this.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 8 months
[JBoss JIRA] (WFLY-9553) PooledConnectionFactoryAdd adds a resource with no registration
by Brian Stansberry (JIRA)
[ https://issues.jboss.org/browse/WFLY-9553?page=com.atlassian.jira.plugin.... ]
Brian Stansberry commented on WFLY-9553:
----------------------------------------
[~jmesnil] I would have done that except the attribute supports expressions.
You can actually use AD.resolveModelAttribute(...) in Stage.MODEL and it would work fine except for vault expressions during boot. Vault expressions are not resolvable until the vault is installed in Stage.RUNTIME.
> PooledConnectionFactoryAdd adds a resource with no registration
> ---------------------------------------------------------------
>
> Key: WFLY-9553
> URL: https://issues.jboss.org/browse/WFLY-9553
> Project: WildFly
> Issue Type: Bug
> Components: JMS
> Affects Versions: 11.0.0.Final
> Reporter: Brian Stansberry
> Assignee: Jeff Mesnil
> Priority: Minor
>
> When working on WFCORE-2930 I was investigating discrepancies in mbean counts generated via the method in that fix vs current code. I discovered one in WildFly's messaging-activemq that is a result of a statistics resource being added to the resource tree even if attribute that triggers registration of the related ManagementResourceRegistration isn't set. So we have an undescribed resource.
> This likely has no other impact than a slightly inaccurate result from MBeanServerConnection.getMBeanCount() but we don't want this kind of thing anyway.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 8 months
[JBoss JIRA] (WFLY-9524) Messaging - default max client threads
by Jeff Mesnil (JIRA)
[ https://issues.jboss.org/browse/WFLY-9524?page=com.atlassian.jira.plugin.... ]
Jeff Mesnil commented on WFLY-9524:
-----------------------------------
Is that a practical issue?
On my laptop, I have 8 CPU cores, this means:
- 64 client threads (8 * 8)
- 32 MDBs (4 * 8)
- 15 JCA sessions
Do we have actual cases with only 1 CPU core?
> Messaging - default max client threads
> --------------------------------------
>
> Key: WFLY-9524
> URL: https://issues.jboss.org/browse/WFLY-9524
> Project: WildFly
> Issue Type: Enhancement
> Components: JMS
> Affects Versions: 11.0.0.Final
> Reporter: Martin Styk
> Assignee: Jeff Mesnil
>
> By default, size of client thread pool is configured as 8 * number of CPU cores.
> On 1 CPU machine, with default configuration and MDB deployed on server, resource starvation is possible
> On one CPU there are by default
> * 8 ActiveMQ client threads (8 * CPU count)
> * 4 MDB instances (mdb-strict-max-pool = 4 * CPU count)
> * 15 JCA RA sessions consuming messages from queue (default value of maxSession)
> Consuming of messages by MDB gets stuck because all 8 client threads are awaiting large message completion and there is no other thread to handle other tasks.
> {code:title=Client thread waiting for large message completion}
> "Thread-7 (ActiveMQ-client-global-threads)" #475 daemon prio=5 os_prio=0
> tid=0x000000000590f000 nid=0x7c7a in Object.wait() [0x00007fda43413000]
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.waitCompletion(LargeMessageControllerImpl.java:302)
> - locked <0x00000000b0083e88> (a
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl)
> at
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.saveBuffer(LargeMessageControllerImpl.java:276)
> - locked <0x00000000b0083e88> (a
> org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl)
> at
> org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.checkBuffer(ClientLargeMessageImpl.java:159)
> at
> org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.checkCompletion(ClientLargeMessageImpl.java:84)
> at
> org.apache.activemq.artemis.jms.client.ActiveMQMessage.doBeforeReceive(ActiveMQMessage.java:786)
> at
> org.apache.activemq.artemis.jms.client.ActiveMQTextMessage.doBeforeReceive(ActiveMQTextMessage.java:110)
> at
> org.apache.activemq.artemis.ra.inflow.ActiveMQMessageHandler.onMessage(ActiveMQMessageHandler.java:295)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1001)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49)
> at
> org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1124)
> at
> org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:122)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748)
> {code}
> This can be fixed by adjusting default values for these parameters.
> In this case, we need more client threads than JCA RA sessions (maxSession).
> To avoid resource starvation, number of client threads must be greater than sum of {{maxSession}} for each MDB deployed on server.
> We should check number of client threads required by deployments (MDBs), and at least print warning message that size of client thread pool may be insufficient.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 8 months