Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Exim and SQL Database performance

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


rblayzor.bulk at inoc

Jul 13, 2012, 9:18 AM

Post #1 of 4 (342 views)
Permalink
Exim and SQL Database performance

When using Exim to pull domainlists, say:

domainlist db_localdoms = pgsql;....
domainlist db_relaydoms = pgsql;....
domainlist db_backlisted = pgsql;....


We use the above referenced domainlists extensively throughout the Exim mail routing and ACL's, etc.

The question is, does Exim execute the SQL query each and every time the domainlist is referenced/used? If so, if you have about 20 routers, etc... that seems like an excessive amount; especially if the domainlist isn't expected to change much for a single email transaction.

If this is the case, is there any recommendations other than not using SQL for domainlists and other data that may be pulled and referenced via the whole mail routing/acceptance process?

--
Robert Blayzor
INOC, LLC
rblayzor [at] inoc
http://www.inoc.net/~rblayzor/




--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


jgh at wizmail

Jul 13, 2012, 12:47 PM

Post #2 of 4 (331 views)
Permalink
Re: Exim and SQL Database performance [In reply to]

On 2012-07-13 17:18, Robert Blayzor wrote:
> When using Exim to pull domainlists, say:
>
> domainlist db_localdoms = pgsql;....

Run it with suitable debug, and you'll see results being reused from cache.
It even knows that some SQL ought not to be cached.....
--
Jeremy


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


brent at brentrjones

Jul 13, 2012, 3:18 PM

Post #3 of 4 (330 views)
Permalink
Re: Exim and SQL Database performance [In reply to]

On Fri, Jul 13, 2012 at 12:47 PM, Jeremy Harris <jgh [at] wizmail> wrote:

> On 2012-07-13 17:18, Robert Blayzor wrote:
>
>> When using Exim to pull domainlists, say:
>>
>> domainlist db_localdoms = pgsql;....
>>
>
> Run it with suitable debug, and you'll see results being reused from cache.
> It even knows that some SQL ought not to be cached.....
> --
> Jeremy
>
>
>
> --
> ## List details at https://lists.exim.org/**mailman/listinfo/exim-users<https://lists.exim.org/mailman/listinfo/exim-users>
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>

The lookup caching is only for that specific Exim process, on each new
message, it must perform the lookups again.
Such lookups are pretty trivial though, unless later down in your config
you perform joins and such.

--
Brent Jones
brent [at] brentrjones
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


wbh at conducive

Jul 13, 2012, 4:18 PM

Post #4 of 4 (335 views)
Permalink
Re: Exim and SQL Database performance [In reply to]

Robert Blayzor wrote:
> When using Exim to pull domainlists, say:
>
> domainlist db_localdoms = pgsql;.... domainlist
> db_relaydoms = pgsql;.... domainlist db_backlisted
> = pgsql;....
>
>
> We use the above referenced domainlists extensively throughout the
> Exim mail routing and ACL's, etc.
>
> The question is, does Exim execute the SQL query each and every time
> the domainlist is referenced/used? If so, if you have about 20
> routers, etc... that seems like an excessive amount; especially if
> the domainlist isn't expected to change much for a single email
> transaction.
>
> If this is the case, is there any recommendations other than not
> using SQL for domainlists and other data that may be pulled and
> referenced via the whole mail routing/acceptance process?
>

ISTR that anything of a 'hostlist' or 'domainlist' structure is cached,
regardless of from whence derived. But I've been wrong before..

In any case .. though I've used PostgreSQL extensively within Exim, I do
not use it for either of those, partly 'coz in my case those are very
slow-changing - if not static - lists.

For those that do change more often, I use an lsearch, wildlsearch, or
ipsearch against a simple flat file.

Flat-file can, of course, be one that is generated and published BY an
SQL critter, and updated as often as a 'trigger' or stored procedure
decides.

That way, Exim won't stop transferring mail if the SQL engine goes hors
d' combat for a time. Just soldiers-on with the most-recent file it was
given.

Pretty sure the overall resource load is lessened as well, but have
never actually measured it accurately.

Bill
--
韓家標

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.