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

M

Mikko Ohtamaa

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
 
M

Martin v. Loewis

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
 
A

Aahz

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 ([email protected]) <*> 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top