Mikon Calculations - Priorities and Load Balancing

22 February 2022 news image

In most Mikon installations, more than 50% of all the values are calculated. In this article, written by Mikon Expert Alf Sandsør, you will learn how to load balance and optimise calculations.

There is usually a combination of manually entered values and calculated results on data entry screens. Regardless of their input values, all calculations are performed on the server side. Your input values are passed to the server(s), recognising this as part of an equation. The calculation will be activated, the result stored in the database and optionally displayed on your screen. All data from all sources, both manual and online data, will pass through the same channels. All this will be done on a first-come, first-served basis with a single calculator running.

Suppose you experience that the time to get the result is long. In that case, it is not necessarily due to the system being slow. Still, the calculation might have fallen behind in a long queue of other activities.

To avoid a situation where you expect a quick result but are slowed down by other calculations, you may establish multiple calculators in parallel and assign calculated signals to a specific calculator. The "Calculation Group" is decided when you set up the equation. The default group is 1.

asset-img

From a computer/CPU point of view, all the calculators run with the same priority managed by the OS. To prioritise a signal calculation, you simply assign it to a calculator with a few other signals.

Setting up Multiple Calculators

A standard Mikon installation comes with one calculator installed and running, but the system and database schema is initially prepared for 3. To set up more, go to the "binay" folder for the Mikon Application Server and write

asset-img

This example is for Calculator # 3. The number could be 1 to 9, but for # > 3, some extra configuration effort is required.

To ensure the system recognises that you will utilise more than one calculator, make sure the environment variable MI_MAX_CALCULATORS is set to the total number of calculators installed.

Distributing Calculated Signals

The number of signals where you expect a quick return based on manual data entry usually is not very high. Assign them to the same calculator and keep other calculations somewhere else. Then the chance of falling behind in a long line of other activities is small.

Any signal calculation that may end up in a big bulk of calculations should be assigned to their own calculators. These could be calculations that trigger forward, especially time series calculations like AVGT and SMT. One single entry could quickly result in several hundred calculations that could create large queues.

Suppose a single Mikon installation serves several independent systems, like production and emission control. In that case, it may be practical to split the related calculations into separate groups.

Tuning the Calculators

There is a set of environment variables for each calculator that will influence the performance and throughput of calculations.

MI_OCALCn_FREQ

The number of seconds the IISERVER process waits before this process forces a wakeup of the calculator number 'n'. For calculators with high priority signals, this should be set low to avoid a too-long wait before it is started.

MI_OCALCn_TODB

The default is that the calculation results are passed as a standard message to the central process manager. If set to "Y", the result is processed and stored directly in the database. This could provide a faster flow through when calculations pile up.

MI_OCALCn_SENDUNCHANGED

When a calculation is finished, the result is compared with the current value. The default is to pass this result regardless. To save time, you may set this variable to "N". Then, the result is ignored. The advantage is to improve calculation throughput, but it may stop a chain reaction you intended...

MI_OCALCn_REMDUP

Remove duplicates. Some calculation functions (AVGT, SMT) may indirectly create a lot of calculations to be performed for the same combination of signal/product/time. In those specific cases, removing duplicates may be a good performance booster. The default setting is "Y", and we don't see any reasons to change that.

Monitoring the Throughput and Performance

The Mikon architecture is based on messaging between specialised services. There may always be something going on in the background. The latest version of Mikon Classic has a server status indicator in the lower-left corner. When you click on it, you may see how messages are being buffered between services. Under normal circumstances, these buffers are empty (0 in the queue)

The % number is not an accurate measure of anything, but a rough estimate of how busy the services are.

asset-img

The green "hook" is an indicator that all services are running. If anything is stopped, this will show a warning flag. Click on the warning, and a server status will appear.

asset-img

Calculator #2 has stopped.

Setting up additional Calculators

The Mikon installation with buffer tables and lookup catalogues for 3 calculators in parallel. If you want to increase this up to the maximum of 9, you need to configure some things at the database level.

When defining an equation, you need to add more options to allow a dropdown of more than options 1 to 3. Do that in "Code Maintenance".

asset-img

Each calculator uses 2 buffer tables to handle calculation messages. These tables are called calcbufferN and calcbufferN_work, where N is the number of the calculator. Mikon comes with these tables defined for 1 through 3. You need to set up the same pair for each new calculator. Just duplicate the design. For MSSQL it is essential to have the unique identity seed sequence_no defined.

All Articles

Discover how Machine Learning is revolutionizing manufacturing with Predictive Maintenance in our latest blog post. Learn how historical data from production lines can predict equipment failures, reduce downtime, and boost efficiency.

Embracing the Future of Quality Management with Statistical Process Control and Mikon

In the evolving landscape of industrial production, Statistical Process Control (SPC) has taken a front seat in ensuring product quality and consistency. The integration of Mikon's advanced analytics with real-time data processing has revolutionized SPC, making it an indispensable tool for modern manufacturing.

The seamless integration of laboratory data with production data holds immense potential for businesses across industries. This powerful combination provides a comprehensive understanding of operations, enabling informed decision-making, enhanced quality control, streamlined processes, effective troubleshooting, and regulatory compliance. By leveraging the synergies between these two critical data streams, organizations can unlock holistic insights that propel them towards greater success in today's data-driven world.

Accurate and timely production reporting is critical for manufacturing companies seeking to improve their operations and increase profitability. Production reports provide valuable insights into key aspects of the manufacturing process, including bottlenecks, quality control, resource allocation, and data-driven decision-making. With the Mikon software family, companies can generate detailed and up-to-date reports that enable stakeholders across the organization to make informed decisions and take action to drive performance improvements.

Mikon Rule Server is a potent add-on to the Mikon Application Servers. The Mikon core architecture is based on messages that initiate inserts, updates, and deletes signals, batches, and genealogy. The Rule Server is designed to act on these messages to transform and generate new messages based on a custom rule server configuration.

Many people are confusing the terms manufacturing and production. In Mikon, we deal with Industrial Reporting. In this article, we explain the difference between manufacturing and production, and give two examples from Mikon customers.

n