MySQL, AIX5L and malloc()

Some time ago I get brand new IBM POWER6 server as the replacement for “old” P5 used to host Oracle database. Because we planed to use advanced virtualization with VIOS + LPAR/DLPAR I conceived the idea to use one spare partition for MySQL tests. Because I had no past experience with it and there is not much documentation all around the web, I tried to set-up system and database traditional way. The first problem I hit was memory allocation and I think it is the best place share my remarks. Let’s start from the beginning..

For any reason, you decided to run MySQL database on AIX 5L operating system. You compiled it successfully, configured and.. unluckily database didn’t start due to memory allocation problem?

Basically, for some historical reasons AIX OS will allow your application to allocate maximum 256MB of memory per process by default. To use more, you have to use “Large Address Space” memory model so AIX will split memory into 256MB data segments, making possible to reserve more than one segment per single process.

You may set it up different ways:

  • – using –bmaxdata=0xN000000 option for linker
  • – setting MAXDATA value in LDR_CNTRL as run-time

[ LDR_CNTRL=’MAXDATA=0xN000000′ ] – where N is the number of segments.

So, to make your MySQL working fine:

export LDR_CNTRL=’MAXDATA=0×80000000′

It allows database to allocate 2GB of memory ( 8*256MB ) which is maximum value for 32-bit compiled applications.

But how to deal with 64-bit systems? It’s quite easy, but you have to remember about setting OBJECT_MODE to 64 for both, self-compiled and binary distributed databases. After it, you will be able to set up bigger segments multiplier in MAXDATA variable at run-time.


Share this post

Comments (11)

  • Erkan Reply

    Great! Thx, would you recommend using AIX for MySQL?
    I used AIX in the “old” days. Now we are using Linux and SolarisZones.

    November 4, 2008 at 3:22 am
  • Ender Reply

    I’ve used mysql server 4.1 (4.1.17? binary from on 2 servers with AIX 5.3 (master/replica).
    It used 64 GB of ram without any problem. There was some problems with configuration (aix/mysql) for best performance.
    It worked fine.

    November 4, 2008 at 8:38 am
  • facundo Reply

    hi, i’ve been asking about this setup all around with almost no answer..even in forums..

    did you get any performance numbers?. how did this setup perform against intel platform?.

    which compiler did you use to compile mysql on aix?

    anyone has this kind of info?.

    November 5, 2008 at 11:04 am
  • Piotr Biel Reply


    I did some performance tests, but I have no representative results. For sure, I’d like to perform wide tests in close future (of course I’ll share my results here).

    Regarding to compiler used – MySQL binaries are standard, GCC ones and I used them to tests, but at the same time I compiled it from sources with xlC. I think it will be great idea to check for performance of gcc vs. xlC compiled MySQL..

    November 5, 2008 at 11:34 am
  • Piotr Biel Reply


    As far as I did not test it well in production, I’d rather use Linux or Solaris. It simply decreases probability of hitting potential, undiscovered bugs. There is also not so much info about MySQL + AIX performance. In case of any problems you’ll spend a lot of time looking for solutions or just workarounds, which might not be acceptable while running MySQL in production environment.

    November 5, 2008 at 11:43 am
  • facundo Reply

    thanks a lot for sharing this with us. Im expecting to use this kind of setups in production some day..

    on gcc vs xlC.. my guess is that xlC version of mysql should be fast by far.

    another test is Linux on Power6 and mysql vs AIX and mysql.

    which version of aix are you using?. any chance to know how are this power6 machine configured?.


    November 5, 2008 at 5:52 pm
  • facundo Reply

    when you do your performance test in aix you should take care of the parameters (may defer depending the storage engine in use)
    – minperm
    – maxperm
    – maxclient
    – lru_file_repage

    more on this here:


    November 9, 2008 at 8:26 am
  • peter Reply

    Wow. That is interesting to see so many people running MySQL on AIX.

    November 9, 2008 at 10:38 am
  • facundo Reply

    i work almost mostly with informix and db2 on aix but i think that this params apply to mysql too (with different results depending the storage engine)

    November 9, 2008 at 11:50 am
  • SAM Reply

    Let me give you a little advice for running mysql on aix5.3(powerCPU)

    After a migration from SLES9 (Intel Xeon) to AIX 5.3 (Power6) we run into severe performance problems with MySQL 5.0. (64bit)

    MySQL and IBM Support were involved to analyze, optimize and resolve the troubleticket.

    After recommendation from IBM we have changed vmo parameters and the ratio between real cpu´s and virtual cpu´s. Mysql supplied many new compiled (Xlc + gcc) mysql 5.0.x versions.

    Even though all manufacturer worked together our problems couldn´t be fixed until now.

    Maybe there is an incompatibility between Power6 CPUs and Mysql!?!?!?

    Hope this helps for your decision.


    February 18, 2009 at 2:24 pm
  • Erkan Reply


    you make me post some experiences with solaris on M4000 and T5220.
    To make it short: MySQL performs on Linux on DL 380/285/580/585 much better:-)

    February 18, 2009 at 2:52 pm

Leave a Reply