jboss 7 domain:threads configuration - jboss7.x

I was configuring an AJP connector on my JBoss7.1.1.Final. I assigned a thread pool to that connector whith some "bad" configuration:
<bounded-queue-thread-pool name="ajp-executor">
<core-threads count="10" per-cpu="20"/>
<queue-length count="10" per-cpu="20"/>
<max-threads count="10" per-cpu="20"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
I shutdown and startup my JBoss and standalone.xml came up with another configuration:
<bounded-queue-thread-pool name="ajp-executor">
<core-threads count="90"/>
<queue-length count="90"/>
<max-threads count="90"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
which is a correct one. Ok, JBoss removed the "bad" configurations. But, why count is 90? How JBoss computed this value?

Many of the examples I've looked at have both a count and a per-cpu attribute set, as in your configuration, and I've been trying to figure out what exactly that means. Check out this page: https://developer.jboss.org/wiki/ThreadPoolConfiguration
per-cpu - optional float attribute; specifies a quantity which is
multiplied by the number of available CPUs. Both quantities are then
added and the final result is the actual count used. - See more at:
https://developer.jboss.org/wiki/ThreadPoolConfiguration#sthash.OH93iLwC.dpuf
So I think what is happening is it is taking the "per-cpu" attribute of 20 and multiplying it by 4 (assuming you have four CPUs?) to get 80, and then adding your "count" to get a total of 90.
10 + (20 * 4) = 90

Related

Visual Studio 2015 Selenium WebDriver N Unit Parallel Testing

I have set up the following XML Schema for Parallel Testing N Unit Tests in Visual STudio 2015.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<!-- 0 = As many processes as possible, limited by number of cores on machine,1 = Sequential (1 process),2-> Given number of processes up to limit by number of cores on machine-->
<MaxCpuCount>0</MaxCpuCount>
<!-- <Execution parallelTestCount="0"></Execution>-->
</RunConfiguration>
</RunSettings>
I have also enabled run settings folder in Test/Test Settings but I am getting the following
Can anyone please advise as to what I may be doing wrong?
UPDATE:
Based off previous comments I have updated my schema with the following
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<!-- 0 = As many processes as possible, limited by number of cores on machine,1 = Sequential (1 process),2-> Given number of processes up to limit by number of cores on machine-->
<MaxCpuCount>0</MaxCpuCount>
<TargetPlatform>x64</TargetPlatform>
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
<!-- <Execution parallelTestCount="0"></Execution>-->
</RunConfiguration>
</RunSettings>
I have confirmed that my .net framework is 4.5 for the TargetFrameworkVersion i have tried both x64 and x86. With that I am still getting the same output shown above. Any other suggestions?
First solution:
Go to DEVEXPRESS > Options... > Unit Testing, and then uncheck the "Enable Unit Tests Service" checkbox.
Second solution:
You can set TargetFrameworkVersion and TargetFramework inside the RunConfiguration, example:
<TargetPlatform>x64</TargetPlatform>
<TargetFrameworkVersion>Framework45</TargetFrameworkVersion>

Infinispan configuration

I am bit confused reading Infinispan guide.
I want to have two clustered caches, propably must have separate jgroups files to have different multicast addresses, but should there be only one cache containter?
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:8.0 http://www.infinispan.org/schemas/infinispan-config-8.0.xsd"
xmlns="urn:infinispan:config:8.0">
<jgroups>
<stack-file name="file1" path="jgroups1.xml" />
<stack-file name="file2" path="jgroups2.xml" />
</jgroups>
<cache-container default-cache="cache1">
<transport stack="file1" node-name="${nodeName}" />
<invalidation-cache name="cache1" configuration="invalidation-template" />
<invalidation-cache name="cache2" configuration="invalidation-template" />
<invalidation-cache-configuration name="invalidation-template" mode="SYNC" >
<locking isolation="READ_COMMITTED" striping="true"/>
<transaction locking="OPTIMISTIC"/>
<eviction max-entries="20500" strategy="LRU"/>
<expiration interval="10500" />
</invalidation-cache-configuration>
</cache-container>
</infinispan>
You don't need to have a separate jgroups file for each clustered cache. Simply configure the transport element of the cache-container, and then you can define any number of caches in that cache-container.
Different multicast addresses are only needed if you want cache containers to form different clusters. I think the confusing thing here is that you can define multiple stack-file elements in JGroups but you can only really specify a single cache-container element. The XSD is not precise enough, but the parser within the code assumes a single global configuration builder instance, hence a single cache container. So, if you want to create two separate cache containers, these should be currently defined in separate XML files.

Is the default CQ5 Search Configuration incorrect?

