The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sabell2012
Mega Sage
Mega Sage

NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.

 

DIFFICULTY LEVEL:    INTERMEDIATE
Assumes having taken the class Discovery Fundamentals and has good intermediate level of knowledge and/or familiarity with Discovery in ServiceNow.


Virus scanners focus on the c:\windows\temp directory. Unfortunately, this is also the directory that the ServiceNow MID Server uses out-of-the-box. As a result, if you are running a lot of Discovery jobs on a particular MID Server and your security admins have installed a virus scanner on that same device, you will probably see a performance hit. Since most virus scanners do not allow the exclusion of this directory, you need to change the directory that the MID Server uses to resolve this issue. Doing so will allow your security admins to white-list that new directory and, thus, remove the performance hit.

 

To change the temporary directory that a MID Server uses, follow these steps:

 

1. From the MID Server machine, navigate to c:\ServiceNow\<machine name>\agent\conf (or wherever you have your MID Server files)

2. Edit the file: wrapper-override.conf

3. Add this configuration line to the line following the "# Custom Parameters" section:

 

wrapper.java.additional.3=-Djava.io.tmpdir=./MIDTemp

(this can be any arbitrary name you want to give your temp directory)

 

Your file should look like this (at the end):

 

# ------------------------------------------------------------------------------
# Custom parameters
# ------------------------------------------------------------------------------
# Uncomment below to enable JDP. Change the address/port settings as needed.
#wrapper.java.additional.1=-Xdebug
#wrapper.java.additional.2=-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=y
#
# Add additional custom parameters below
wrapper.java.additional.3=-Djava.io.tmpdir=./MIDTemp
#wrapper.java.additional.4=

Notes: wrapper-override.conf should be used for any custom parameters. Do not modify wrapper.conf as it could have bad side-effects or not even allow the mid to come up.

 

4. Save the file

5. Navigate to c:\ServiceNow\<machine name>\agent and create a new directory folder named: MIDTemp

 

sabell2012_1-1701552211556.png

 

6. Stop and Start the ServiceNow MID Server service

 

NOTE: Changes to wrapper-override sometimes require that the service be uninstalled then reinstalled. This will require use of the sc delete command. Open a command line as administrator and run: sc delete "Service-Now MID Server" where the bold portion matches the name of the service (in case you've renamed it).   Then, run the MID Server start.bat to re-install and restart the service. See my article: Community Code Snippets: Removing a MID Server

 

7. Navigate to the MIDTemp directory and note creation of the temporary directories and files. The MID Server is pretty fast to write and delete these, so you might have to stare for a bit. It took me a couple of tries just to get a screen shot!

 

sabell2012_3-1701553116278.png

 

8. Now all that's left is to contact your security administrator to exclude the new directory from the virus scanner's list (white-list)!

 

You should notice a significant performance increase and a major reduction in the amount of CPU and resources being used.

 

Learn More

 

If you're interested in learning more about the available configurations in the wrapper service application, check out these links:

 

 

Enjoy!

Steven Bell.

 

If you find this article helps you, don't forget to log in bookmark it, and mark it as "Helpful"!

 

sabell2012_0-1701551628681.png


Originally published on: 1-20-2015, I re-wrote it an re-published it on 5-19/2016 11:26 AM.

I now have updated the article and brought it into alignment with my new formatting standard.

4 Comments