Print Page | Close Window

Database connections?

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: http://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=7118
Printed Date: 24 November 2017 at 9:03pm


Topic: Database connections?
Posted By: yapadu
Subject: Database connections?
Date Posted: 02 September 2015 at 8:46pm
How many connections will a spamfilter server make to the database?

I notice it does a lot of connections at some points, like starting up.  Is there any way to put a limit, like a maximum of 50 database connections at a time?

I can implement a limit on the database level, but I don't want spamfilter to error out if its connection attempt to the database is rejected.


-------------
--------------------------------------------------------------
I am a user of SF, not an employee. Use any advice offered at your own risk.



Replies:
Posted By: LogSat
Date Posted: 02 September 2015 at 10:29pm
SpamFilter will spawn a new thread for each spam email that needs to be archived in the database. So if for example you have 50 inbound SMTP connections, and they are all for spam emails, SpamFilter will launch 50 threads to archive each email in the database.

In addition to this, if there are any *.queued files in the \SpamFilter\quarantine directory, they are emails that were queued for archival but never completed their addition to the database for any reason (database was not available, SpamFilter crashed, etc). SpamFilter processes that directory on interval () and will launch multiple threads to archive those emails in the database (one email per thread). The number of threads spawned is equal to one fourth of the limit for the maximum inbound SMTP connections. So if your limit for max inbound connections is 200, SpamFilter will use 50 threads to process the quarantine directory.

There are a handful of other processes, like checking the database for quarantined emails that need to be delivered, or to delete any old expired emails, but those are executed in a single thread.


-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: yapadu
Date Posted: 03 September 2015 at 4:42am
In mysql you can set a limit on how many connections a user account can make.  I was thinking about putting  a limit on the number of connections spamfilter can make, so I can control the maximum number of connections I need to allocate in mysql.

Since each connection in the pool in mysql consumes ram I was thinking about putting a limit of something like 50. but based on your description if I had 500 inbound connections spamfilter might want to use a large number (like 500).

Hmmm....


-------------
--------------------------------------------------------------
I am a user of SF, not an employee. Use any advice offered at your own risk.



Print Page | Close Window