piątek, maja 30, 2014

Tibco BW Tomcat runs out of local TCP/IP ports

caused by: java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
        at java.net.Socket.bind(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)

Workaround:
echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
echo 10 > /proc/sys/net/ipv4/tcp_fin_timeout
echo 1024 > /proc/sys/net/ipv4/tcp_max_orphans
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse

or change engine from Tomcat to HTTPComponent.

piątek, maja 23, 2014

All server JVMs stats

for (VirtualMachineDescriptor vmd : VirtualMachine.list()) {
 VirtualMachine vm = VirtualMachine.attach(vmd);
 String javaHome = vm.getSystemProperties().getProperty("java.home");
 File managementAgentJarFile = new File(javaHome + File.separator + "lib" + File.separator + "management-agent.jar");
 vm.loadAgent(managementAgentJarFile.getAbsolutePath());
 String address =  vm.getAgentProperties().getProperty("com.sun.management.jmxremote.localConnectorAddress", null);
 JMXServiceURL jmxUrl = new JMXServiceURL(address);
 MBeanServerConnection conn = JMXConnectorFactory.connect(jmxUrl).getMBeanServerConnection();
 MemoryMXBean memBean = ManagementFactory.newPlatformMXBeanProxy(conn,
   ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
 RuntimeMXBean rtBean = ManagementFactory.newPlatformMXBeanProxy(conn,
   ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
 int memUsage = (int)(100.0 * memBean.getHeapMemoryUsage().getUsed() /  memBean.getHeapMemoryUsage().getMax());
 long memMB = memBean.getHeapMemoryUsage().getMax() / 1024 / 1024;
 System.out.println(rtBean.getSystemProperties().get("user.dir")+ " => " + memUsage +"% mem,   max="+memMB+"MB");
}

czwartek, maja 22, 2014

VAT - Validation of Architecture in Tests

1. Flood test / capacity test
We call component with assumed load, see distribution of response times (min, max, avg, med, 80 percentile, 95 percentile, 99 percentile) - are they deterministic. We increase load linearly up to 10x (one order of magnitude higher) and monitor performance. Components should be able to be tuned to handle load 2x higher than current business requirement. Tests should define limits when below application is still responsive and above crashes.
2 Duplicates test
We call services with duplicated messages and check handling of duplicates. Application may not recognize duplicates, may throw errors due to detection of repeating unique ids and may accept duplicates, but internally skip processing of them. Tests should check for not aimed data multiplication and stalled flows due to rejected duplicates errors.
3 Timeout test
We inject long sleep activities and check timeout handling. We look for snowball effect (backlog aggregation due to repeating on timeout), not defined capacity limits causing whole components/flows to be stucked/failing with OutOfMemory errors, overloaded components and servers.
4 Kill & restart test
We kill and restart whole application/(application) servers. We look for missing (lost) data, duplicates and other inconsistencies. We verify transactional requirements and actual implementation.
5 Error injection and negative path
We inject errors inside process execution and check for missing error handlers. We verify error codes to see if they match actual exception. We also verify assigned error categories (business, technical, repeatable, non-repeatable).
6 Logging test
We check if logging works, payloads are available and we have enough file/database storage. We check if flows are traceable using log frontend.
7. Active-Active, Active-Standby
We kill components and check switching between endpoints. We measure times and verify against configured application timeouts. We detect weak points / single points of failure, recovery errors. It is important to test all possible permutations, with various timings etc. We should create and execute test case when whole HA infrastructure does not deliver working HA for connected applications.
8. Poller test
We run many pollers at once and check if they are protected against working in multithreading. We configure limits to comply with singleton design or implement missing (b)locking. We check data consistency/duplication.
9  Data republication
We check if data republication is possible, how to trigger it, how to detect republication from external systems, how to protect against flood/snowball effect/not controllable backlog.
10  Long term stability test
We execute normal load tests for 24/48/72 hours and check for any stability issues caused by daily IT usage patterns.

wtorek, maja 20, 2014

Bakterie na Marsie

Mogą pochodzić z łazików...

środa, maja 14, 2014

Sweet foto kandydata do PE na tle spalonej tęczy

Prawdziwa tęcza gdzieś na Pradze.

niedziela, maja 11, 2014

Jezus według Palikota, Hartmana, Senyszyn i Szczuki

czwartek, maja 08, 2014

JMS Topics as a foundation for distributed tests

Runnable jar file is published to topic. Clients pick it up, run, and redirect output to reply topic.

poniedziałek, maja 05, 2014

TDI Unit Test extensions for Tibco BW

Have you ever wanted to do unit testing with Tibco BW, modfiy "read-only" global variables, mock calls of database activities etc?

Now you can replace any activity with static data or other process call, transparently to existing process code.

You can create unit test processes, enumerate them, run using OnStartup mode, gather test data. You can integrate your tests with your Continuous Integration infrastructure.

TDI TestUnit extensions for Tibco BW is a must have tool for an agile company.

Grab it for free. File tdi-core.jar should be put into bw/5.x/hotfix/lib folder, tdi-palettes.jar should go into bw / 5.x / lib / palettes.