On Thu, Jul 16, 2015 at 10:40:04AM -0700, E.B. wrote: > > Using spawn is not mandatory you know. > > Yes, I have been considering alternate to run a external > daemon instead. According to this thread, I undersatnd if > database connections are concern, choice to use external > daemon could be best.
Rather depends on the database backend. Some databases have no problems with thousands of client connections. And you're operating a small site, your actually concurrency will likely be modest. > > You could run a small pool > > (1 or more) of processes each of which handles multiple concurrent > > smtpd connections. > > Sorry, sort of beginner programmer question, to be clear > what you say, concurrent connections would be handled by > a policy server by spawning a new thread when a new connection > is made? I can see this could solve problem if all threads see > the same DB connection. No, I was thinking non-blocking event-based concurrency in a single thread. Multiple threads using a single database connection is likely not supported by most datase client libraries. Of course you could serialize database access across all the threads, which works. Once you bite off the multi-threading bullet, you're writing something akin to a milter, you might consider that framework instead. How about just testing the simplest implementation first though. Just use spawn, with one database connection per process and see how that goes. -- Viktor.