Loading ...
Sorry, an error occurred while loading the content.

Re: Transport maps in MySQL

Expand Messages
  • Reindl Harald
    ... it is not a problem if you have TWO mysqld-hosts with replication because all of this lookups are read-only and you can easily configure postfix to use
    Message 1 of 7 , Mar 7, 2013
    • 0 Attachment
      Am 07.03.2013 21:01, schrieb Noel Jones:
      > On 3/7/2013 1:37 PM, Alfredo Saldanha wrote:
      >> Hi people,
      >>
      >> Simple question:
      >>
      >> Is safe use mysql to get the transport maps information? if the
      >> connection with database drops ? is there cache?
      >>
      >> BR,
      >>
      >> Junix
      >> 
      >
      > The transport table is a critical table used by pretty much every
      > part of postfix (by way of the trivial_rewrite service). If the
      > mysql database is unavailable, no mail will flow. If the lookups
      > are slow, all postfix performance will suffer.
      >
      > While it is certainly possible to successfully use mysql with
      > transport, it will require some care and feeding -- especially for a
      > high-volume server

      it is not a problem if you have TWO mysqld-hosts with
      replication because all of this lookups are read-only
      and you can easily configure postfix to use both servers

      hosts = unix:/var/lib/mysql/mysql.sock inet:ip-of-mysql-slave
    • Alfredo Saldanha
      In line... De: Noel Jones Para: postfix-users@postfix.org Enviadas: Quinta-feira, 7 de Março de 2013 17:01:45 Assunto: Re:
      Message 2 of 7 , Mar 7, 2013
      • 0 Attachment
        In line...

        De: "Noel Jones" <njones@...>
        Para: postfix-users@...
        Enviadas: Quinta-feira, 7 de Março de 2013 17:01:45
        Assunto: Re: Transport maps in MySQL

        On 3/7/2013 1:37 PM, Alfredo Saldanha wrote:
        >> Hi people,
        >>
        >> Simple question:
        >>
        >> Is safe use mysql to get the transport maps information? if the
        >> connection with database drops ? is there cache?
        >>
        >> BR,
        >>
        >> Junix
        >> 

        > The transport table is a critical table used by pretty much every
        >part of postfix (by way of the trivial_rewrite service).  If the
        >mysql database is unavailable, no mail will flow.  If the lookups
        >are slow, all postfix performance will suffer.

        In case of mysql connection drop, Postfix doesn't use the last transport information ?
        And another stuffs that use MySQL, like virtual aliases, users, etc. the message will be rejected ?

        >While it is certainly possible to successfully use mysql with
        >transport, it will require some care and feeding -- especially for a
        >high-volume server.

        OK.

        >Transport tables don't usually change frequently, and it's better to
        >keep that information in a local hash: or cdb: table for both
        >performance and availability.  If you want to keep everything in
        >mysql, consider creating a process to periodically dump the data to
        >a local hash: or cdb: table.

        Thank you Noel.

          -- Noel Jones

        
      • Reindl Harald
        DO NOT POST HTML-MESSAGES ... in short: if you use mysql for your config your mysqld MUST NOT be unreachable, ever at all, if your setup is OK this will never
        Message 3 of 7 , Mar 7, 2013
        • 0 Attachment
          DO NOT POST HTML-MESSAGES

          Am 07.03.2013 21:17, schrieb Alfredo Saldanha:
          > In line...
          > On 3/7/2013 1:37 PM, Alfredo Saldanha wrote:
          >>> Hi people,
          >>>
          >>> Simple question:
          >>>
          >>> Is safe use mysql to get the transport maps information? if the
          >>> connection with database drops ? is there cache?
          >>>
          >>> BR,
          >>>
          >>> Junix
          >>> 
          >
          >> The transport table is a critical table used by pretty much every
          >>part of postfix (by way of the trivial_rewrite service). If the
          >>mysql database is unavailable, no mail will flow. If the lookups
          >>are slow, all postfix performance will suffer.
          >
          > In case of mysql connection drop, Postfix doesn't use the last transport information ?
          > And another stuffs that use MySQL, like virtual aliases, users, etc. the message will be rejected ?
          >
          >>While it is certainly possible to successfully use mysql with
          >>transport, it will require some care and feeding -- especially for a
          >>high-volume server.
          >
          > OK.
          >
          >>Transport tables don't usually change frequently, and it's better to
          >>keep that information in a local hash: or cdb: table for both
          >>performance and availability. If you want to keep everything in
          >>mysql, consider creating a process to periodically dump the data to
          >>a local hash: or cdb: table.

          in short: if you use mysql for your config your mysqld MUST NOT
          be unreachable, ever at all, if your setup is OK this will never
          happen - i am saying this after 5 years dbmail where ANYTHING
          is in a innodb-database, not only postfix-config

          never ever shutdown mysql alone, make sure you always stop any
          mail-service before, make sure any mailservice is stopped before
          mysqld at reboot/shutdown, make sure your mysqld is high available
          with replication and you are fine
        • Alfredo Saldanha
          Sorry, this was my email client. Thank you for answers. ... De: Reindl Harald Para: postfix-users@postfix.org Enviadas:
          Message 4 of 7 , Mar 7, 2013
          • 0 Attachment
            Sorry, this was my email client.

            Thank you for answers.

            ----- Mensagem original -----
            De: "Reindl Harald" <h.reindl@...>
            Para: postfix-users@...
            Enviadas: Quinta-feira, 7 de Março de 2013 17:22:36
            Assunto: Re: Transport maps in MySQL

            DO NOT POST HTML-MESSAGES

            Am 07.03.2013 21:17, schrieb Alfredo Saldanha:
            > In line...
            > On 3/7/2013 1:37 PM, Alfredo Saldanha wrote:
            >>> Hi people,
            >>>
            >>> Simple question:
            >>>
            >>> Is safe use mysql to get the transport maps information? if the
            >>> connection with database drops ? is there cache?
            >>>
            >>> BR,
            >>>
            >>> Junix
            >>>
            >
            >> The transport table is a critical table used by pretty much every
            >>part of postfix (by way of the trivial_rewrite service). If the
            >>mysql database is unavailable, no mail will flow. If the lookups
            >>are slow, all postfix performance will suffer.
            >
            > In case of mysql connection drop, Postfix doesn't use the last transport information ?
            > And another stuffs that use MySQL, like virtual aliases, users, etc. the message will be rejected ?
            >
            >>While it is certainly possible to successfully use mysql with
            >>transport, it will require some care and feeding -- especially for a
            >>high-volume server.
            >
            > OK.
            >
            >>Transport tables don't usually change frequently, and it's better to
            >>keep that information in a local hash: or cdb: table for both
            >>performance and availability. If you want to keep everything in
            >>mysql, consider creating a process to periodically dump the data to
            >>a local hash: or cdb: table.

            in short: if you use mysql for your config your mysqld MUST NOT
            be unreachable, ever at all, if your setup is OK this will never
            happen - i am saying this after 5 years dbmail where ANYTHING
            is in a innodb-database, not only postfix-config

            never ever shutdown mysql alone, make sure you always stop any
            mail-service before, make sure any mailservice is stopped before
            mysqld at reboot/shutdown, make sure your mysqld is high available
            with replication and you are fine
          • Noel Jones
            ... If the transport table is unavailable, no mail will flow -- incoming mail will be deferred, mail in the queue will be temp-failed. There is no cache[1].
            Message 5 of 7 , Mar 7, 2013
            • 0 Attachment
              On 3/7/2013 2:17 PM, Alfredo Saldanha wrote:
              >> The transport table is a critical table used by pretty much every
              >>part of postfix (by way of the trivial_rewrite service). If the
              >>mysql database is unavailable, no mail will flow. If the lookups
              >>are slow, all postfix performance will suffer.
              >
              > In case of mysql connection drop, Postfix doesn't use the last
              > transport information ?
              > And another stuffs that use MySQL, like virtual aliases, users, etc.
              > the message will be rejected ?


              If the transport table is unavailable, no mail will flow -- incoming
              mail will be deferred, mail in the queue will be temp-failed. There
              is no cache[1].

              The transport table is particularly performance sensitive because
              it's used by the single-threaded trivial_rewrite service, which is
              referenced by every part of postfix. For a
              high-volume/high-performance server, it is recommended that
              transport tables use a local hash:, or better, cdb: file. This
              doesn't mean you can't use mysql, but it will require some care to
              insure availability and performance.

              As a general rule, when postfix references ANY table (not just
              mysql), if that table is unavailable an error will be issued and
              mail will be deferred until the table is again working. But not all
              tables are used by all postfix functions, and not all tables have
              the same impact on performance as transport.


              [1] there is a 1-element result cache to prevent postfix from
              looking up the same key repeatedly. This will not prevent table
              errors, nor is it intended to.




              -- Noel Jones
            Your message has been successfully submitted and would be delivered to recipients shortly.