Running Multiple Instances of the DPS

You are here:
< Back

If you plan to process many tasks or if some of your tasks take many hours to run or if you have more than a few Dynamics GP companies, you should consider running multiple instances of the DPS.  You can run 2, 3 even 20 individual instances of the DPS on a single computer, based on the processing capacity of the CPU and memory on the machine which you are using.

The DPS uses only one process threaded to execute the tasks that you schedule, so it will run only one task-at-a-time.  When you schedule a task, GP Agent submits that task to the “Timed” queue on the DPS.  When the time comes for the task to run, the DPS moves the task to the “Normal” queue, at which time the actual processing begins.  If it is a recurring task, the task remains in the “Timed” queue and the next date and time for it to be submitted to the “Normal” queue is updated.

If you submit multiple tasks, they will all appear in the “Timed” queue.  When the time comes for it to run, a task moves to the “Normal” queue and begins processing immediately unless another task is already running, in which case the new task will wait while other task is still running.  The DPS will queue all new tasks for processing and they will start only when any others in the queue have finished, as the DPS executes only one task-at-time.

For example, let’s say you two tasks: RMAGING (which runs the RM Aging Routine and takes about 2 hours to complete) and IVPOST (which posts your inventory transactions and takes about 2 minutes to complete). The RMAGING is schedule to run once-a-day at 6:00pm.  You have IVPOST setup to run every 10 minutes because you want the Inventory Adjustments fed from your warehouse management system to update GP inventory on-hand quantities every 10 minutes.  At about 6:00pm, the Timed queue submits IVPOST and shortly thereafter RMAGING to the Normal queue.  IVPOST runs while RMAGING waits for IVPOST to finish. Once IVPOST is done (at about 6:02pm) RMAGING starts.  At 6:10pm, 6:20pm, 6:30pm, etc. the Timed queue will submit IVPOST to the Normal queue but they will not begin processing (and thus Inventory won’t be updated) until RMAGING finishes at about 8:00pm.  If, however, you had two instances of the DPS running and had RMAGING configured for instance 1 and IVPOST for instance 2, IVPOST would continue to process every 10 minutes.  You could also use this type of setup for a task that you want to run in multiple companies but won’t finish overnight if run them back-to-back.  Instead, create multiple instances and run each company’s task on a specific instance, so that they run concurrently rather than sequentially.

If you need to run multiple instances of the DPS on a single machine or on a Terminal Server, follow the instructions in this section.

Installing Dynamics GP for Multiple DPS instances

You do not need to install Dynamics GP and DPS multiple times in order to implement multiple instances.  We will show you how to setup any number of instances with just one Dynamics GP installation.  Install one default installation of Dynamics GP on the DPS computer and follow the next steps to configure your multiple instances.

Setup the Servers and/or Services in Dynamics

Create the Servers in Dynamics GP using the Process Server Setup window as indicated by the Dynamics GP documentation.  Servers are designated by the machine computer name (for example: MSGPDPS001) followed by “#1”, “#2” indicating the instance number of each DPS.  In other words, if you want three DPS instances, and the computer is named MSGPDPS001 you would create Servers MSGPDPS001#1, MSGPDPS001#2 and MSGPDPS001#3.  After creating the three Servers, you will then create three Services.  Name the services to easily identify them, such as MAINTENANCE, POSTING, ROUTINES.  In order for the different services to function properly, you should add only one server to each service.  If you inadvertently add more than one server to a service, it will not disable GP Agent but all tasks will be sent to the first server (in alphabetical order) in the list, and no tasks will ever be sent to the other servers.

Configure the Data folders

DPS instances are designated by a DEX.INI setting.  In order to implement multiple instances, each DPS instance must be launch with a specific DEX.INI file.  In order to do this without having multiple installations of Dynamics GP on the same machine, you will create subfolders to store files to be used by each DPS instance.  Underneath the main Dynamics GP installation folder (typically C:\Program Files\Microsoft Dynamics\GP) create subfolders Instance1, Instance 2 and Instance 3.  Once you have created these folders, copy the Dynamics.set and the dex.ini files from the Dynamics GP installation folder into the various subfolders just created.

Configure the Dex.ini

Navigate to the Intance1 subfolder created in the previous step.  Edit the DEX.INI and verify the DPSInstance=1 line.  If this setting does not exist, add it and save the DEX.INI file.  This DPSInstance value matches the GPDPS01#1 value used when you setup the Services in Dynamics GP.  Navigate to the Instance2 folder and edit the DEX.INI changing DPSInstance=1 to DPSInstance=2.  Save the DEX.INI and proceed to the next folder until you have assigned a unique DPSInstance value for each DEX.INI.

Configure the Launch File

When the DPS is launched, the name that appears in the main window Title Bar (usually “Microsoft Dynamics GP”) is based on the 3rd line of the Dynamics.set file.  When you have multiple instances of DPS, you might want to be able to determine which DPS instance is running.  If you do not edit your Dynamics.set, all of your instances will display “Microsoft Dynamics GP” in the title bar.  In order to differentiate the instances, edit your Dynamics.set and add the instance number after Microsoft Dynamics GP and save your Dynamics.set file.  Do this for each of the Dynamics.set files in the Instance1, etc. folders.  Now, when the DPS is launched with this Dynamics.set and dex.ini, “Microsoft Dynamics GP 1” will appear in the Title bar and in the Task bar for easy identification.

Sample Dynamics.Set:

15
0
Microsoft Dynamics GP 1
949
FieldService

This Dynamics.set file will change the program name in the Windows taskbar to “Microsoft Dynamics GP 1” so that you can more easily distinguish the different instances of the DPS.

You could also use the Service name, if you so chose.  The following launch file would display “Microsoft Dynamics GP 1 (POSTING)” as the program name:

15
0
Microsoft Dynamics GP 1 (POSTING)
949
FieldService

Important Note:  When the Dynamics runtime engine includes new code (i.e. .cnk files), the chunk file may look for the Microsoft Dynamics GP program name, so never name these edited launch files Dynamics.set if they’re in main Dynamics GP installation folder.

Configuring the Windows Shortcuts

Now that you’ve created your folders, DEX.INI (referred to as the “defaults file”) and Dynamics.set (referred to as the “launch file”) files, you can now create shortcuts to launch the DPS utilizing these special files.  The Dynamics GP runtime engine (both Dynamics.exe and DPS.exe) can utilize command line parameters to run the Dynamics.exe and the DPS.exe with specific launch file specifications.  The command line parameters are as follows:

Dynamics.exe [set file] [defaults file]

DPS.exe [launch file] [defaults file]

By creating shortcuts that reference these to files, you will be able to launch your multiple DPS instances out of a single Dynamics GP install.  To create a shortcut, follow these step:

1. Right click on the DPS.exe in the GP installation folder and choose “Create Shortcut”.
2. Rename the shortcut DPS Instance 1
3. Right click on the GPS Instance 1 shortcut and select “Properties”.
4. Add the set file and launch file parameters to the Target field.  For example, assuming the default installation folder and the folders and files described above, the target should be (all one the same line in the shortcut):

“C:\Program Files\Microsoft Dynamics\GP\Dps.exe”
“C:\Program Files\Microsoft Dynamics\GP\Instance1\Dynamics.set”
“C:\Program Files\Microsoft Dynamics\GP\Instance1\Dex.ini”

Make sure that there is a space between the three file names and that you include the double quotation marks

You can now launch the multiple instances of DPS simply by double-clicking on the shortcuts.  You can copy the shortcuts to your desktop or even place them in the Startup folder in your Programs menu off of the Start button, so that the instances are automatically launched when you log into the computer or remote session.