How to force web.py to single thread

316 views
Skip to first unread message

Helend

unread,
Jun 21, 2012, 12:17:29 AM6/21/12
to we...@googlegroups.com
Hi,

I am writing a simple web server to handle thousands of request in minute. But I have to make sure every request is completed before processing of a next request.

The server is build with Xampp 1.7.7 (Apache 2.2.21, MySQL 5.5.16). mod_wsgi 3.3, python 2.6, web.py 0.36, window 2008 x64

Are there any ways to it?

Thanks you in advance.

Helend

Anand Chitipothu

unread,
Jun 21, 2012, 4:43:47 AM6/21/12
to we...@googlegroups.com
Use gunicorn with single process.

Anand

Shannon Cruey

unread,
Jun 21, 2012, 10:23:42 AM6/21/12
to we...@googlegroups.com
I had issues with disk based sessions on apache - turns out it was in part because of the threading.

I solved the session issue a different way, but these settings did help, and may guide you into getting apache into single thread mode.

(It was the "processes=1" setting that helped me.  Maybe this will help you too?)

<VirtualHost *:80>
    WSGIScriptAlias / /opt/myapp/web/main.py/
    WSGIDaemonProcess main processes=1 threads=25
    WSGIProcessGroup main
    Alias /static /opt/myapp/web/static/
    <Directory /opt/myapp/web/>
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>



--
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.


Helend

unread,
Jun 21, 2012, 10:15:54 PM6/21/12
to we...@googlegroups.com
Thanks Anand and NSC,

Your methods are only working for linux, not for windows,

I am looking at these pages: http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading and http://pylonsbook.com/en/1.1/the-web-server-gateway-interface-wsgi.html.

It seems this is the only way through changing WSGI environment variables.

Do anyone know how to change environment variable in web.py?

Thanks very much.

Helend
To unsubscribe from this group, send email to webpy+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages