Skip to content

Rationalize the usage of Connection in the JDBC appender #1916

@ppkarwasz

Description

@ppkarwasz

The JDBC appender takes a very conservative approach to SQL connection sharing:

  1. as most appenders, each append call is synchronized,
  2. each event (or batch of events) is logged using a different Connection object, which is closed at the end of the call,
  3. to prevent the high performance hit from creating many Connections, users are advised to use a connection pool like DBCP2.

This approach has many disadvantages:

  • it does not profit from the connection pool, since at any time at most one connection will be borrowed from the pool,
  • on the other hand users that use DriverManager get a performance hit, even if 1. ensures that no Connection object will be used concurrently on multiple threads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appendersAffects one or more Appender pluginsappenders:JDBCIssue concerning the JDBC appender

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions