web stats
Custom web service with Parallel Message Processing - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 06-02-2016, 08:50 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

I ran the same test with JMeter but I do not see it increasing exponentially. Those two metrics you posted, "first time" and "last time" don't mean anything by themselves. What matters is the overall trend over the course of time. Running it for several minutes, I see the average response time stay quite constant. It's definitely not increasing at all, much less exponentially.

That said, what you proposed makes sense, and should have been done for 3.4 to begin with. I've updated this issue for 3.4.1: MIRTH-2376

Thanks for the catch!
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
concurrent, custom web service, multi threads, request, webservice

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation