web stats
Mirth Community - View Single Post - Custom web service with Parallel Message Processing
View Single Post
  #1  
Old 06-02-2016, 04:08 AM
canessetu canessetu is offline
What's HL7?
 
Join Date: Jun 2016
Location: Rome
Posts: 1
canessetu is on a distinguished road
Send a message via Skype™ to canessetu
Question Custom web service with Parallel Message Processing

I need to develope a custom search/retrive web service that manages concurrent requests processing.

Using the new feature 'Parallel Message Processing' of Mirth 3.4.0.8000, I tried developing it setting 'Max Processing Thread' parameter to 100.

I tested performance whith Jmeter tool with:
Number of Thread(Users): 100
Ramp-up period : 2 sec
Loop Count: Forever


Observing Mirth dashboard some requests have concurrent execution but in Jmeter results latency time between request and response increases exponentially.
First Request latency time is 5000 ms
Last Request latency time is 12000 ms


Discovering in com.mirth.connect.connectors.ws.WebServiceReceiver class I found that HttpServer has backlog and poolthread size both set to 5.
Original source code from line 138 to 147:

Code:
        try {
            configuration.configureReceiver(this);
            server.bind(new InetSocketAddress(host, port), 5);
        } catch (Exception e) {
            throw new ConnectorTaskException("Error creating HTTP Server.", e);
        }

        executor = Executors.newFixedThreadPool(5);
        server.setExecutor(executor);
        server.start();
Replacing 'backlog' and 'poolthread size' with the same value as 'Max Processing Thread'.

Code:
        try {
            configuration.configureReceiver(this);
            server.bind(new InetSocketAddress(host, port), connectorProperties.getSourceConnectorProperties().getProcessingThreads());
        } catch (Exception e) {
            throw new ConnectorTaskException("Error creating HTTP Server.", e);
        }

        executor = Executors.newFixedThreadPool(connectorProperties.getSourceConnectorProperties().getProcessingThreads());
        server.setExecutor(executor);
        server.start();
Repeting the same test with Jmeter the code works with a constant latency time in every request.

About backlog configuration watch 'Note about socket backlogs'


Is this a proper way to develope it?
Is it dangerous?
Reply With Quote