Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

2 views
Skip to first unread message

Mikko Ohtamaa

unread,
Feb 20, 2010, 1:48:42 PM2/20/10
to
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

Martin v. Loewis

unread,
Feb 20, 2010, 2:18:05 PM2/20/10
to Mikko Ohtamaa
> 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

Aahz

unread,
Feb 25, 2010, 7:10:57 PM2/25/10
to
In article <d5f0a586-6548-4f25...@q29g2000yqn.googlegroups.com>,

Mikko Ohtamaa <mi...@redinnovation.com> 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 (aa...@pythoncraft.com) <*> 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

0 new messages