CPython thread starvation

Roy Smith roy at panix.com
Sun Apr 29 15:19:09 EDT 2012


In article <7xipgj8vxh.fsf at ruckus.brouhaha.com>,
 Paul Rubin <no.email at nospam.invalid> wrote:

> Roy Smith <roy at panix.com> writes:
> > I agree that application-level name cacheing is "wrong", but sometimes 
> > doing it the wrong way just makes sense.  I could whip up a simple 
> > cacheing wrapper around getaddrinfo() in 5 minutes.  Depending on the 
> > environment (both technology and bureaucracy), getting a cacheing 
> > nameserver installed might take anywhere from 5 minutes to a few days to ...
> 
> IMHO this really isn't one of those times.  The in-app wrapper would
> only be usable to just that process, and we already know that the OP has
> multiple processes running the same app on the same machine.  They would
> benefit from being able to share the cache, so now your wrapper gets
> more complicated.

So, use memcache.  Trivial to set up, easy Python integration, and it 
has the expiration mechanism built in.  Not to mention it has a really 
cute web site (http://memcached.org/).

> Also, since this is a production application, doing something in 5
> minutes is less important than making it solid and configurable.

Maybe.  On the other hand, the time you save with a 5 minute solution 
can be spent solving other, harder, problems.



More information about the Python-list mailing list