Upgrade to Pro — share decks privately, control downloads, hide ads and more …

goにおける コネクションプールの仕組み を軽く掘って見た

aroon
March 19, 2025

goにおける コネクションプールの仕組み を軽く掘って見た

タイトルの通り

aroon

March 19, 2025
Tweet

More Decks by aroon

Other Decks in Programming

Transcript

  1. 確立したコネクションをたくさん保持できるの? socket() creates an endpoint for communication and returns a

    file descriptor that refers to that endpoint. (linux man pageより引用) → ソケットAPIを利用するとファイルディスクリプタが生 成される
  2. 参考文献 - mita2db. “MySQL Connection Pooling と Persistent Connections はチョット違うという話

    ” .はてなブロ グ. 2020-08-02. https://mita2db.hateblo.jp/entry/2020/08/02/162024. 2025-03-12 - 不明. “Managing connections”. go doc. 不明. https://go.dev/doc/database/manage-connections. 2025-03-12 - Michael Kerrisk. “socket(2) — Linux manual page”. man7.org. 2024-07-23. https://man7.org/linux/man-pages/man2/socket.2.html 2025-03-16 - 不明. “MySQL 9.1.0 Source Code Documentation Connection Phase”. “MySQL 9.1.0 Source Code Documentation”. 不明. https://dev.mysql.com/doc/dev/mysql-server/9.1.0/page_protocol_connection_phase.html 2025-03-19 - Kosei Moriyama.”Go の sql.DB がコネクションプールを管理する仕組み ”. “Please Sleep”. 2020-06-30. https://please-sleep.cou929.nu/go-sql-db-connection-pool.html 2025-03-20