LTSPLoadBalancing

Differences between revisions 1 and 7 (spanning 6 versions)
Revision 1 as of 2007-04-18 15:05:29
Size: 4646
Editor: ipn36372-c52610
Comment:
Revision 7 as of 2008-08-06 16:22:43
Size: 2736
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 * '''Launchpad entry''':  * '''Launchpad entry''': https://blueprints.launchpad.net/ubuntu/+spec/edubuntu-load-balancing
Line 10: Line 10:
We will make it easy for a system administrator to configure several edubuntu servers to divide TCs among them evenly. We will make it easy for a system administrator to configure multiple Edubuntu servers to share the tftp/NFS load for TCs. This will provide service redundancy and performance enhancement that will be greatly beneficial when Edubuntu supports local apps (diskless thick clients) in the future.

Note: The original proposal in this spec (session load balancing) has been superseded by https://wiki.ubuntu.com/LDMLoadbalancingSupport .
Line 13: Line 15:
Schools with more thin clients (TCs) than one server can handle currently have to physically partition their networks or use DHCP failover to "load balance" their TCs across multiple servers. Both methods have limitations, because only so much physical partitioning is possible and desirable, and ISC DHCP only supports two failover peers (and the "balancing" with DHCP failover is often uneven). If multiple Edubuntu servers are available it would be best if there is no single point of failure for booting thin clients.
Line 17: Line 19:
 * Freida is the system administrator for a school with 500 TCs, and she regularly has 300 concurrent users. She has three Edubuntu servers accessing common /home directories via NFS, and authenticating via LDAP. She configures the three Edubuntu servers to divide whole login sessions among themselves to share the load of running user applications across the three servers.  * Freida is the system administrator for a school with 500 TCs, and she has three Edubuntu servers configured with https://wiki.ubuntu.com/LDMLoadbalancingSupport. She configures the three Edubuntu servers to let each client select a TFTP/NFS server, so that when one server goes down its TCs can immediately reboot with one of the remaining servers and user downtime is minimal.
Line 19: Line 21:
 * Remus is the system administrator for a school with only 40 TCs, but they are spread out in 12 different classrooms, and he can't afford a fast/big enough system to run Edubuntu for all 40 TCs when they are concurrently used. However, he has four relatively recent desktop systems that he can reprovision to be Edubuntu servers. Remus configures these four systems to divide the TC login sessions among themselves so 40 concurrent sessions will be feasible.  * Romulus is a system administrator using 2 Edubuntu Feisty+''n'' servers with 50 TCs, and he is making extensive use of local apps. At the beginning of each workday, ~45 employees typically boot their TCs and start OpenOffice, GIMP, and Blender within a short window of time, and the load on NFS is significant and causes delays. Romulus configures his two servers to divide the TC NFS root mounts evenly between them, in order to avoid the bottleneck.
