- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Continuing yesterday's theme (by special request), today I'll show you how to control your MID Server's CPU consumption. Again, when you first install a MID Server it is configured to consume a "reasonable" amount of the MID Server host's CPU resource — but your needs may vary, in which case you'll need to tweak those default settings. The mechanism we've provided to control the MID Server's CPU consumption is by controlling the number of threads it uses ... by which I don't mean the hippie's threads, as at right. If you're as ancient as I am, you'll remember when people actually wore stuff like that (shudder), and thought they looked really groovy doing it...
Here's how you control the MID Server's CPU consumption:
To a computer, each thread is a concurrently running task. If the MID Server is configured to use a maximum of 25 threads (the default setting), that means that it will do 25 (at most) things at the same time. Modern computers are very powerful devices, and 25 concurrent tasks is actually quite a small effort for most CPUs. However, if your MID Server is running on a host with many other programs also running, you might want to tweak it down even further — and you can set the MID Server to use as few as 5 threads with no problem. On the other hand, if you have a need for speed and your host is powerful enough (or lightly loaded with other programs), you may well want to tweak this setting up. How high you can go depends very much on the hardware and operating system your host has, and you may have to experiment to find the optimal value for your situation. I can make a couple of general observations, though:
Most MID Server tasks require some file handles to do their job. On the Windows operating system, file handles are a rather precious resource available in a fixed quantity — and if you ramp up the number of threads the MID Server uses on a Windows host, it's quite likely you'll run out of file handles before you consume too much CPU. You'll see this as "out of file handles" errors in the MID Server's logs — that's a warning that you're trying to use too many threads. UNIX and Linux hosts have a much different scheme for allocating file handles, and generally on those hosts you can increase the threads used by the MID Server right up to the point where you've overloaded your host's CPU.
Each thread on the MID Server requires some memory (exactly how much varies considerably from task-to-task, and is also dependent on the equipment being discovered). To ramp the number of threads up, you may also have to increase the amount of memory that Java is using (see yesterday's post). If you don't have enough memory configured, you'll see "out of memory" errors in the MID Server's logs.
With all that said, here's how you actually control the maximum number of threads used by the MID Server. Just edit the config.xml file, which you can find in the folder where you installed your MID Server (sample file below). Change the line I've highlighted in red to be whatever value you want. Save the file and restart your MID Server — and that's all there is to that!
<?xml version="1.0" encoding="utf-8"?>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.