[uWSGI] Problem with multiple processes with httplib.HTTPConnection?

Alan Castro alanclic at gmail.com
Mon Nov 8 20:00:31 CET 2010


It's a pretty simple 'proxy'

Controller:

class ProxyController(BaseController):

    def fetch(self):


        host = request.params.get('host')
        url_f = request.params.get('url')
        data = request.params.get('data')
        method = request.params.get('method')

        headers = {"Content-type": "application/x-www-form-urlencoded"}
        conn = httplib.HTTPConnection(host)
        if method == 'POST':
            conn.request(method, url_f, data, headers)
        else:
            conn.request(method, url_f+'?'+data)

        http_response = conn.getresponse()

        data = http_response.read()
        conn.close()

        return data



On Mon, Nov 8, 2010 at 4:36 PM, Roberto De Ioris <roberto at unbit.it> wrote:

>
> > Hi,
> >
> > I had a little problem with uwsgi with multiple processes (-p 4) and
> > pylons
> > when I use httplib.HTTPConnection in the controller.
> > When I remove the -p 4 everything works just fine.
> > Am I missing something?
> >
> >
>
> It depends on your code, can you post it ?
>
> Theoritcally it should be no difference from single process and multiple
> process.
>
>
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> uWSGI at lists.unbit.it
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.unbit.it/pipermail/uwsgi/attachments/20101108/c6d7c8d1/attachment.htm 


More information about the uWSGI mailing list