adequate
adequate
adequate
adequate
 

JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   Forums 
July 22, 2017, 08:40:29 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: Configuration of the JPPF grid on a per-job base  (Read 2361 times)

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Configuration of the JPPF grid on a per-job base
« on: February 03, 2014, 09:10:05 AM »

We use one JPPF infrastructure in our company for different kinds of jobs: Some jobs require a lot of memory but have only a few classes to load to the nodes, some have a lot of classes (20.000 classes). A task of some one kind of job runs for hours, others only for seconds and so on.
We also figured out that we have sometime a lot of waiting threads in our tasks because of the way the tasks work - its a problem in our software, not in JPPF.

So for us it would be great if the topology of the grid could be configured on a per-job base: The client program should configure show many nodes to start on a machine and should also provide parameters like memory settings (JVM parameters), number of threads to start per node an so on.

I have found this feature request for version 4.1: http://www.jppf.org/tracker/tbg/jppf/issues/JPPF-115

Will this feature enable us to configure the grid in the way I described above?

Thanks for your answer in advance!
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Configuration of the JPPF grid on a per-job base
« Reply #1 on: February 04, 2014, 07:20:21 AM »

Hello,

JPPF-115 is about a sample that will combine existing JPPF features to provide and demonstrate some level of dynamic grid topology management.
What's currently missing in JPPF to satisfy your requirements, is the ability to start new nodes (and stop them) on designated machines, basically a node provisioning facility. I am currently working on this, and exploring the possibility to implement this service as a custom node MBean, to make it easily manageable from the client. I'll be happy to provide the related code as soon as I have something working. The basic idea is to have a "master" node on each machine, into which the custom MBean will be plugged. The custom MBean will provide the ability to start additional "slave" nodes, stop a specified number of running slave nodes, etc... It will also let you specify the JPPF configuration of the slave nodes, so you can for instance specify the number of threads or other properties.

Right now in 4.0, you already have a number of features that can be used for your needs:
- fine-grained grid partitioning by setting an execution policy on the the jobs. This allows you to define which nodes your jobs can execute on, by evaluating any number of rules against the information provided by JPPFSystemInformation, as explained in the answer to your previous question
- you can manage remote nodes via the JMX-based management APIs, either indvidually, or via the driver, using node selectors. The management APIs allow you to stop/restart existing nodes (but not to start new ones), change the number of processing threads or even change the JPPF configuration.
- the driver management APIs allow you to activate or deactivate running nodes based on node selectors. A deactivated node is disabled in the JPPF server scheduling facility and will not receive any job until it is activated again, or the driver is restarted. Since there is currently no real provisioning facility, you can use this feature by starting X nodes on each machine and deactivating those you don't want to use, or reactivating them when you need them.

By combining these features, you can get pretty close to your stated requirements.

Sincerely,
-Laurent
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #2 on: February 04, 2014, 11:24:40 AM »

Wow, thats sounds good for us. The idea of a master node which starts slaves per machine is exactly what we need.
I will have a look a the features already available - first we have to migrate to JPPF 4.0, we sill use 3.3.6.
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Configuration of the JPPF grid on a per-job base
« Reply #3 on: February 06, 2014, 10:11:06 PM »

Hello,

I finally got it working. You can download this sample here.
This is a self-contained Eclipse project, which you can also build and run from the command line via the included Ant and shell scripts. Please read the included Readme.txt to get started.
I attempted to make the code sufficiently clear, with a lot of inline comments. Let me know if anything remains unclear.

The design is as I mentioned in my previous post: a custom node mbean, deployed only on the master nodes, provides an interface to remotely request that a number of slave nodes be provisioned, while optionally specifying configuration overrides, including for JVM options. This part is done in the src/master folder.

The slave nodes use an initialization hook to redirect the output of System.out and System.err to separate files. This is done is src/slave.

Finally, src/client contains a demo runner which requests the start of 4 slave nodes for each master, submits a job that only executes on the slaves, then terminates the slaves.

Hope you'll enjoy it.

Sincerely,
-Laurent
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #4 on: March 10, 2014, 03:25:23 PM »

Hi,

thanks for the x-provisionin.zip file. I hat a lot to do in the past week, but will now have a look at it.
« Last Edit: March 11, 2014, 08:59:28 AM by boris.klug »
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #5 on: March 11, 2014, 09:55:41 AM »

I noticed that the feature is now build-in in version 4.1-alpha. I will do some tests.

It seems that at least one node is always running, which is than the master for the slave nodes. Is is correct?
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Configuration of the JPPF grid on a per-job base
« Reply #6 on: March 11, 2014, 10:03:28 AM »

