Connection

#rabbitmq

What is the connection?

Content

TCP-based and assume long-lived connections (a new connection is not opened per protocol operation) for efficiency

  • TCP ๊ธฐ๋ฐ˜, Long Live ํ˜•ํƒœ์˜ ํ†ต์‹ 

  • ํ”„๋กœํ† ์ฝœ๋‹น ์ƒˆ๋กœ์šด ์ปค๋„ฅ์…˜์ด ์—ด๋ฆฌ๋Š” ๊ฑด ์•„๋‹˜.

    • e.g. AMQP 0-9-1, AMQP 1.0

One client library connection uses a single TCP connection

  • ํ•˜๋‚˜์˜ ํด๋ผ์ด์–ธํŠธ๋Š” ํ•˜๋‚˜์˜ TCP ์ปค๋„ฅ์…˜๋งŒ ๊ฐ€์ง€๊ณ ์žˆ์Œ.

Since connections are meant to be long-lived, clients usually consume messages by registering a subscription and having messages delivered (pushed) to them instead of polling.

  • long-live ์ปค๋„ฅ์…˜์„ ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, ํด๋ผ์ด์–ธํŠธ(์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์€) ๋Œ€๋ถ€๋ถ„ ๋ฉ”์„ธ์ง€๋ฅผ ์†Œ๋น„ํ•จ.

  • ํด๋ผ์ด์–ธํŠธ๋Š” polling ๋Œ€์‹  ๊ตฌ๋…์„ ํ•˜๊ณ  ์žˆ๊ณ ..

    • ํด๋ผ์ด์–ธํŠธ๊ฐ€ rabbitmq node์— ๋ฉ”์„ธ์ง€๊ฐ€ ์žˆ๋Š”์ง€ ํ˜น์€ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š”์ง€ ์ฃผ๊ธฐ์ ์œผ๋กœ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ

    • node๊ฐ€ ํด๋ผ์ด์–ธํŠธ์—๊ฒŒ ๋ฉ”์„ธ์ง€๋ฅผ deliverd(pushed) ํ•ด์ค€๋‹ค๋Š” ๋œป์ธ๊ฐ€?

Operating systems have a limit around how many TCP connections (sockets) a single process can have open simultaneously.

  • OS๋Š” ํ•˜๋‚˜์˜ ํ”„๋กœ์„ธ์Šค์—์„œ ๋™์‹œ์— ์—ด ์ˆ˜ ์žˆ๋Š” TCP ์ปค๋„ฅ์…˜ ๊ฐฏ์ˆ˜๊ฐ€ ์ •ํ•ด์ ธ์žˆ์Œ.

  • QA ํ™˜๊ฒฝ์—์„œ๋Š” ์ด ๋ถ€๋ถ„์ด ๋ฌธ์ œ ์—†์—ˆ๋Š”๋ฐ, Prod ํ™˜๊ฒฝ์—์„œ๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„.

References

  • https://www.rabbitmq.com/connections.html#basics

Last updated