Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Compiling and running 32-bit Python on 64-bit server?

Reply
Thread Tools

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

 
 
Mikko Ohtamaa
Guest
Posts: n/a
 
      02-20-2010
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
 
Reply With Quote
 
 
 
 
Martin v. Loewis
Guest
Posts: n/a
 
      02-20-2010
> 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
 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      02-26-2010
In article <(E-Mail Removed)>,
Mikko Ohtamaa <(E-Mail Removed)> 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 ((E-Mail Removed)) <*> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 09:47 PM
Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 08:55 PM
Compiling and Running with the JDK Alex Java 14 05-12-2006 05:29 PM
Compiling when libedit is in path Is there a trick to compiling Ruby when libedit must exist in the search path? Can you statically link to readline 5.0 in some manner? -- Lon Baker Lon Baker Ruby 1 03-21-2005 08:57 AM
Compiling and running with different revisions Will Java 1 09-02-2004 03:48 PM



Advertisments