Tag Archive - ubuntu

Quick and dirty WordPress speed comparison

This is just a quick benchmark of WordPress release 2.8.6, 2.9.2, 3.0.6, 3.1.4 and 3.2.

The test was done on a 512MB rackspace instance, running Ubuntu 10.10. With the following packages installed with default configuration: libapache2-mod-php5 mysql-server php5-mysql. Benchmark was done with ab, doing 10 000 requests to the front page, over 10 concurrent connections.

This is the result, in requests delivered per second:

Clearly, speed isn’t that much improved with the release of 3.2. However, this benchmark only tested the front page with the sample post.

WordPress 3.2 beta 1 speedtest

With every new WordPress release, things seems to be getting slower. But not anymore? With the release of WordPress 3.2 developers state that performance is getting better.

The test was done on a 512MB rackspace instance, running Ubuntu 10.10. With the following packages installed with default configuration: libapache2-mod-php5 mysql-server php5-mysql. Benchmark was done with ab, doing 10 000 requests to the front page, over 10 concurrent connections. Both blogs used the Twenty Ten 1.2 theme, and the supplied sample post.

This is the result, in requests delivered per second:

As you can see, things aren’t any faster, yet. But this is still a beta, and i only tested the performance of the front page, nothing else. I also tried the Twenty Eleven theme, but that wasn’t any faster.

Rackspace Cloud Servers, US vs UK

Today, Rackspace opened up the beta for Cloud Servers in the UK. This is a quick performance comparison with the US cloud, using SysBench.

The test was done using four servers (two on each site, one 256MB instance and one 512MB). All servers ran Ubuntu 10.10.

Without further ado, here’s the results (less is better).

Product SysBench CPU Sysbench Memory Sysbench File I/O
US 256 4.0s 184.5s 22.6s
US 512 4.0s 185.7s 20.3s
UK 256 4.0s 190.2s 21.4s
UK 512 4.0s 191.1s 18.5s

There seems to be good capacity at both sites, performance was almost identical.

The following commands where used to do the benching, interesting values was the total time to run the test.

sysbench --num-threads=4 --test=cpu run
sysbench --num-threads=4 --test=memory run
sysbench --num-threads=4 --test=fileio --file-test-mode=rndrw prepare
sysbench --num-threads=4 --test=fileio --file-test-mode=rndrw run

IPv6 with Rackspace Cloud Servers

Although Rackspace is working on IPv6 support, it’s always nice to be some steps ahead. The following techniques probably works with other providers as well, providing you have enough access to the virtual server. The tests where done using Ubuntu 10.10, but again, should work well with any Linux distribution.

Tunnelbroker provides free IPv6 tunnels (other providers like SixXS exists, but I wont cover them here).

Start by register an account with Tunnelbroker, when that is done login and choose the option Create Regular Tunnel. The form is pretty straight forward.

IPv4 endpoint is the IP address of your virtual server.

I’ve run some tests with MTR to determine which endpoint offers the best latency, and I came up with the following. But you should probably do your own tests.

Rackspace Site Endpoint Hops Latency
United States Chicago, IL, US [ 209.51.181.2 ] 5 2 ms
United Kingdom London, UK [ 216.66.80.26 ] 5 2 ms

Rackspace peers directly with HE/Tunnelbroker both in US and UK, that’s why these numbers are quite good.

When this is done, go to the tunnel page and scroll down to the Example Configurations section and choose either Linux-route2 or Linux-net-tools (without knowing exactly why, I’d recommend the route2 method). Run the commands as root on your server.

Now, the IP listed under Client IPv6 address is your endpoint IPv6 address, this can be used for services. It’s also possible to allocate a /48 network, but that’s probably not necessary for a single server.

Try it out by running the following comand.

# ping6 ipv6.google.com

Supermaster with PowerDNS

Adding new zones to an existing Bind master/slave setup can be a bit tedious, since NOTIFYs are ignored for zoned not already configured on the slave. PowerDNS solves this problem by introducing something called supermasters. When a supermaster sends a NOTIFY to a slave for a zone that doesn’t already exist, the slave server simply ads it to the database and fetches the data.

