[modwsgi] Re: threading.local

2008-10-15 Thread William Dode
On 06-10-2008, William Dode wrote: On 06-10-2008, William Dode wrote: ... The only problem is that there is not a lot of db pool utilities and dbutils is one of the most famous... I reported the problem on the dbutils list DBUtils 1.0rc1 now works with mod_wsgi :-) -- William Dodé

[modwsgi] Re: threading.local

2008-10-07 Thread gert
On Oct 7, 9:58 am, William Dode [EMAIL PROTECTED] wrote: On 06-10-2008, gert wrote: On Oct 6, 11:48 pm, gert [EMAIL PROTECTED] wrote: Will this share connections between requests ? import _mysql db = _mysql.connect('127.0.0.1','root','root','www') def application(environ,

[modwsgi] Re: threading.local

2008-10-07 Thread gert
So will start to figure things out but can i ask a global overall newbie python wsgi question :) x = 1 def application(environ, start_response): status = '200 OK' global x x = x + 1 output = str(x) response_headers = [('Content-type', 'text/html'),('Content- Length',

[modwsgi] Re: threading.local

2008-10-06 Thread gert
Failed requests:9993 But I did have 1564.21 requests per second doh :-) anyway http://87.98.218.86/gil.py seem to work ? http://87.98.218.86/bench.txt (added my apache.conf) http://87.98.218.86/bench.htm So did we find a gil bug in Grahams mighty code ?

[modwsgi] Re: threading.local

2008-10-06 Thread gert
On Oct 6, 10:18 am, Graham Dumpleton [EMAIL PROTECTED] wrote: 2008/10/6 gert [EMAIL PROTECTED]: Failed requests:        9993 But I did have 1564.21 requests per second doh :-) anywayhttp://87.98.218.86/gil.pyseem to work ? http://87.98.218.86/bench.txt(added my apache.conf)

[modwsgi] Re: threading.local

2008-10-06 Thread gert
On Oct 6, 10:33 am, gert [EMAIL PROTECTED] wrote: On Oct 6, 10:18 am, Graham Dumpleton [EMAIL PROTECTED] wrote: 2008/10/6 gert [EMAIL PROTECTED]: Failed requests:        9993 But I did have 1564.21 requests per second doh :-) anywayhttp://87.98.218.86/gil.pyseemto work ?

[modwsgi] Re: threading.local

2008-10-06 Thread William Dode
On 06-10-2008, gert wrote: On Oct 6, 10:33 am, gert [EMAIL PROTECTED] wrote: On Oct 6, 10:18 am, Graham Dumpleton [EMAIL PROTECTED] wrote: 2008/10/6 gert [EMAIL PROTECTED]: Failed requests:        9993 But I did have 1564.21 requests per second doh :-)

[modwsgi] Re: threading.local

2008-10-06 Thread William Dode
On 06-10-2008, William Dode wrote: ... The only problem is that there is not a lot of db pool utilities and dbutils is one of the most famous... I reported the problem on the dbutils list -- William Dodé - http://flibuste.net Informaticien Indépendant

[modwsgi] Re: threading.local

2008-10-06 Thread William Dode
On 04-10-2008, Graham Dumpleton wrote: BTW, if I am right, you would see the behaviour you expect to see if you use: WSGIApplicationGroup %{GLOBAL} More or less, it give me alternatively two differents local instances... But i'm agree with your analyze, that to use threading.local is not

[modwsgi] Re: threading.local

2008-10-06 Thread gert
Will this share connections between requests ? import _mysql db = _mysql.connect('127.0.0.1','root','root','www') def application(environ, start_response): db.query(SELECT test FROM test) row = db.store_result() v = row.fetch_row()[0][0] db.close() response_headers =

[modwsgi] Re: threading.local

2008-10-06 Thread gert
On Oct 6, 11:48 pm, gert [EMAIL PROTECTED] wrote: Will this share connections between requests ? import _mysql db = _mysql.connect('127.0.0.1','root','root','www') def application(environ, start_response):     db.query(SELECT test FROM test)     row = db.store_result()     v =

[modwsgi] Re: threading.local

2008-10-06 Thread Graham Dumpleton
2008/10/6 gert [EMAIL PROTECTED]: On Oct 6, 10:33 am, gert [EMAIL PROTECTED] wrote: On Oct 6, 10:18 am, Graham Dumpleton [EMAIL PROTECTED] wrote: 2008/10/6 gert [EMAIL PROTECTED]: Failed requests:9993 But I did have 1564.21 requests per second doh :-)

[modwsgi] Re: threading.local

2008-10-05 Thread Graham Dumpleton
2008/10/6 gert [EMAIL PROTECTED]: But how would you launch a mysql connection so i can do loc = threading.local() db = loc.db db.execute(SELECT * FROM Graham,()) when WSGIApplicationGroup %{GLOBAL} is set At a guess, something like: import threading local = threading.local() def

[modwsgi] Re: threading.local

2008-10-05 Thread gert
dammit threading sucks :( http://87.98.218.86/bench.txt http://87.98.218.86/bench.htm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups modwsgi group. To post to this group, send email to modwsgi@googlegroups.com To

[modwsgi] Re: threading.local

2008-10-05 Thread Graham Dumpleton
That is because you didn't read the example properly. The threading.local() instance is meant to be at global scope in module. # Global !!! local = threading.local() def application(environ, start_response): try: db = local.db except: local.db =

[modwsgi] Re: threading.local

2008-10-05 Thread gert
But how would you launch a mysql connection so i can do loc = threading.local() db = loc.db db.execute(SELECT * FROM Graham,()) when WSGIApplicationGroup %{GLOBAL} is set --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[modwsgi] Re: threading.local

2008-10-03 Thread William Dode
Maybe more clear : #!/usr/bin/python import cgi import threading import sys import os class MyLoc(threading.local): def __init__(self): print sys.stderr , 'init' myloc = MyLoc() def application(environ, start_response): status = '200 OK' myloc.i = 0 print sys.stderr,

[modwsgi] Re: threading.local

2008-10-03 Thread William Dode
I'll look if i can reproduce this with the code of _threading_local With _threading_local it works (python implementation) import _threading_local class MyLoc(_threading_local.local): [Fri Oct 03 11:47:08 2008] [error] init [Fri Oct 03 11:47:08 2008] [error] pid: 2091 id: 3067888900

[modwsgi] Re: threading.local

2008-10-03 Thread Graham Dumpleton
One possibility is that although you think you are using daemon mode, you aren't, and that Apache compiled with worker MPM. This can occur if you don't have WSGIProcessGroup directive set properly to refer to daemon process group setup using WSGIDaemonProcess. Post the mod_wsgi bits of the