On May 19, 2006, at 3:00 PM, Rick Morrison wrote:

But I've read story after story about the evils of thread-based systems
failing in strange ways under load.
probably because they dont synchronize shared resources properly....it took a very long time for me to get Myghty to be able to reload, recompile and memory-manage components in midstream, as well as read and update the various cache backends, without cracking up under load tests. "ab -c 50" is your friend.

I think I understand that
best-practices for for threaded Paste apps is to leave the global
namespace alone, and start and complete a single request in a single
thread -- "finish what you start". Is that really sufficient for
creating reliable multi-threaded apps under load?
single request per single thread...this is how every threaded web application server ive ever seen *except* for twisted does it.

However, that doesnt mean the thread dies after the request (Python's built-in ThreadingMixIn for use with BaseHTTPServer does do it that way, but also doesnt scale). usually there is a fixed set of "worker" threads started up which handle request after request. if load gets high, then the pool of threads grows temporarily.

this is why I tend to like using something like mod_python with Apache; you get the benefits of your Python program being managed by Apache's very mature and widely used process model (although on unix its usually a forking model and not a threading one).

although i hear Lighthttpd is the bomb too, and i just checked http:// www.bittorrent.com/ which serves millions of hits a day using Myghty and its actually using lighthttpd, which uses a threaded model.

Or is there perhaps
some other concurrency mechanism that will work with SA that we've
missed?

SA is not in the business of concurrency mechanisms at all. the connection pool has a real basic system built upon Queue.Queue, and everything else which is stateful and mutable-in-session (i.e. not a Mapper object which is configurational and isnt expected to change after initial configuration) is unique to the current thread.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to