Scale Your Applications with Component Load Balancing

Scale Your Applications with Component Load Balancing

ith more and more companies moving their applications to the Internet, Visual Basic developers are faced with the problem of having to build components that scale to thousands of users. This either takes learning all of the tricks to squeezing every bit of performance out of VB or moving to a language like C++. You have probably also created an extremely convoluted network architecture to partition users across multiple servers to provide some level of redundancy. In doing so, you struggled with having to install and administer COM components on multiple servers; figuring out which server has which version of the component, messed around in the registry to ensure that everything is configured correctly, or faced DLL hell because other applications were installed on servers that overwrote supporting DLLs.

Until now, there has been no simple solution for developers to easily create COM applications that provide the scalability and reliability necessary for Web applications. Adding your components to MTS helped, but it was still a bottleneck and a single point of failure in your application. If the server went down, then that part of the site would come down. To help with some of these issues, Microsoft has introduced a new server called Application Center.



Visual Basic is great for building applications quickly but unfortunately, with VB, the tradeoff is usually poor scalability. The Internet has made this limitation of VB applications a constant challenge for developers, who must build components that scale to thousands of users.



Microsoft’s new Application Center offers component load balancing technology that allows administrators to create a cluster of servers that will respond to component requests.

Background on Application Center
Application Center is designed to provide a more robust environment for configuring, testing, deploying, maintaining, and scaling Web applications that are deployed across a server farm. There are a number of features in Application Center that will be of great interest to any VB developer, as they will assist in developing more scalable applications that are easier to administer and deploy. This article will focus on the component load balancing (CLB) feature of Application Center, which can significantly improve application scalability.

Note: Application Center runs only on Windows 2000 Server, Advanced Server, and Datacenter Server with IIS 5.0 installed.

COM Activation of Objects
In order to understand what CLB is, you will first need to understand the basics of how COM+ instantiates objects. When an application makes a call to instantiate a new object using the New keyword or the CreateObject function, a Windows service, the Service Control Manager (SCM), is performing the instantiation. The SCM acts as a middleman between your application and the COM component. The request for an object is passed to SCM as either a request for the ProgID, such as Word.Application, or as a GUID of the class, such as {000209FF-0000-0000-C000-000000000046}. The SCM uses this information to locate the COM DLL or EXE in the file system by searching the keys in the registry.

When the physical location of the COM component is found, the SCM instantiates an object and returns a pointer to the object in the case of an in-process COM DLL, or a proxy object in the case of an out-of-process COM EXE. With out-of-process objects, the SCM must create two objects to marshal data across processes. These two objects are the proxy and stub objects. From the perspective of the client application, it always thinks it is communicating directly with the instantiated object because the proxy implements the interfaces of the class being instantiated.

With Windows NT 4.0 and DCOM, Microsoft extended the SCM to allow applications to instantiate objects on a remote server by passing the server name into the CreateObject function:

Set oCustomer = CreateObject("MyExe.MyClass", _  "ServerName")

or setting the RemoteServerName value in the registry for your components. DCOM allows your applications to be partitioned into three physical tiers and moves some of the workload off of the client machines. For Web sites, this means that part of the workload can be removed from the Web server and placed on an application server. The Web server can service the HTTP requests and the application server can handle the “business logic.”

With CLB, Microsoft extends the SCM to dynamically assign a server within a server farm to handle activation requests of objects. Instead of relying on one machine to process the requests, CLB distributes the load across multiple servers.

Setting Up Component Load Balancing

Figure 1: Application Center MMC snap-in with a routing cluster configured.

CLB is based on the fact that there is one computer or a cluster of computers that receive a request for an object. This server or cluster is called the COM+ routing cluster. It forwards requests to other servers within a COM+ application cluster. The COM+ application cluster is the group of servers that are configured to service requests from a routing cluster. To create a COM+ routing cluster, the Microsoft Management Console (MMC) snap-in for Application Center provides a wizard that steps you through the process. Figure 1 displays a routing cluster called ZodiacCluster in the tree view on the left.

The COM+ routing server must perform two tasks: route requests to the appropriate application server and poll the application servers for information regarding the current load on the server. The data collected is timing data on each component configured to be load balanced on the server. The routing server uses the timing data to rank the servers and control which server will receive the next request.

