Archive for category Servers

Which RAID is best?

There are many sites with various RAID comparisons on and many more making various claims as to which RAID type is the best for various purposes/fastest/etc.

The 2.5Tb storage partition on my Xen box decided to pack up recently (or at least Xen decided it no longer wanted to read the partition) so after backing up the data decided to run some tests.

Drives: 4x Western Digital RE 1Tb

RAID 5:

This was the original configuration of the array, despite having fast drives in my desktop and 1Gbit network the read speeds were slower than expected (around 35Mb/sec).

The hdparm results were inconsistent:

Timing cached reads: 10118 MB in 2.00 seconds = 5064.59 MB/sec
Timing buffered disk reads: 224 MB in 3.02 seconds = 74.24 MB/sec

Timing cached reads: 10020 MB in 2.00 seconds = 5016.71 MB/sec
Timing buffered disk reads: 148 MB in 3.03 seconds = 48.83 MB/sec

Timing cached reads: 10126 MB in 2.00 seconds = 5068.86 MB/sec
Timing buffered disk reads: 200 MB in 3.03 seconds = 65.94 MB/sec

Timing cached reads: 10086 MB in 2.00 seconds = 5049.90 MB/sec
Timing buffered disk reads: 234 MB in 3.02 seconds = 77.55 MB/sec

Timing cached reads: 10042 MB in 2.00 seconds = 5027.45 MB/sec
Timing buffered disk reads: 210 MB in 3.01 seconds = 69.80 MB/sec

Average over the 5 tests: 67.27 Mb/sec

RAID 10:

As an alternative I switched the array to RAID 10, the downside of this configuration is that there is 1Tb less space than RAID 5.

Timing cached reads: 10170 MB in 2.00 seconds = 5091.34 MB/sec
Timing buffered disk reads: 320 MB in 3.01 seconds = 106.46 MB/sec

Timing cached reads: 10094 MB in 2.00 seconds = 5052.71 MB/sec
Timing buffered disk reads: 316 MB in 3.02 seconds = 104.59 MB/sec

Timing cached reads: 10072 MB in 2.00 seconds = 5041.96 MB/sec
Timing buffered disk reads: 314 MB in 3.01 seconds = 104.29 MB/sec

RAID 10 results are much more consistent.
Average over the 3 tests: 105.11 Mb/sec

RAID 6:

Another configuration offering 2 disk redundancy.

Timing cached reads: 10172 MB in 2.00 seconds = 5091.87 MB/sec
Timing buffered disk reads: 202 MB in 3.01 seconds = 67.06 MB/sec

Timing cached reads: 10052 MB in 2.00 seconds = 5031.76 MB/sec
Timing buffered disk reads: 202 MB in 3.01 seconds = 67.18 MB/sec

Timing cached reads: 10102 MB in 2.00 seconds = 5057.17 MB/sec
Timing buffered disk reads: 206 MB in 3.00 seconds = 68.59 MB/sec

RAID 6 results are also fairly consistent.
Average over the 3 tests: 67.61 Mb/sec

It seams that with this configuration that RAID 5/6 perform at roughly the same speed, however RAID 10 seams to win out on the speed test with over 50% improvement over RAID 5/6.

  • Share/Bookmark

Compile ffmpeg-php for PHP 5.3 (Yes – it DOES work!)

Search Google for a version of ffmpeg-php that works with PHP 5.3 and you will find nothing useful. In fact there are many sites where people claim that it does not work with PHP 5.3. Well, they’re wrong! It’s not the easiest thing to get to work but it DOES work with PHP 5.3. (Scroll down for download link to my version of ffmpeg.so)

I am using Zend Server version of PHP 5.3 on Ubuntu 9.10 RC, this is what I did:

1. Install PHP sources (not 100% sure if this is actually required): sudo apt-get install php-5.3-source-zend-server.
2. Install build tools: sudo apt-get install build-essential
3. Install autoconf: sudo apt-get install autoconf
4. Install ffmpeg: sudo apt-get install ffmpeg
5. Install dev/header packages required to build: sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libgd2-xpm-dev
6. Download latest ffmpeg-php source:



7. tar xjf ffmpeg-php-0.6.0.tbz2
8. cd ffmpeg-php-0.6.0
9. (Zend Server – Optional) PATH=$PATH:/usr/local/zend/bin
10. phpize (produces LOADS of warnings, ignore, this is fine)
11. ./configure –enable-skip-gd-check
12. make
13. Copy ./modules/ffmpeg.so into PHP extensions directory or location of your choice
14. Add to php.ini or custom ini file: extension=ffmpeg.so
15. Restart the web server.

ffmpeg-php is now installed!

Download compiled ffmpeg.so file here: ffmpeg-php-0.6.0-php5.3.tar.gz

This is from my phpinfo:

PHP 5.3 with ffmpeg-php

  • Share/Bookmark

Easy PHP 5.3 installation (Ubuntu)

I’ve been searching around for deb packages for PHP 5.3 for Ubuntu for a while, but not found a solution close to the ease of the original (Debian style) packages with a separate deb package for each extension. I’ve used Dotdeb packages in the past, however there are often small issues with these due to missing libraries (usually due to them being compiled on Debian which has older versions of some libraries than Ubuntu) and there are also some posts on their site in the PHP 5.3 section indicating that there are issues installing these packages on Ubuntu.

The EASY solution: Zend Server Community Edition

Installation:

1. Download the ‘Universal Repository Script’ (ZendServer-4.0.5-RepositoryInstaller-linux.tar.gz) from the Zend website.
2. tar xjf ZendServer-4.0.5-RepositoryInstaller-linux.tar.gz
3. cd ZendServer-RepositoryInstaller-linux
4. sudo ./install_zs.sh 5.3 ce

This will add the Zend repositories to apt and start the installation.

Fix dependency with Ubuntu 9.10 RC (and possibly earlier versions) as Ubuntu 9.10 uses a later version of libkrb53 than Zend packages:

1. Download the Lenny version from Debian for your architecture:



2. Install via dpkg -i

Rerun the Zend installer above after doing this.

Install extra PHP extensions:

sudo apt-get install php-5.3-extra-extensions-zend-server

Access Zend Server to manage PHP:

HTTP: http://localhost:10081/ZendServer
HTTPS: https://localhost:10082/ZendServer

You will probably notice that tonnes of extensions are installed by default, to enable/disable them go to:
Server Setup -> Extensions
Click restart PHP in the bottom right to restart the web server.

To change PHP ini settings go to:
Server Setup -> Directives
Click restart PHP in the bottom right to restart the web server.

As Zend are using Apt PHP packages will be kept up to date as long as you update your system regularly (something which is distinctly lacking in Ubuntu/Debian).

Zend Server also includes script caching by default which should give speed improvements to executing PHP code.

More info on installation can be found here (note this has instructions for PHP 5.2):


  • Share/Bookmark