Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #3745
| Date | 2011-04-20 16:01 -0400 |
|---|---|
| From | Chris H <chris.humphres@windsorcircle.com> |
| Organization | Windsor Circle |
| Subject | Re: Questions about GIL and web services from a n00b |
| References | <mailman.398.1302885207.9059.python-list@python.org> <d2cc884e-b044-46c1-b42c-18a02ff5f0ee@f31g2000pri.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.668.1303329718.9059.python-list@python.org> (permalink) |
On 4/19/11 3:48 AM, Lamont Nelson wrote: > > 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 Thanks to everyone who has replied. I have a better understanding of the limitations around the GIL as well as the relatively architectures for avoiding the issue. Now to find the right framework for a simple web service. So far I've heard pyramid the most, but others we are looking into include rest.ish.io, web2py, and flask. Anyone with experience across these as to what is best for someone starting from scratch now? Chris
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar
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