Compiling and running 32-bit Python on 64-bit server?

Discussion in 'Python' started by Mikko Ohtamaa, Feb 20, 2010.

  1. Hi,

    Some server-side Python applications are limited by memory usage
    (hint: Zope), because Python effective uses processes and not threads
    for multiprocessing. This is especially true for 64-bit platforms,
    since Python programs are all about references and objects and 64-bit
    effectively doubles reference size.

    Some benchmarks 32-bit vs. 64-bit were discussed here:

    http://jstahl.org/archives/2010/01/2...ks-python-2-6/

    How one could create 32-bit Python run-time enviroment, preferable
    virtualenv, on 64-bit Linux (VPS), reducing memory usage? This
    environment could actually beat 64-bit in performance, due to better
    memory cache use.

    I assume this involves having lib32 libs and compiling Python with
    some magical switches.

    Cheers,
    Mikko
    Mikko Ohtamaa, Feb 20, 2010
    #1
    1. Advertising

  2. > How one could create 32-bit Python run-time enviroment, preferable
    > virtualenv, on 64-bit Linux (VPS), reducing memory usage?


    I'd install a 32-bit Linux on the hardware, and install a bigmem kernel
    if it has more than 3GB of main memory.

    > I assume this involves having lib32 libs and compiling Python with
    > some magical switches.


    The precise set of packages that you will need depends on the specific
    Linux distribution. Check whether "gcc -m32" can build a hello-world
    program. Then, set CC to "gcc -m32", and follow the build instructions
    in Python's README file.

    Regards,
    Martin
    Martin v. Loewis, Feb 20, 2010
    #2
    1. Advertising

  3. Mikko Ohtamaa

    Aahz Guest

    In article <>,
    Mikko Ohtamaa <> wrote:
    >
    >How one could create 32-bit Python run-time enviroment, preferable
    >virtualenv, on 64-bit Linux (VPS), reducing memory usage? This
    >environment could actually beat 64-bit in performance, due to better
    >memory cache use.
    >
    >I assume this involves having lib32 libs and compiling Python with
    >some magical switches.


    The simplest approach would probably be to do the compilation on a 32-bit
    system and just install it on 64-bit. There are some magic flags, yes;
    you'll need to Google using e.g. "linux force 32-bit compile".
    --
    Aahz () <*> http://www.pythoncraft.com/

    "Many customs in this life persist because they ease friction and promote
    productivity as a result of universal agreement, and whether they are
    precisely the optimal choices is much less important." --Henry Spencer
    Aahz, Feb 26, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JohnH.
    Replies:
    1
    Views:
    5,236
    Roedy Green
    Dec 22, 2005
  2. =?Utf-8?B?U3JpZGhhcg==?=

    running 64 bit web application on 32 bit windows server 2003

    =?Utf-8?B?U3JpZGhhcg==?=, Nov 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    344
    =?Utf-8?B?U3JpZGhhcg==?=
    Nov 16, 2006
  3. Replies:
    3
    Views:
    1,720
    Timothy Bendfelt
    Jan 19, 2007
  4. Replies:
    9
    Views:
    942
    Juha Nieminen
    Aug 22, 2007
  5. Eric Promislow
    Replies:
    5
    Views:
    99
    Lloyd Linklater
    Sep 4, 2008
Loading...

Share This Page