Hello,

Yes, you always need a master node running, to be able to start slave nodes. This is is in fact a standard JPPF node, so no special configuration is needed, the provisioning feature should work out-of-the-box. You should be able to easily test it via the adminsitration console.

-Laurent
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #7 on: March 11, 2014, 03:50:06 PM »

Yes, I testes it with version 4.1-alpha and it works great! Now we can control the grid directly from the client program.

I think we will configure the master node to use minimal RAM and submit the job only to the slaves using an ExecutionPolicy like new Equal("jppf.node.provisioning.slave", true).

Now the only thing we have to do is do wait for the release of version 4.1 ;-)
In the bug tracker I saw that the 15th of April as a release date...
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Configuration of the JPPF grid on a per-job base
« Reply #8 on: March 11, 2014, 08:17:02 PM »

Hello,

You should be able to run the master node with the following settings:
Code: [Select]
jppf.processing.threads = 1
jppf.jvm.options = -server -Xmx16m

For information, an idle node will normally use less than 3MB of heap and around 11 MB of non-heap memory (permgen space), so you still have a safety margin with the settings above.

I also confirm the date of April 15th at the latest for the 4.1 release. I will move features to the next version if necessary.

Sincerely,
-Laurent
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #9 on: March 28, 2014, 10:35:23 AM »

Hi Laurent,

I have implented classes with uses the provisioning feature of JPPF 4.1 (alpha) and it works great for us. The idea is to get information about the nodes (e.g. number of cores) and than configure the number of slave nodes or the number of thread acording to the number of cores. For one client program its optimal to use one node per core with only one thread, for another its better to use e.g. only one node but with the number of threads set to number of cores or 2 * number of cores... it depends on the problem to solve.

I would like to do the same with the memory: If I only start one node per server, I like to give it the total physical memory (minus a little bit for OS and the master node), if I start n nodes, I like to give the nodes (total memory / n) to each node.
For distributing the memory dynamically to the node, I need to know the installed physical memory per server. This can be retrieved with MBeans using com.sun.management.OperationgSystem. Till now JPPF only tells me the memory information about the JVM, not the server.

So it would be great if a JPPF node can expose the information about the server it is running on using the class JPPFSystemInformation. Data which would be usefull would be TotalPhysicalMemorySize, FreePhysicalMemorySize, AvailableProcessors (which is already present in JPPFSystemInformation), maybe more.

Thank you for your great work in advance!
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2187
    • JPPF Web site
Re: Configuration of the JPPF grid on a per-job base
« Reply #10 on: March 28, 2014, 10:23:59 PM »

Hello,

The class com.sun.management.OperatingSystem is not a documented class of the JDK and therefore is not officially part of it. For instance, it is not included in the IBM JVM, which will cause problems in this case. Due to this, I prefer not to offer its capabilities in the JPPF distribution. You can, however, easily use it from a node initialization hook as follows:

Code: [Select]
public class MyHook implements InitializationHook {
  @Override
  public void initializing(UnmodifiableTypedProperties initialConfiguration) {
    com.sun.management.OperatingSystem os = (com.sun.management.OperatingSystem) ManagementFactory.getOperatingSystemMXBean();
    TypedProperties currentConfig = JPPFConfiguration.getProperties();
    currentConfig.setLong("physical.memory.free", os.getFreePhysicalMemorySize());
    currentConfig.setLong("physical.memory.total", os.getTotalPhysicalMemorySize());
  }
}

From there on, the properties physical.memory.* will be available in the node's JPPFSystemInformation.getJppf() property set.

I hope this helps.

Sincerely,
-Laurent
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #11 on: March 31, 2014, 10:12:36 AM »

Thank you for your quick answer. I am more the Oracle/Sun-JDK-only-guy so I have not tought about JVMs that are not Oracle/Sun. You are right - as long as there is no JVM independent way to get the physical memory of the server, the information should not be included in JPPFSystemInformation.
Logged

boris.klug

  • JPPF Master
  • ***
  • Posts: 39
Re: Configuration of the JPPF grid on a per-job base
« Reply #12 on: April 29, 2014, 09:11:18 AM »

We havent done it with the InitializationHook because we had to alter the JPPF Node distribution, which is not possible here.
But the client can request the information using JMX like this:
Code: [Select]
Map<String, Object> memInfo = proxy.forwardGetAttribute(masterSelector, "java.lang:type=OperatingSystem", "TotalPhysicalMemorySize");

Together with the provisioning feature, it is now possible for us to e.g. start 4 (slave-)nodes on a server each using 1/4 of the total memory (minus a little bit for os and system stuff).
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads