---
title: "Discussion on \"Go 语言实现连接池\" | Hashnode"
description: "Discussion on \"Go 语言实现连接池\". 本篇介绍一个用 go 实现的连接池，针对连接的生命周期的管理十分有帮助。本篇从连接池的设计到实现以及常用场景进行详解。\n\n1. 背景\n连接池 可以说是在开发中非常的常见，各类我们需要与远端保持长连接从而提高服务性能（减少建立连接过程）。\n如：\n\n数据库连接池（MySQL，Redis等）\n消息队列的连接池（即producer端提前建立连接，提升消息产生速率）\n与其他远端服务保持长连接\n\n如果使用一些常见的组件，其 client 端其实已经做好连接池了，我们初始化的时候仅需要设计池子大小，空闲时间等..."
url: "https://hashnode.com/posts/go-connect-pool/62b963ef92447c9aed5bba13"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Go 语言实现连接池](https://yusank.hashnode.dev/go-connect-pool?utm_source=hashnode&utm_medium=feed)

本篇介绍一个用 go 实现的连接池，针对连接的生命周期的管理十分有帮助。本篇从连接池的设计到实现以及常用场景进行详解。 1. 背景 连接池 可以说是在开发中非常的常见，各类我们需要与远端保持长连接从而提高服务性能（减少建立连接过程）。 如： 数据库连接池（MySQL，Redis等） 消息队列的连接池（即producer端提前建立连接，提升消息产生速率） 与其他远端服务保持长连接 如果使用一些常见的组件，其 client 端其实已经做好连接池了，我们初始化的时候仅需要设计池子大小，空闲时间等...

Feb 22, 2022 · 5 min read · yusank.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#connection-pool](https://hashnode.com/tag/connection-pool)

## Written by

[Yusank](https://hashnode.com/@yusank)

@yusank

  
[View profile](https://hashnode.com/@yusank)

Working on go and micro services

I am a backend developer, main language is Golang and work at infrastructure team in a global E-commerce company.

## Responses 1

Markdown supported · ⌘↵ to post

[Yusank](https://hashnode.com/@yusank)

[Sep 2, 2022](https://hashnode.com/posts/go-connect-pool/62b963ef92447c9aed5bba13/comment/6311d54475af73ad1f067693)

test