i need to optimize the CQ5 lucene indexing configuration for my application.
I want to provide a custom search configuration but i struggle to really understand the default configuration.
Source: https://helpx.adobe.com/experience-manager/kb/SearchIndexingConfig.html)
First question:
Are the "include"-tags used in the default configuration correct?
For example:
The default configuration uses the tag "include" to include the Property "jcr:content/jcr:lastModified" for the nt:file-Aggregate
<aggregate primaryType="nt:file">
<include>jcr:content</include>
<include>jcr:content/jcr:lastModified</include>
</aggregate>
Compare this to the Jackrabbit wiki which uses the "include-property" for the exact same case. Source: http://wiki.apache.org/jackrabbit/IndexingConfiguration
<aggregate primaryType="nt:file">
<include>jcr:content</include>
<include-property>jcr:content/jcr:lastModified</include-property>
</aggregate>
I only can assume it doesn't matter but i can't find any source to confirm this.
Second question: for the nodeType "cq:PageContent" all properties of four levels are aggregated.
<aggregate primaryType="cq:PageContent">
<include>*</include>
<include>*/*</include>
<include>*/*/*</include>
<include>*/*/*/*</include>
</aggregate>
I assume that because of the aggregation all properties are indexed which are contained within these 4 levels.
Or do i must consider the index rules for the nodeType nt:base which basicly only includes properties which are matching the pattern ".:.".
<index-rule nodeType="nt:base">
<property nodeScopeIndex="false">analyticsProvider</property>
<property nodeScopeIndex="false">analyticsSnippet</property>
...
<property isRegexp="true">.*:.*</property>
</index-rule>
Best regards
The default configuration is ideed incorrect as confirmed by the Adobe CQ5 Support.
For the aggegate to work correctly properties must be included by the "include-property"-Tag
So the default search configuration (or atleast the documentation) is not correct https://helpx.adobe.com/experience-manager/kb/SearchIndexingConfig.html)

Can the order in which broker's plugins execute be defined?

I need to implement 2 filters that fit in the amq:discardingDLQBrokerPlugin category, and I need one to be executed before the other.
I can implement the two filter's logic in one class, but since the business logic is very different, I would prefer two.
I add the filters using two different plugins: com.filter.FilterAPlugin and com.filter.FilterBPlugin. The filter execution order follows a "last defined first executed" logic.
Example: In this broker configuration
<amq:broker useJmx="false" persistent="false" schedulerSupport="true">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>
<amq:plugins>
<amq:discardingDLQBrokerPlugin dropAll="true" dropTemporaryTopics="true" dropTemporaryQueues="true" />
<bean xmlns="http://www.springframework.org/schema/beans" class="com.filter.FilterAPlugin" />
<bean xmlns="http://www.springframework.org/schema/beans" class="com.filter.FilterBPlugin" />
</amq:plugins>
</amq:broker>
Filter added in com.filter.FilterBPlugin is executed first.
Does the order in which the beans are declared defines the order of execution of the filters? I can't find documentation about this in the apache MQ web
BrokerService uses Chain of Responsibility pattern, so execution order is defined by the object initialization order.

Need calrification regarding HornetQ <address-setting>

I'm using Jboss 7.1.1.final and I would like to define 2 different DLQ's, one for a certain queue and the other for all the rest of the queues.
I found this configuration :
<address-settings>
<address-setting match="jms.queue.exampleQueue">
<dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
<max-delivery-attempts>3</max-delivery-attempts>
<redelivery-delay>5000</redelivery-delay>
<expiry-address>jms.queue.expiryQueue</expiry-address>
<last-value-queue>true</last-value-queue>
<max-size-bytes>100000</max-size-bytes>
<page-size-bytes>20000</page-size-bytes>
<redistribution-delay>0</redistribution-delay>
<send-to-dla-on-no-route>true</send-to-dla-on-no-route>
<address-full-policy>PAGE</address-full-policy>
</address-setting>
</address-settings>
The match attribute can be used to match a certain queue, I have a couple of questions regarding this configuration:
If I define 2 address-setting, one with a wild card to match all and one that matches only one queue, does the one queue definition take precedence? Do i need to put it before the match all definition or it does not matter?
In the example they match a queue jms.queue.exampleQueue, i have a queue defined as:
<jms-queue name="MissionResult">
<entry name="queue/MissionResult"/>
</jms-queue>
what should i put in the match attribute in order to match it?
Found the answer:
The 2 definitions can co-exist. Jboss will find the best match.
You need to define a queue like:
<jms-queue name="exampleQueue">
<entry name="queue/exampleQueue" />
</jms-queue>
and then to match this queue, use jms.queue.exampleQueue.