SlightlyLoony
Tera Contributor

find_real_file.pngThis Great White Shark is looking very happy about the resources in his vicinity. Aren't you glad that you're not the resource?

When you first install a MID server to enable Discovery in your environment, it is configured with "reasonable" values for its resource consumption. Of course, what's reasonable for most organizations might not be reasonable for yours; one size doesn't necessarily fit all when it comes to MID servers. You may have a need for your MID server to work harder, and you'd like to allocate more resources to it. Or you may have the opposite situation — perhaps you need to run a MID server in a small branch office with very few devices, and you'd like it to sip resources very meagerly while it runs on your combination print server/file server/mail server/web proxy/who-knows-what server.

Memory consumption is one of the key resources to control, whether you want to "overclock"your MID server or to make it play nice with the other processes on the host server. Here's how you can control the memory used by your MID Server:

find_real_file.pngThe MID Server is a Java process, running under the control of the Java Service Wrapper (JSW). Many applications make use of the JSW to allow their programs to run as either a Windows Service or a UNIX/Linux daemon, so you may already be familiar with it.

JSW's configuration file controls how the MID server starts up, including setting parameters for how much memory it will use. This configuration file is named wrapper.conf, and you can find it in the conf folder under the folder you installed the MID server into.

The part of the configuration file we're interested in is listed below, with the key line colored red. By default, we set the maximum memory consumption for the MID server to 512 megabytes. You can tweak that up or down as you'd like; just change the value there and restart your MID server. That's all there is to it!

You'll note there are many other parameters that you can also tweak — but please be careful; many of the other parameters in the configuration file really need to be exactly what they're set to...

#********************************************************************
# Java Application
wrapper.working.dir=../
wrapper.java.command=jre/bin/java

# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
#wrapper.java.mainclass=com.service_now.mid.Main
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperStartStopApp

# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=lib/*.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=lib
wrapper.java.library.path.2=jre/lib/i386

# Java Additional Parameters
wrapper.java.additional.1=-Djava.util.logging.config.file=properties/glide.properties

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=10

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512

# Application parameters. Add parameters as needed starting from 1
#wrapper.app.parameter.1=com.service_now.mid.Main

# The first application parameter is the name of the class whose main
# method is to be called when the application is launched. The class
# name is followed by the number of parameters to be passed to its main
# method. Then comes the actual parameters.
wrapper.app.parameter.1=com.service_now.mid.Main
wrapper.app.parameter.2=1
wrapper.app.parameter.3=start

# The start parameters are followed by the name of the class whose main
# method is to be called to stop the application. The stop class name
# is followed by a flag which controls whether or not the Wrapper should
# wait for all non daemon threads to complete before exiting the JVM.
# The flag is followed by the number of parameters to be passed to the
# stop class's main method. Finally comes the actual parameters.
wrapper.app.parameter.4=com.service_now.mid.Main
wrapper.app.parameter.5=true
wrapper.app.parameter.6=1
wrapper.app.parameter.7=stop

1 Comment