Skip navigation.

ADOdb 5.12 Released #

After a long pause, a new version. Having young children and a busy work schedule has been keeping me too occupied.

Mostly bug-fixes. Some minor enhancements for Oracle performance monitoring.

Click here to Download.

Regards, John Lim


Postgres: Added information_schema support for postgresql.

Postgres: Use pg_unescape_bytea() in _decode.

oci8: Fix bulk binding with oci8. http://phplens.com/lens/lensforum/msgs.php?id=18786

oci8 perf: added wait evt monitoring. Also db cache advice now handles multiple buffer pools properly.

sessions2: Fixed setFetchMode problem.

sqlite: Some DSN connection settings were not parsed correctly.

mysqli: now GetOne obeys $ADODB_GETONE_EOF;

memcache: compress option did not work. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=18899

Moving to PHP 5.3 #

Now that PHP 5.2 is at the end of life, we are starting to migrate to PHP 5.3.

Here are some of my experiences with our code:

  • The function session_register() is now deprecated. We have created a wrapper function called _session_register with the same functionality.
    
    //-------------------------------------------
    // php 5.3 compat version of session_register
    function _session_register($v)
    {
    global $$v;
    	
    	if (!isset($_SESSION[$v])) {
    		if (!isset($$v)) $$v = null;
    		$_SESSION[$v] =& $$v;
    	} else  $$v =& $_SESSION[$v];
    }
    
  • Legacy PHP4 code with
         $obj = &new ClassName();
    
    has to be converted to
         $obj = new ClassName();
    
  • Lots of other functions have been deprecated, including split(), ereg(), etc. See PHP 5.3 Manual, Deprecated Features.

    Upgrading Zend Server from PHP 5.2 to PHP 5.3

    Backup your php.ini file. Then run the following commands:
    yum remove php-*
    yum remove mod-php-*
    yum install zend-server-php-5.3
    

    After this, you will need to restore back the settings of your php.ini file.

    Hiding Deprecated Warnings

    Set your error_reporting to
    error_reporting(E_ALL & ~E_DEPRECATED);
    

The fine art of application virtualization #

The new 8-core Intel Xeon 7550 processors are extremely powerful and a good platform for virtualised applications. My company is setting up PHP application running on a Xen based virtualisation on two HP Proliant DL580 for a total of 64 cores in a high availability environment. .

Why Virtualise?

First let's investigate why virtualisation is attractive. The advantages are:

  • Simplified maintenance, as all software is running on virtual machines (VMs). Easy to stop and start VMs from the VM server console.
  • High availability is easier to achieve, as you can just restart the VM on a secondary server if the primary server fails, assuming that the VM is stored in shared storage accessible by all servers, using shared storage methods such as NFS, iSCSI or a SAN (Storage Area Network).
  • Able to optimize server hardware utilisation globally as CPUs, memory, hard disk, network resources are all shared.

The disadvantages are strangely enough related to the advantages:

  • The maintenance is simplified, but the initial setup is more complex as not merely do you need to setup the hardware and the operating systems, but you have to plan out the virtual environment, such as the virtual network, and make sure that everything is properly sized as you are buying a few big machines, instead of lots of smaller servers.
  • High availability means you need to invest in high quality shared storage to store the shared VMs, typically a SAN, the SAN switches and the Fibre Channel HBA cards to connect to the SAN switches.
  • Need to over-configure the hardware as there is some overhead in virtualisation, particularly in terms of network I/O and storage I/O. CPU overhead for virtualisation is normally not a concern with modern virtualisation technologies such as VMWare, Xen, or Hyper-V.

In this case, our customer was comfortable with virtualisation, as they are big users of IBM AIX Logical Partitions and VMWare. Secondly, they already operate several large Storage Area Networks, and merely had to upgrade the SAN to support us. Lastly they had the budget to pay for all of this :)

VM Technology

We are using Zend Server CE (PHP 5.2), Apache 2.2 and Oracle 11gR2 running on Red Hat Linux 5.5 and Oracle VM 2.2 (which uses the Xen Hypervisor).

In the VM world, there are 4 main technologies that are popular:

  • VMWare - the market leader, this company has been doing virtualisation for over 10 years and they have good products.
  • Xen Based products - Xen is an open source technology that arose from some research on Hypervisors (the bare metal OS that controls all the virtual machines) done in Cambridge University. Today, several companies offer products using Xen, including Red Hat, Citrix, and Oracle. Has good support for Linux and Windows.
  • KVM - many kernel hackers were dissatisfied with Xen (because the Xen Hypervisor is not Linux-based internally), resulting in the development of KVM, which is fully Linux based. KVM is not as mature as Xen, but improving really fast. Support Linux and Windows.
  • Hyper-V - Microsoft's virtualisation technology. Microsoft is committed to supporting Linux also.

We chose Oracle VM (Xen) because it has good performance with Linux and Oracle databases (naturally). Oracle VM is free with optional paid support available. There are also licensing advantages to using Oracle VM with Oracle databases. Oracle database licensing dictates that if you are using virtualisation technologies such as VMWare and are purchasing CPU licenses, you still have to pay database licenses for all the CPU cores of the server, even if the database VM is using only 1 core. However if you are using Oracle VM, then you only have to pay for the CPU cores you use using; this is known as "hard-partition" licensing in Oracle terminology.

I also have experience with VMWare, and can recommend it as an mature alternative. Apparently the Citrix Xen Server is a good product, but I don't have experience with it.

I will cover more technical details in part 2, which i will be writing in September after I complete this installation.

1 2 3 4 5 6 7 8 9 ...