Cjoverkill User Manual :: Cluster Setup


CjOverkill versions 5.0.1 and up allow easy cluster setup sharing the same database for big network isntallations.

This manual section will explain the following tasks:

  • Basic Cluster Overview
  • Configuring the Database Server (Normal Configuration)
  • Configuring the Database Server (Large Networks Configuration)
  • Configuring the Web Servers (Separated Sites)
  • Configuring the Web Servers (Load Balancer or RoundRobin Setup)
  • Database Replication and Redundandcy
  • Multisite VirtualHost Configuration

Configuring the Database Server (Normal Configuration)

The default MySQl configuration will work ok for a normal network, but optimizing it will allow CjOverkill to take advantage from the MySQL memory and thread caches resulting in a very big performance boost.

MySQL configurations parameters:

key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

Configuring the Database Server (Large Networks Configuration)

CjOverkill supports MySQL NDBC cluster and InnoDB without much hesitation. The most load intensive tables are the ones that have the logs, like ip log, referrer logs and country logs, also as the stats table. You can change only these tables or the entire database to the format you want.

Large networks may use InnoDB tables in order to load the data into RAM and take advantage of the InnoDB features.

For really large networks running lots of sites and traffic MySQL NDBC cluster option is recommended.

Configuring the Web Servers (Separated Sites)

A good cluster setup for a large traffic network is to have several web servers attending the HTTP requests and a big and stable MySQL server or a MySQL cluster attending the database requests. This network configuration assumes that each web server hosts a given number of sites and the web servers don't share load between them.

Standard schema follows:

Basic cluster setup

Configuring the Web Servers (Load Balancer or RoundRobin Setup)

On larger network clusters it's common practice to share all the information between servers and load balance it between servers using round robin DNS or a load balancer setup. Optionally a NFS or Cluster FS server could be used in order to have a single upload data repository. In this case you must make sure that all the servers have their time synchronized. In most cases this can be done by configuring the server to sync their clocks against an external NTP server.

Advanced web cluster schema follows:

Advanced cluster setup

WARNING: Having the web servers time not sincronized will cause lots of false positives on the anticheat filters and also will make traffic counts inconsistent.

Database Replication and Redundandcy

When installing CjOverkill on a MySQl cluster that uses exclusively MySQL replication you must make sure that CjOverkill uses only the master server. Because CjOverkill needs to write and read information from MySQL all the time, you cannot point the script to the replicated server because that will break MySQL replication due to the fact that MySQL only accepts read requests on the replicated server.

If the main server goes down, you can always switch CjOverkill to the replicated server and it will continue normal operation without losing any data.

Multisite VirtualHost Configuration

CjOverkill uses standard web host domain to discriminate between one site and another. If you use wildcard domains it will work perfectly as long as you add the real domain into the CjOverkill admin as a site in your network. This will allow you to park lots of domains to one single CjOverkill installation (TGP parking).

Virtual Host configuration follows:

ServerName www.parking.com
ServerAlias * *.* *.*.*
DocumentRoot /space/webs/parking/public_html
CustomLog /space/logs/parking-access_log combined
ErrorLog /space/logs/parking-error_log