MALAYSIAN PUBLIC SECTOR OPEN SOURCE SOFTWARE (OSS) PROGRAM
LINUX VIRTUAL SERVER BENCHMARK REPORT MARCH 2008
Linux Virtual Server
COPYRIGHT The copyright to this document is owned by the Government of Malaysia
2 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
TABLE OF CONTENTS Page COPYRIGHT TABLE OF CONTENTS
2 3
1. INTRODUCTION
4
2. PROBLEM DESCRIPTION
4
3. SCOPE OF WORK
4
4. SOFTWARE AND HARDWARE PROVIDED FROM OSCC
5
5. COMPARISON
6
5.1
IP LOAD BALANCING TECHNIQUES
6
5.2
CONNECTION SCHEDULE
8
6. RESULT AND CONCLUSION
9
7. REFERENCES
10
3 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
1.
INTRODUCTION
Clusters are usually deployed to improve performance and/or availability over that provided by a single computer, while typically being much more cost-effective than single computers of comparable speed or availability. In computing, load balancing is a technique used to spread workload among many processes, computers, networks, disks or other resources, so that no single resource is overloaded. The Linux Virtual Server (LVS) as an advanced load balancing solution can be used to build highly scalable and highly available network services. 2.
PROBLEM DESCRIPTION
Web-based application is one of the service provided at OSCC, MAMPU. Examples of web-based application are OSCC portal home and Knowledge Bank. OSCC allocates two servers for web-based applications. With increasing demands from users on OSS applications. OSCC's web-based servers are going to be overwhelmed with workload and thus resulting in slower response times. A cost-effective solution is needed to address this problem before it getting serious. 3.
SCOPE OF WORK
The scope of work are as follows: 1. To identify suitable IP load balancing techniques using Linux Virtual Server to fully utilize the OSCC's hardware capacity. 2. To identify suitable connection scheduling algorithm using Linux Virtual Server to fully utilize the OSCC's hardware capacity. 3. To identify the IP load balancing technique and connection scheduling that could help to increase network scalabality.
4 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
4.
SOFTWARE AND HARDWARE PROVIDED FROM OSCC
OSCC has allocated 2 unit of servers to be used for the project and both servers will have roughly the same capacity. Both servers are fixed with two Network Interface Cards (NICs), one interface on the Internet (public network) and one on the private network, enabling them to regulate traffic between the two networks. One PC will be used as the load balancer. Load balancer will delegate tasks between the two servers. For each servers will be installed with CentOS5 as its operating system.
Figure 4.1 General architecture of LVS
5 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
5.
COMPARISON 5.1
IP LOAD BALANCING TECHNIQUES
The cluster running Linux Virtual Server acts as a load balancer of network connections from clients which uses a single IP address for a service. Load balancer and servers are using IP load balancing technique to communicate with each other. Below is comparison table on IP load balancing techniques:
Linux Virtual Server via Linux Virtual Server via Linux Virtual Server via Network Address IP Tunneling Direct Routing Translation (NAT) Technique definition
NAT allows a single device, such as a router, to act as an agent between the public network and a private network
Connection
Load balancer and real Load balancer and real servers are interconnected server are connected by LAN or WAN by hub or switch
Load balancer and the real servers must have one of their interfaces physically linked by an uninterrupted segment of LAN such as hub or switch
Server requirement
Servers support Transmission Control Protocol/ Internet Protocol (TCP/IP)
LVS via Direct Routing require the server OS has loopback alias interface that does not do ARP response
IP tunneling is a techniques to encapsulate IP datagram within IP datagram, which allows datagrams destined for one IP address to be wrapped and redirected to another IP address
Servers support Transmission Control Protocol/ Internet Protocol (TCP/IP)
Real servers have their loopback alias interfaces configured with the virtual IP address and the load balancer has an interfaces configured with the virtual IP address to accept incoming packets
6 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
Work flow
LVS router receives the request and routes it to the appropriate server. Then, the real server processes the request and returns the packets to the LVS router which uses NAT to replace the address of the real server in the packets with the LVS routers public Virtual IP address
Server gateway The load balancer will act as gateway Scalability
The load balancer tunnels the request packets to the different servers, and the servers process the requests and return the results to the client directly
The load balancer processes only the clientto-server half of a connection, and the response packets can follow separate network routes to the clients
Each real server can have its own router as gateway
Each real server can have its own router as gateway
Support minimum number Support large number of of servers servers
Support large number of servers
7 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
5.2
CONNECTION SCHEDULE
The structure that the IP Virtual Server (IPVS) table takes depends on the scheduling algorithm that the administrator chooses for any given virtual server. Below are comparison table on connection scheduling algorithm:
Round-robin algorithm
Weighted round-robin
Least-connection
Algorithm
algorithm
Definition
Simplest scheduling algorithm directs the network connections to the different servers in the cluster
The weighted round-robin scheduling can treat the real severs of different processing capacities
Least-connection scheduling algorithm directs network connections with the least number of active connections
Work flow
The round-robin DNS resolves the single domain to the different IP addresses, the scheduling granularity is per host, and the caching of DNS hinder the algorithm take effect. Round-robin scheduling is based on first-come firstserved queuing
Servers with higher weights receives new connections first and get more connections than servers with lower weights, and servers with equal weights can get an equal distributions of new equations
Load balancer with leastconnection schedule will distributes more requests to real server with fewer active connections by keeping track of live connections to the real servers through the IP Virtual Server (IPVS) table
Scheduling
Static
Dynamic
Dynamic
Vary processing capacity for each node because we could assign weight that indicates its processing capacity
Each node should have equal processing capacity because it would lead to load imbalance
Server capacity Each node should have equal processing capacity (each node) because it would lead to load imbalance
8 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
6.
RESULT AND CONCLUSION
Reasons for using LVS: 1. The architecture of server cluster is fully transparent to end users, and the users interact with the cluster system as if it were only a single high-performance virtual server. 2. Implementation of three-tier architecture which will prevent clients from directly contacting servers directly, which may have security benefits by hiding the structure of the internal network and preventing attacks on the kernel’s network stack. 3. High availability is provided by detecting node or daemon failures and reconfiguring the system appropriately. After comparing IP load balancing techniques provided with the software and hardware available for the project, we could conclude that Linux Virtual Server via IP Tunneling suit best for the project. Below are the reasons for choosing LVS via IP Tunneling: 1. Since the load balancer only handle incoming request packets and real servers will response directly to the clients, hence load balancer will not overloaded with work and it increase scalability on the network 2. We also could build a virtual proxy server, because when the proxy servers get request, it can access the Internet directly to fetch objects and return them directly to the users. We will be using least-connection scheduling for the IPVS table. Below are the reasons for choosing least-connection for the connection scheduling use in Linux Virtual Server: 1. The servers provided from OSCC have roughly the same capacity, hence it is suitable to apply least-connection scheduling for the IPVS table. 2. Least-connection scheduling can direct end-users service requests to the servers that are least busy and therefore it capable of providing fastest response times. 3. It could increase network scalability because it can delegate works better in the cluster system.
9 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email:
[email protected] Website: http://www.oscc.org.my
Linux Virtual Server
7.
REFERENCE 1. Linux Virtual Server Administration. CentOS. January 15, 2008.
2. Zhang, Wensong. Linux Virtual Server for Scalable Network Service. National Laboratory for Parallel & Distributed Processing, Hunan, China. November 2003. February 20, 2008. <www.linuxvirtualserver.org/ols/lvs.ps.gz> 3. The Linux Virtual Server Project. February 22, 2008.
10 Malaysian Public Sector Open Source Competency Centre (OSCC), 3rd Floor, Apt E302E304, Lot 12076, Persiaran APEC, Enterprise Building, 63000 Cyberjaya Selangor, Malaysia Ph:+603 83191200 Email: [email protected] Website: http://www.oscc.org.my