Context:

- Currently, We have an application which is used to connect to multiple JMX servers. For connecting JMX servers we are using Python Popen Module to spawn the java process with the common args as follows: process = Popen(JAVA_MAIN_ARGS, stdin=PIPE)
- For multiple java servers (like: Tomcat, IBM WAS) only one process spawn and will create threads further. And Its works fine in case of multiple tomcat servers.

Problem:

- For connecting to the IBM WAS servers using SSL we required some extra arguments for the connection (like: -Dcom.ibm.SSL.ConfigURL).
- If we are adding extra arguments in the JAVA_MAIN_ARGS then this will not connect to the other servers like tomcat and other IBM WAS servers as well.
- The main root cause of the issue is Currently we spawn only one process for all the servers (i.e, common for IBM WAS and tomcat) so in that case, either one can be used at a time.

Approach:

- For the solution of the above problem, we thought to spawn multiple processes for multiple servers. (In our case we may have hundreds of servers)

Ask:

Question 1: How much expensive to spawn multiple processes of java using python Popen module in terms of Performance and execution?
Question 2: Is this approach can be considered as the only solution?
Question 3: Is there any other way/solution for the above-mentioned problem other than multiprocessing?