Application Layer Switching Module for Apache

Overview

The mod_layer7 is a load balancing and application layer switching module for Apache HTTP Server. This module works in conjunction with other apache modules such as mod_proxy, mod_cache, mod_deflate and requires no modifications or patches to Apache 2.2.x HTTP server itself.

The embedded Perl interpreter makes it possible to create powerful traffic management and manipulations rules. With these control scripts you can have fine grained control over the HTTP requests and how they are processed.

The mod_layer7 module can be used to:

  1. Improve application performance
  2. Turns Apache into content aware (layer-7) HTTP load balancer that can be deployed to any HTTP based services

  3. Improve service resilience
  4. Enable content aware scriptable traffic management rules
  5. Enable and control HTTP caching features provided by mod_cache
  6. Enable and control HTTP compression features provided by mod_deflate

Supported Features

The mod_layer7 implements many of the features only available on commercial HTTP load balancing and application layer switching products. These features should help you in building scalable and highly available HTTP protocol based services. See features page for more information.

Load Balancing

Web-applications developed without load-balancing in mind might not operate properly in a load-balanced environtment if they are dependend on session data that is stored only on server on which the session was initiated. See session persistence for more information on how mod_layer7 can make sure that this kind of applications do not break by always directing requests to the same server, preserving the session data without requiring that applications be rewritten.

Load Balancing Algorithms

Currently following load balancing algorithms are supported:

  • round-robin
  • weighted round-robin
  • fastest-response-times
  • request-uri-hashing
  • random

Session Persistence

Session persistence ensures that once client has made a request to a specific server (member) in a server pool that subsequent requests are sent to that same pool member. This is crucial for many web-applications to properly maintain application state and session-specific information. When the first request is seen by mod_layer7 module it selects a server using currently configured load balancing methods. On subsequent requests the mod_layer7 will automatically choose the same server to ensure proper operations of the application.

Currently mod_layer7 supports following persistence methods:

  • Cookie based persistence (cookie-insert)
  • IP Address based persistence (source-address learning)

High Availability

Control Scripts

Control scripts are part of mod_layer7 runtime configuration and with these control scripts you can define how HTTP requests are processed. For example iwritten using Perl you can define how HTTP requests are processed. For example it possible to configure mod_layer7 to:

  • Inspect and rewrite incoming HTTP requests as well as outgoing HTTP responses
  • Recognize different types of requests and use desired load balancing pools for each request
  • Programmatically enable and disable different features such as caching or compression

See control script reference manual for more information about these scripts.

Management Interface

RESTful web-service interface for obtaining mod_layer7 runtime configurations, statistics and performing management tasks ...

Management Tools

warning TODO ...

Describe management tools and their usage...

Management Console

This mgmt-console is still a prototype, but hopefully it demonstrates how management interface can be used to build external tools to work in co-operations with mod_layer7.

Command-line tool mgmt-console can be used for viewing mod_layer7 virtual server status, traffic volumes and managing pool members.

management console
  • Put pool members to ENABLED, DISABLED or PERSISTENT_ONLY states.
  • View online statistics of pool performance

This utility is included in mod_layer7 source distribution and it requires:

  • Perl 5 (eg. 5.8.8) and following CPAN modules:
  • JSON
  • Term::ScreenColor
  • Term::ReadLine
  • LWP::UserAgent

Monitoring Service

This monitoring-service component is still a prototype, but hopefully it demonstrates how management interface can be used to build external tools to work in co-operations with mod_layer7.

Monitoring service is additional component that can be used for running periodical service health checks to make sure that all pool members are healthy and that failing nodes are automatically removed from load balancing circulation.

This utility is also written in Perl and it requires:

  • Perl 5 (eg. 5.8.8) and following CPAN modules:
  • Proc::Daemon
  • Proc::PID::File
  • JSON
  • LWP::UserAgent

Monitoring service should be able to monitor pools from multiple apache servers running mod_layer7 virtual servers, but this has never been tested (at all).

Get mod_layer7 for Apache 2.x at SourceForge.net. Fast, secure and Free Open Source software downloads