FW: [Twisted-Python] strange server crash

2009-03-24 Thread Alec Matusis
One more thing: This server has ECC memory, and it also has a BMC controller that externally logs all hardware errors independently of the memory condition. >From what I understand, ECC memory module has an extra memory chip for data >hashes. When data is written into ECC memory, the hash is crea

RE: [Twisted-Python] strange server crash

2009-03-24 Thread Alec Matusis
This server crashed again today, again during maximum load for the day. This time, no errors in the twisted log, and not even a segfault message in /var/log/messages : the pid simply ceased to exist. Once again, this machine runs 8 twisted servers, but this one is slightly different from the othe

Re: [Twisted-Python] db connections

2009-03-24 Thread Rob Hoadley
Sorry I apologize... that email I wrote wasn't very clear. I've done it in the factory like below. Slightly different from Alvin. I've used the factory __init__ to pass on the logical_db information... then I have a dbpool created later. That way I can do development and production based on EN

Re: [Twisted-Python] db connections

2009-03-24 Thread Alvin Delagon
Something like this: from twisted.protocols import basic from twisted.internet import protocol, reactor from twisted.enterprise import adbapi class MyProtocol(basic.LineReceiver): def __init__(self): pass def lineReceived(self, line): ### dbcon can be accessed via self.fa

Re: [Twisted-Python] db connections

2009-03-24 Thread Pet
On Tue, Mar 24, 2009 at 5:04 PM, Rob Hoadley wrote: > You'd want to use a connection pool to manage the db interaction. > Your server is pretty unusable after a db connection failure.  I've > used the connection pool before with a cp_min of 1 and a cp_max of 2. Honestly speaking, I don't understa

Re: [Twisted-Python] db connections

2009-03-24 Thread Pet
On Tue, Mar 24, 2009 at 2:45 PM, Alvin Delagon wrote: > Put self.dbcon in the MyFactory class. MyProtocol instances can access it > via self.factory. Thanks for your help! Could you give me an example? I'm getting an error MyProtocol instance has no attribute 'factory' if I do as you suggested.

Re: [Twisted-Python] db connections

2009-03-24 Thread Rob Hoadley
You'd want to use a connection pool to manage the db interaction. Your server is pretty unusable after a db connection failure. I've used the connection pool before with a cp_min of 1 and a cp_max of 2. http://twistedmatrix.com/documents/8.2.0/api/twisted.enterprise.adbapi.ConnectionPool.html O

Re: [Twisted-Python] db connections

2009-03-24 Thread Alvin Delagon
Put self.dbcon in the MyFactory class. MyProtocol instances can access it via self.factory. On Tue, Mar 24, 2009 at 6:10 PM, Pet wrote: > Hi, > > I've wrote an daemon which does some queries to db and sends response > back to client. Do I need to make for every request from client (new > instan

[Twisted-Python] db connections

2009-03-24 Thread Pet
Hi, I've wrote an daemon which does some queries to db and sends response back to client. Do I need to make for every request from client (new instance of MyProtocol) a new connection to DB? Or can I somehow prepare connection, so I could save some time? Maybe make connection in Factory and pass