[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

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

Mikko Ohtamaa

2/20/2010 6:49:00 PM

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-p...

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
2 Answers

Martin v. Loewis

2/20/2010 7:18:00 PM

0

> 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

2/26/2010 12:11:00 AM

0

In article <d5f0a586-6548-4f25-92ab-e723b6313b2b@q29g2000yqn.googlegroups.com>,
Mikko Ohtamaa <mikko@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 (aahz@pythoncraft.com) <*> http://www.python...

"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