Archive for February, 2008

Avoid control panels and use LAMP

If you are planning architecture for a very large online service or website, it’s recommended you avoid control panel software from the very beginning. If you intend to run a web-based service, why do you need running email, DNS and many other services on the same server? How about scalability and performance tuning when load and visitors increase?

The fewer services you run on the server, the harder it is to exploit, and the more system resources will be available for website hosting and script processing. Most web hosting control panels run a lot of software - altering the default configuration of Apache and other software may stop the control panel from running.

For top performance and scalability, you should use Linux, Apache, MySQL and PHP (LAMP). It’s all open-source and reliable, and it runs high-load websites such as LiveJournal, Wordpress.com and many others. As with all open-source technologies, it’s much easier to scale in the future and offers great flexibility - caching, full control over headers (setting expires), application optimization and much more.

When the load grows, you can easily split a MySQL server load to a fully dedicated MySQL server. Afterward, you can install reverse proxy solution or run a proxy server in front of your website to lower the load and scale horizontally by adding multiple servers that process PHP scripts and master-slave MySQL configuration with replication. For MySQL query caching, you can use memcached on multiple servers - this will offload MySQL database servers greatly.

We will go into more detailed tuning of LAMP servers in the near future.

Comments (1)

Bind master configuration and forwarder benchmarking

We performed Bind 9.4.2 benchmarking using our Gigabit network and Linux server nodes. The following performance was easily recorded using one zone and doing IN A requests using queryperf tool.

DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.8.192.4 2007/09/05 07:44:57 marka Exp $

[Status] Processing input data
[Status] Sending queries (beginning with 192.168.3.20)
[Status] Testing complete

Statistics:

Parse input file:     once
Ended due to:         reaching end of file

Queries sent:         514229 queries
Queries completed:    514229 queries
Queries lost:         0 queries
Queries delayed(?):   0 queries

RTT max:              0.000861 sec
RTT min:              0.000172 sec
RTT average:          0.000678 sec
RTT std deviation:    0.000028 sec
RTT out of range:     0 queries

Percentage completed: 100.00%
Percentage lost:        0.00%

Started at:           Tue Feb  5 06:32:42 2008
Finished at:          Tue Feb  5 06:33:00 2008
Ran for:              17.732512 seconds

Queries per second:   28999.219062 qps

When configured with forwarded option - this is when master forwards to a back-end BIND server and then replies back to the client. The following performance was recorded:
DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.8.192.4 2007/09/05 07:44:57 marka Exp $

[Status] Processing input data
[Status] Sending queries (beginning with 192.168.3.10)
[Timeout] Query timed out: msg id 1
[Timeout] Query timed out: msg id 2
[Timeout] Query timed out: msg id 3
[Timeout] Query timed out: msg id 4
[Timeout] Query timed out: msg id 5
[Timeout] Query timed out: msg id 6
[Timeout] Query timed out: msg id 7
[Timeout] Query timed out: msg id 8
[Timeout] Query timed out: msg id 9
[Timeout] Query timed out: msg id 10
[Timeout] Query timed out: msg id 11
[Timeout] Query timed out: msg id 12
[Timeout] Query timed out: msg id 13
[Timeout] Query timed out: msg id 14
[Timeout] Query timed out: msg id 15
[Timeout] Query timed out: msg id 16
[Timeout] Query timed out: msg id 17
[Status] Testing complete

Statistics:

Parse input file:     once
Ended due to:         reaching end of file

Queries sent:         500000 queries
Queries completed:    499983 queries
Queries lost:         17 queries
Queries delayed(?):   0 queries

RTT max:              0.009379 sec
RTT min:              0.000369 sec
RTT average:          0.003022 sec
RTT std deviation:    0.000701 sec
RTT out of range:     0 queries

Percentage completed: 100.00%
Percentage lost:        0.00%

Started at:           Tue Feb  5 06:26:58 2008
Finished at:          Tue Feb  5 06:28:19 2008
Ran for:              80.786053 seconds

Queries per second:   6188.976704 qps

The performance as a standard Bind master server was almost 5 times faster than using 3 node forwarder set-up where one server node was a benchmark traffic generator.

Comments

CAT 5e or CAT 6 cables for server gigabit speeds

Lately, we have been testing our server environment and setting up our Linux powered lab where all servers are connected to 1Gbps managed switches.

One of the first tests we had was testing Ethernet cables - CAT 5e and CAT 6 category cables. CAT 6 is the standard for Gigabit Ethernet and backward compatible with CAT 5 and CAT 5e. CAT 6 provides performance of up to 250 Mhz.

In our tests we will review data transfers between two servers each connected to 1Gbps switch. Our maximum data throughput for these boxes are at around 350Mbps due to network card drivers, depending how we tune network stack and MTU size. You should not pay attention to the maximum bandwidth throughput, but the bandwidth difference between CAT 5e and CAT 6 cables.

CAT 6 cable:
————————————————————
Server listening on TCP port 5001
TCP window size: 260 KByte (WARNING: requested 130 KByte)
————————————————————
[ 4] local 192.168.3.10 port 5001 connected with 192.168.3.20 port 38899
[ 4] 0.0- 1.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 1.0- 2.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 2.0- 3.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 3.0- 4.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 4.0- 5.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 5.0- 6.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 6.0- 7.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 7.0- 8.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 8.0- 9.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 9.0-10.0 sec 37.6 MBytes 315 Mbits/sec
[ 4] 0.0-10.0 sec 376 MBytes 315 Mbits/sec

CAT 5e cable:

————————————————————
Server listening on TCP port 5001
TCP window size: 260 KByte (WARNING: requested 130 KByte)
————————————————————
[ 4] local 192.168.3.10 port 5001 connected with 192.168.3.20 port 4192
[ 4] 0.0- 1.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 1.0- 2.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 2.0- 3.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 3.0- 4.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 4.0- 5.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 5.0- 6.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 6.0- 7.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 7.0- 8.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 8.0- 9.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 9.0-10.0 sec 37.5 MBytes 315 Mbits/sec
[ 4] 0.0-10.0 sec 376 MBytes 315 Mbits/sec

There is no real difference - the speed is the same 315 MBits/sec using CAT 5e or CAT 6 cables.

We tested bandwidth throughput using iperf and CAT 6 cable length was 1.6m (5.24 feet) and CAT 5e cable was 0.6m (1.96 feet). In the future, we will try a few tests more, but we need to get better NIC cards with better drivers for much higher throughput.

Comments (1)