Line 22: Line 24:
This "load balancing" spec is concerned with whole login sessions being directed to one server or another.
This "load balancing" spec assumes that authentication and /home are taken care of by other means (such as NFS and LDAP).
This "load balancing" spec does NOT address migration of any sessions or processes from one Edubuntu server to another.
This spec is about TFTP/NFS being shared among multiple servers to provide failover in the case of a server crash, and load balancing for the bright future of Edubuntu with local application support.
This spec is not concerned with login sessions being directed to one server or another (for see https://wiki.ubuntu.com/LDMLoadbalancingSupport).
This spec has nothing to do with migration of any sessions or processes from one Edubuntu server to another.
Line 27: Line 29:
The ltsp_config script sets an environment variable ($SERVER) which is then used by ldm to initiate user sessions on the specified $SERVER. ltsp_config could process a list of Edubuntu servers specified in lts.conf and set $SERVER according to criteria defined by the system administrator.

A reasonable default criterion may be to munge the TC MAC address and deterministically connect to a particular server in the list (if that server is currently available).

Here's some untested sample code for the sake of discussion:
{{{
pick_app_server() {
    # If this is empty we'll detect that below and print a message.
    APP_SERVERS="$*"

    # The character range in the sed command here intentionally has a real tab
    # character in it because busybox sed doesn't understand the \t
    # metacharacter.
    APP_SERVERS=`echo ${APP_SERVERS} | sed 's/[ ��������,]\+/ /g'`
    APP_DONE=0
    while [ "${APP_DONE}" -ne 1 ]; do
        APP_NUM_SERVERS=`echo "${APP_SERVERS}" | wc -w | sed 's/ //g'`

        if [ "${APP_NUM_SERVERS}" -eq 0 ]; then
            echo "No application server found; rebooting in 1 minute." 1>&2
            sleep 60
            reboot
        fi

        if [ "${APP_RANDOM}" = "true" ]; then
            APP_SERVER_IDX=$((${RANDOM}%${APP_NUM_SERVERS}))
        else
            # Do some deterministic munging of the macaddr
            APP_SERVER_IDX=$((1`ifconfig | grep HWaddr | head -n1 | sed 's/[^0-9]//g' | sed 's/^0*//'`%${APP_NUM_SERVERS}))
            APP_SERVER_IDX=$((${APP_SERVER_IDX}%${APP_NUM_SERVERS}))
        fi

        # Increment by one so we don't end up with an index of 0
        APP_SERVER_IDX=$((${APP_SERVER_IDX}+1))
        APP_SERVER=`echo ${APP_SERVERS} | cut -d\ -f ${APP_SERVER_IDX}`

        if [ "${APP_PING}" != "false" ]; then
        # Ping the app server to be sure it's up.
            echo "Pinging $APP_SERVER..." 1>&2
            ping -c 1 "${APP_SERVER}" >/dev/null 2>&1
            if [ "$?" != "0" ]; then
                # Drop the bad server out of our list of potential servers
                APP_SERVERS=`echo ${APP_SERVERS} | sed 's/'${APP_SERVER}' *//'`
                continue
            fi
        fi
        APP_DONE=1
    done
    echo Selected APP_SERVER: ${APP_SERVER} 1>&2
    echo ${APP_SERVER}
}
}}}
TFTP and NFS root are handed to the TCs by DHCP, so the solution will fundamentally involve DHCP. It would be good to automate configuration of this feature as much as possible.
Line 81: Line 32:
DHCP failover seems to be the best plan, but this can use more discussion.

Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

We will make it easy for a system administrator to configure multiple Edubuntu servers to share the tftp/NFS load for TCs. This will provide service redundancy and performance enhancement that will be greatly beneficial when Edubuntu supports local apps (diskless thick clients) in the future.

Note: The original proposal in this spec (session load balancing) has been superseded by https://wiki.ubuntu.com/LDMLoadbalancingSupport .

Rationale

If multiple Edubuntu servers are available it would be best if there is no single point of failure for booting thin clients.

Use cases

  • Freida is the system administrator for a school with 500 TCs, and she has three Edubuntu servers configured with https://wiki.ubuntu.com/LDMLoadbalancingSupport. She configures the three Edubuntu servers to let each client select a TFTP/NFS server, so that when one server goes down its TCs can immediately reboot with one of the remaining servers and user downtime is minimal.

  • Romulus is a system administrator using 2 Edubuntu Feisty+n servers with 50 TCs, and he is making extensive use of local apps. At the beginning of each workday, ~45 employees typically boot their TCs and start OpenOffice, GIMP, and Blender within a short window of time, and the load on NFS is significant and causes delays. Romulus configures his two servers to divide the TC NFS root mounts evenly between them, in order to avoid the bottleneck.

Scope

This spec is about TFTP/NFS being shared among multiple servers to provide failover in the case of a server crash, and load balancing for the bright future of Edubuntu with local application support. This spec is not concerned with login sessions being directed to one server or another (for see https://wiki.ubuntu.com/LDMLoadbalancingSupport). This spec has nothing to do with migration of any sessions or processes from one Edubuntu server to another.

Design

TFTP and NFS root are handed to the TCs by DHCP, so the solution will fundamentally involve DHCP. It would be good to automate configuration of this feature as much as possible.

Implementation

DHCP failover seems to be the best plan, but this can use more discussion.

Code

Data preservation and migration

None.


CategorySpec

Edubuntu/Specifications/LTSPLoadBalancing (last edited 2010-01-21 17:47:17 by 196-210-177-89-wblv-esr-3)