Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a connection pooler for MySQL #125

Closed
Ianleeclark opened this issue May 4, 2016 · 1 comment
Closed

Create a connection pooler for MySQL #125

Ianleeclark opened this issue May 4, 2016 · 1 comment

Comments

@Ianleeclark
Copy link
Owner

Right now with how we connect to MySQL, we open a connection per transaction. It'd be wiser if I created a connection pooler which would hold N open connections and make requests on-demand.

This would cut down on SQL transaction time because we wouldn't have to worry about the overhead in opening a connection every transaction.

@Ianleeclark
Copy link
Owner Author

The sql.DB interface implements a connection pool by itself, so I ought to either share that in the applicaionContext or allow each request to borrow a connection from the connection pool.

@Ianleeclark Ianleeclark reopened this Jun 19, 2016
@Ianleeclark Ianleeclark mentioned this issue Nov 25, 2016
12 tasks
Ianleeclark added a commit that referenced this issue Nov 27, 2016
CHANGE:
  - database/database.go Updating some comments.
  - server/server.go Added a curried `scrapeHandler` which uses a database
    pool.
Ianleeclark added a commit that referenced this issue Nov 27, 2016
ADD:
  - database/database.go:assertOpenConnection() now asserts a passed in
    connection object is not nil, if it is nil then we will open a new
    connection. This massively cuts down on opening/closing of connections
    during runtime vs initialization.

CHANGE:
  - reaper/reaper.go Updating for changes in `database/database.go`. See `ADD`
    section.
  - server/server.go Added a `dbPool` object to the `applicationContext` and
    updated for changes in `database/database.go`.
Ianleeclark added a commit that referenced this issue Nov 27, 2016
Resolving build failures.
@Ianleeclark Ianleeclark mentioned this issue Nov 27, 2016
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant