Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3549

Re: Questions about GIL and web services from a n00b

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!f31g2000pri.googlegroups.com!not-for-mail
From Lamont Nelson <lamont@brightfruits.com>
Newsgroups comp.lang.python
Subject Re: Questions about GIL and web services from a n00b
Date Tue, 19 Apr 2011 00:48:44 -0700 (PDT)
Organization http://groups.google.com
Lines 36
Message-ID <d2cc884e-b044-46c1-b42c-18a02ff5f0ee@f31g2000pri.googlegroups.com> (permalink)
References <mailman.398.1302885207.9059.python-list@python.org>
NNTP-Posting-Host 99.120.73.136
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1303199670 32212 127.0.0.1 (19 Apr 2011 07:54:30 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 19 Apr 2011 07:54:30 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info f31g2000pri.googlegroups.com; posting-host=99.120.73.136; posting-account=5qh9kAoAAABAgwAqKttORFuhwV_0_8UB
User-Agent G2/1.0
X-HTTP-UserAgent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:3549

Show key headers only | View raw


 > 1. Are you sure you want to use python because threading is not
good due
> to the Global Lock (GIL)?  Is this really an issue for multi-threaded
> web services as seems to be indicated by the articles from a Google
> search?  If not, how do you avoid this issue in a multi-threaded process
> to take advantage of all the CPU cores available?

To take advantage of the cores on your server you'll want to consider
a multi-process design instead of multi-threading. You can achieve
this with something like http://projects.unbit.it/uwsgi/, which will
allow you to manage the processes. I've used this behind apache
successfully.

>
> 2. Are there good web services frameworks available for building a REST
> based service?  I admit I have looked at web2py, Django, pyramid/pylons,
> and a few others.  SOAP seems to be pretty well supported but I'm not
> finding the same for quick development of REST based services for
> exchanging JSON or XML formatted data.  This is probably just my n00b
> status, but what tools are best for building a simple REST data exchange
> API?

I've personally used Pyramid to implement REST web services with
multiple data transport formats (json, xml) for the same endpoints
with minimal fuss. It's basically as simple as returning an object
from your view and defining a renderer that knows how to translate
this object to the desired format. Look at
http://docs.pylonsproject.org/projects/pyramid/1.0/narr/renderers.html#views-which-use-a-renderer
and http://docs.pylonsproject.org/projects/pyramid/1.0/narr/viewconfig.html#view-config-chapter
for more information.

Lamont

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Questions about GIL and web services from a n00b Chris H <chris.humphres@windsorcircle.com> - 2011-04-15 12:33 -0400
  Re: Questions about GIL and web services from a n00b sturlamolden <sturlamolden@yahoo.no> - 2011-04-17 07:37 -0700
  Re: Questions about GIL and web services from a n00b sturlamolden <sturlamolden@yahoo.no> - 2011-04-17 08:31 -0700
  Re: Questions about GIL and web services from a n00b Lamont Nelson <lamont@brightfruits.com> - 2011-04-19 00:48 -0700
    Re: Questions about GIL and web services from a n00b Chris H <chris.humphres@windsorcircle.com> - 2011-04-20 16:01 -0400

csiph-web