durusmail: qp: Site architecture help.
Site architecture help.
2006-05-31
2006-05-31
2006-06-01
2006-06-01
2006-06-01
2006-06-01
2006-06-01
Site architecture help.
mario ruggier
2006-06-01
On Jun 1, 2006, at 12:03 PM, David Binger wrote:

>> admin.example.com -> QP site A -> Durus DB A
>> www.example.com -> QP site B -> Durus DB A
>> another.example.com -> QP site C -> Durus DB A
>>
>> This way we shouldn't need to run an extern Durus instance, QP site A
>> can manage that for us, we get the benefits of being able to manage
>> sites individually and don't require any changes to QP to fake the
>> domains we sit in, request paths etc.
>>
>> Can you see any problems with that kind of setup?
>
> It seems like it would work.
> You'll need to remember to restart all sites if
> the  Durus server for A is restarted.

Unless you do a trick similar to below, to re-establish the connection
automatically should the server go down or the connection is lost for
whatever reason... this is maybe overzealous, that i had written as
protection from the now obsolete durus feature that any non-compliant
request will shut down the server. In your case you would start the db
server for A instead of self.site()'s. Maybe you could also get rid of
the initial call to abort() on each hit... wrap the super's
process_hit() into the exception block?


     def process_hit(self, hit, attempt=0):
         ''' Ensure that the durus server is up, and that this
publisher's
         connection is good. To trigger the potential exception, we do a
         systematic abort() at the start of each request that is anyway
         good Durus practice.
         '''
         if attempt < 3:
             try:
                 self.get_connection().abort()
             except socket.error, (code,message) :
                 if code == 54:
                     print 'Connection reset by peer... restarting durus
server.'
                     self.site.stop_durus()
                     self.site.start_durus()
                 if code in (32,54):
                     print 'Broken pipe... resetting durus connection.'
                     durus_address = self.site.get_durus_address()
                     if durus_address:
                         durus_host, durus_port = durus_address
                         from durus.client_storage import ClientStorage
                         from durus.connection import Connection
                         self.connection = Connection(
                             ClientStorage(port=durus_port,
host=durus_host),
                             cache_size=self.site.get_durus_cache_size()
)
                 self.log_exception()
                 attempt += 1
                 self.process_hit(hit, attempt)
         super(Publisher, self).process_hit(hit)

reply