Connecting Database Server Pools

FlashConnect allows one or more database servers to connect to one or more FlashConnect enabled Web servers. Using server pools other than the default server pool is optional. However, if other server pools are used, the default server pool does not need to be used.

In this example, requests to Web Server 1 can be directed to Database Server 1 or Database Server 2, while requests to Web Server 2 can only be directed to Database Server 2.

These pools enable the distribution of an application across several systems.

WARNING

  • Server Pool names are case sensitive.

  • Also, ensure that the server pool name is not an ADI or data level in the w3lines file.

 

CAUTION

The database server pool name can be a maximum of 15 alphanumeric characters and must include at least one alpha character in the name.

 

NOTE

w3ServerPool is a synonym for w3HostName. In this document, all w3HostName references have been changed to w3ServerPool.

For server pool debugging assistance, see Debugging Server Pools.

The Web servers are directed to different database servers as displayed in this example:

The following example shows which database servers are available to each Web server when a request to the server pool is made.

Requested Pool

Accounting

Payroll

Sales

Web Server 1

Database Server 1 or 2

Database Server 2

Database Server 1 or 2

Web Server 2

Database Server 2

Database Server 2 or 3

Database Server 2 or 3

Specifying the Relationship

Specify which system should process a request and which server pool to use in processing that request. Configure server pools using the FlashConnect Server Pool Maintenance Web page.

Then use the WWW-MANAGER command to implement the configuration at startup. Create a macro containing all of the desired commands, and call that macro from within the user-coldstart macro. The macro should log to the www account, then process commands, and then log back to the dm account. The following w3Config entries are used to establish the connection for the previous examples. Note that the Min, Max, MaxFree, MinFree, Freq, Port, and HB Period are arbitrarily set for this example.

Database Server 1

 

Min

Max

MaxFree

MinFree

Freq

Port

HB Period

Server pool: Accounting

WEBSERVER1

1

3

2

1

60

1505

120

Server pool: Sales

WEBSERVER1

1

3

2

1

60

1505

120

Database Server 2

 

Min

Max

MaxFree

MinFree

Freq

Port

HB Period

Server pool: Accounting

WEBSERVER2

1

3

2

1

60

1505

120

WEBSERVER1

1

3

2

1

60

1505

120

Server pool: Payroll

WEBSERVER1

1

3

2

1

60

1505

120

WEBSERVER2

1

3

2

1

60

1505

120

Server pool: Sales

WEBSERVER1

1

3

2

1

60

1505

120

WEBSERVER2

1

3

2

1

60

1505

120

Database Server 3

 

Min

Max

MaxFree

MinFree

Freq

Port

HB Period

Server pool: Payroll

WEBSERVER1

1

3

2

1

60

1505

120

Server pool: Sales

WEBSERVER2

1

3

2

1

60

1505

120

The following commands manually start the same server pools as the above example:

Database Server 1

WWW-START 1 WEBSERVER1 1505 ACCOUNTING

WWW-START 1 WEBSERVER1 1505 SALES

Database Server 2

WWW-START 1 WEBSERVER1 1505 ACCOUNTING

WWW-START 1 WEBSERVER1 1505 PAYROLL

WWW-START 1 WEBSERVER1 1505 SALES

WWW-START 1 WEBSERVER2 1505 ACCOUNTING

WWW-START 1 WEBSERVER2 1505 PAYROLL

WWW-START 1 WEBSERVER2 1505 SALES

Database Server 3

WWW-START 1 WEBSERVER2 1505 PAYROLL

WWW-START 1 WEBSERVER2 1505 SALES

Assigning the Connection

FlashConnect assigns the connection to any database server that supports that server pool. Use the FlashConnect variable w3ServerPool to specify which pool the FlashConnect enabled Web server should use. In the following examples, Apps represents an item in the w3Apps file.

Using the information in the Web Server 1 row in the table above:

http://WebServer1/cgi-bin/fcisapi.dll?w3exec=Apps &w3ServerPool=Accounting

http://WebServer1/cgi-bin/fcisapi.dll?w3exec=Apps &w3ServerPool=Payroll

Using the information in the Web Server 2 row in the table above:

http://WebServer2/cgi-bin/fcisapi.dll?w3exec=Apps &w3ServerPool=Accounting

http://WebServer2/cgi-bin/fcisapi.dll?w3exec=Apps &w3ServerPool=Payroll

Automatic Load Balancing

When providing the same service on multiple database servers, the load can be automatically balanced between systems using server pools and w3Monitor. This is possible because:

See w3Monitor Application in the FlashConnect Programmer’s Guide for additional information.

To implement automatic load balancing:

  1. Specify the relationship (which system should process a request and which server pool to use in processing that request). See Specifying the Relationship.

  2. Assign the connection (to any database server which supports that server pool). See Assigning the Connection.

  3. Set up w3Monitor on each database server to maintain a minimum of one or more free connections to the Web server.

How it Works:

For example, there are two database servers (A and B) supporting one Web server. Two connections to the default server pool are made from each database server to the Web server (Table 2). w3Monitor is set up on each database server to maintain a minimum of one free connection to the Web server.

Table 1: Two database Servers Support One Web Server

Web Server Connection Number

Host

Assigned

1.

Database A

No

2.

Database A

No

3.

Database B

No

4.

Database B

No

The first two user requests are assigned to connections 1 and 2, both to Database A. At this time, the w3Monitor running on Database A automatically adds one more connection (number 5), as reflected in Table 3.

Table 2: w3Monitor Automatically Adds a Connection

Web Server Connection Number

Host

Assigned

1.

Database A

Yes

2.

Database A

Yes

3.

Database B

No

4.

Database B

No

5.

Database A

No

The third and fourth user requests are assigned to connections 3 and 4, both to Database B. At this time, the w3Monitor running on Database B automatically adds one more connection (number 6) as shown in Table 3.

Table 3: w3Monitor Automatically Adds another Connection

Web Server Connection Number

Host

Assigned

1.

Database A

Yes

2.

Database A

Yes

3.

Database B

Yes

4.

Database B

Yes

5.

Database A

No

6.

Database B

No

From this point forward, as additional connections are requested, they are alternately assigned to each database server. w3Monitor creates additional connections as needed until the configuration limits are reached, thus balancing the load.

As connections are dropped, they are reassigned in connection number order. For example, if connection 1 and 3 are both available, connection 1 is used before connection 3 is used. At the same time, depending on how the w3Monitor is configured, as the load is shed from one database server, connections are dropped to help maintain load balance as the load diminishes.

NOTE

When additional connections are needed, w3Monitor may create more than one connection at a time, slightly changing the balancing pattern from the pattern shown here.

Controlling Server Pools and w3Monitor Manually

Usually WWW-MANAGER is used to start and stop both the server pools and w3Monitor. However, if manual control is needed, or more visibility of w3Monitor’s action is needed, both the server pools and w3Monitor can be manually controlled.

If more visibility of w3Monitor’s activities is needed, w3Monitor can also run from a terminal (for example, by logging to the WWW account from a terminal and typing W3MONITOR-START).

w3Monitor only manages enabled server pools. The WWW-MANAGER, WWW-POOL and WWW-START commands are used to start a server pool, while WWW-STOP and WWW-MANAGER are used to stop a server pool.

NOTE

For information about configuring server pools, see Configuring FlashConnect Server Pools in the FlashConnect Installation Guide.

See Also

Administering Server Pools

Using Server Pools