As a side note, I’ve previously written about how to sync djbdns zones with rsync.

For this example I’ll be using two Ubuntu 10.10 servers. ns1.example.com with ip address 10.0.0.10 and ns2.example.com with address 10.0.0.20. Start by installing MySQL and PowerDNS on them:

# aptitude install mysql-server pdns-backend-mysql

Create a database named pdns and populate it with the tables described in the documentation.

CREATE TABLE domains (
 id		 INT auto_increment,
 name		 VARCHAR(255) NOT NULL,
 master		 VARCHAR(128) DEFAULT NULL,
 last_check	 INT DEFAULT NULL,
 type		 VARCHAR(6) NOT NULL,
 notified_serial INT DEFAULT NULL, 
 account         VARCHAR(40) DEFAULT NULL,
 primary key (id)
)type=InnoDB;
 
CREATE UNIQUE INDEX name_index ON domains(name);
 
CREATE TABLE records (
  id              INT auto_increment,
  domain_id       INT DEFAULT NULL,
  name            VARCHAR(255) DEFAULT NULL,
  type            VARCHAR(6) DEFAULT NULL,
  content         VARCHAR(255) DEFAULT NULL,
  ttl             INT DEFAULT NULL,
  prio            INT DEFAULT NULL,
  change_date     INT DEFAULT NULL,
  primary key(id)
)type=InnoDB;
 
CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
 
CREATE TABLE supermasters (
  ip VARCHAR(25) NOT NULL, 
  nameserver VARCHAR(255) NOT NULL, 
  account VARCHAR(40) DEFAULT NULL
);
 
GRANT SELECT ON supermasters TO pdns;
GRANT ALL ON domains TO pdns;
GRANT ALL ON records TO pdns;
 
GRANT SELECT ON supermasters TO pdns;
GRANT ALL ON domains TO pdns;
GRANT ALL ON records TO pdns;

Then edit /etc/powerdns/pdns.d/pdns.local on both servers to configure the backend and enable master/slave operation.

For ns1:

allow-axfr-ips=10.0.0.20
disable-axfr=no
master=yes
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=pdns
gmysql-dbname=pdns
gmysql-password=<password>

For ns2:

slave=yes
gmysql-host=127.0.0.1
gmysql-user=pdns
gmysql-dbname=pdns
gmysql-password=<password>

Make sure the new configuration is loaded, on both servers run:

# /etc/init.d/pdns restart

Now, add the supermaster to the database on ns2:

INSERT INTO supermasters (ip, nameserver, account) VALUES ('10.0.0.10', 'ns2.example.com', 'admin');

On ns1, create a domain:

INSERT INTO domains (name, type) VALUES ('example.com', 'MASTER');
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.com', 'ns1.example.com hostmaster.example.com 1', 'SOA', 86400, NULL);
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.com', 'ns1.example.com', 'NS', 86400, NULL);
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.com', 'ns2.example.com', 'NS', 86400, NULL);
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'ns1.example.com', '10.0.0.10', 'A', 86400, NULL);
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'ns2.example.com', '10.0.0.20', 'A', 86400, NULL);

Now try if it works on ns1:

# dig @10.0.0.10 ns example.com
...
;; QUESTION SECTION:
;example.com.			IN	NS

;; ANSWER SECTION:
example.com.		86400	IN	NS	ns2.example.com.
example.com.		86400	IN	NS	ns1.example.com.

;; ADDITIONAL SECTION:
ns2.example.com.	86400	IN	A	10.0.0.10
ns1.example.com.	86400	IN	A	10.0.0.20
...

The tables on ns2 haven’t been populated yet, but if we update the serial on ns1 and trigger a NOTIFY, it will sync up.

UPDATE records SET content = 'ns1.example.com hostmaster.example.com 2' WHERE id = '1';

The zone is now synchronized, try it out.

Also, consider using a web interface for the management, such as Poweradmin.

Page 1 of 3123»