Figure 2: Setting up the COM+ application cluster.

Once the COM+ routing cluster has been setup, the COM+ application cluster must be configured. Servers can be added to the application cluster through the properties tab of COM+ routing cluster. Figure 2 displays the properties tab with two servers in the application cluster.

Figure 3: Activation settings for classes on a CLB server.

The last configuration that must be made is to configure which components are load balanced. This is performed on a per-class basis. Each class in the application cluster must be declared to support dynamic load balancing. To perform this, an administrator can check off the “Component supports dynamic load balancing” checkbox on the activation page of a class’s property page in the Component Services Explorer as shown in Figure 3.

Turning on this checkbox allows CLB to collect timing data on each component every 200 milliseconds. How the CLB service collects this data is undocumented. Once the components have been configured they can be deployed to each server in the application cluster. Application Center offers tools to help define and deploy the application.

From the client’s standpoint, instantiating objects being load balanced by CLB is the same as instantiating a component using DCOM. All you need to do is pass the name of the CLBS into the CreateObject function or set the RemoteServerName attribute for the component in the registry.

Figure 4: Architecture behind the Component Load Balancing Service.

The CLBS uses two services to manage the routing of activation requests. The first, as mentioned before, is the SCM which runs in the RPCSS service. In addition, Application Center has another service called COMLB. This service is responsible for collecting the timing information and maintaining the ordered list of servers to route requests to. Figure 4 shows the architecture.

In Application Center, the SCM is extended to inspect an ordered list of servers in the COM+ application cluster. This ordered list is maintained by the COMLB service. The listing of servers is maintained in shared memory between the SCM and the COMLB services. In order to keep the listing of servers accurate and determine which server has the lightest load, the COMLB services uses the stub objects in COM+ to intercept the calls and perform some pre and post processing. In MTS, the stub was used to determine how many instances of a class were active.

Once the server has been chosen from the order lists of servers in the shared memory, the COM+ routing server SCM forwards the activation request to the other server’s SCM. If the instantiation of the object fails, the COM+ routing server moves to the next server in a round-robin algorithm and continues until a valid interface pointer is returned to the client. From this point, all communication will occur directly between the client and the server that handled the request.

Issues with Application Center
One problem that arises with CLB is that the configuration of the components must be the same on all of the servers within the application cluster. If one of the servers has a different configuration, random results may occur. If one component was set with a different security setting on servers in the application cluster, users may be able to run the application if the CLB server forwards a request to a server that allows them access, but other times it may forward the request to a server that denies them access. These types of random results would be difficult to track down. To solve this, Microsoft has added tools in Application Center to give administrators the ability to easily deploy applications across multiple computers.

The other issue that arises is performance. By moving the components to another computer throughput will decline. This is true whenever calls are made over a network instead of calling and out-of-process or in-process component on the same server. Initial test show that an out-of-process component on the same server is three times faster then calls to another box and an in-process component on the same server is five times faster. This needs to be considered when you are planning the architecture for your Web site. If throughput is the most critical factor in your Web site, CLB is not the technology for you.

CLB is an extremely useful technology for building highly scalable applications and providing availability to your application servers. It provides the mechanism to route client requests to the least busy server, which results in a quick response time to client applications. This mechanism of finding the least busy server and forwarding requests to other servers is built directly into the COM SCM and a new service called COMLB.



devx-admin

devx-admin

Share the Post:
USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India,

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor

USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies in the USA. Through a

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not

Cybersecurity Strategy

Five Powerful Strategies to Bolster Your Cybersecurity

In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies

Global Layoffs

Tech Layoffs Are Getting Worse Globally

Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data

Huawei Electric Dazzle

Huawei Dazzles with Electric Vehicles and Wireless Earbuds

During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting

Cybersecurity Banking Revolution

Digital Banking Needs Cybersecurity

The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising

FinTech Leadership

Terry Clune’s Fintech Empire

Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned

The Role Of AI Within A Web Design Agency?

In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing

Generative AI Revolution

Is Generative AI the Next Internet?

The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These

Microsoft Laptop

The New Surface Laptop Studio 2 Is Nuts

The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted