
{"id":3899,"date":"2023-04-12T05:33:40","date_gmt":"2023-04-12T05:33:40","guid":{"rendered":"https:\/\/test.opensource-db.in\/wp1\/?p=3899"},"modified":"2023-04-26T06:19:48","modified_gmt":"2023-04-26T06:19:48","slug":"connection-pooling-with-pgbouncer-a-primer","status":"publish","type":"post","link":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/","title":{"rendered":"Connection Pooling with pgBouncer: A Primer"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"537\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png\" alt=\"\" class=\"wp-image-3905\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png 1024w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-300x157.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-768x403.png 768w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1536x806.png 1536w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-189x99.png 189w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-152x80.png 152w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-394x207.png 394w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-915x480.png 915w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1240x651.png 1240w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image.png 1801w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine that you were running a promotion for your blog or website, and it caught the attention of Sarah Connor, who immediately tweeted a link to your website on her channel. How would you feel about it? Would you feel elated and excited that your website has gone viral and could potentially attract thousands or millions of visitors? Or would this thought make you nervous wondering if your application and database would be able to handle all the visitors and the traffic that is pouring like rain in the Amazon<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, if you truly are in such a situation, it is probably a good thing, and I promise we will do our part to alleviate your anxiety.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When it comes to scalability, application architects resort to different tools and techniques, and one of the most rudimentary, yet under-utilized techniques is Connection pooling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we discuss what Connection Pooling is, and then talk about how we could implement Connection Pooling in a Postgres ecosystem using pgBouncer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to go on the ride? Strap on \u2026<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is Connection Pooling?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, when a user interacts with an application, the application, in turn,&nbsp; requests a connection to the database that serves as a conduit for all the exchanges that happen between the application\/user and the database. This connection would be maintained as long as the user remains active, and the application automatically disconnects from the database when the user logs out or his session gets timed out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, opening a database connection and closing it each time we need to pull some data out of the database can be a costly affair, and people have come up with the idea of a connection pool as a way to offset some of the costs and gain some performance benefit while at it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What exactly is a connection pool then?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, a connection pool is a set of always-on, shared database connections that are recycled for use across multiple users. You could think of it like a bunch of hotlines &#8211; when you need to communicate, you just need to pick up the phone, and you would be instantly connected to the other side.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since these are typically always-on connections, the overheads associated with establishing a connection to the database, as well as releasing the connection after use, are greatly minimized.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is pgBouncer?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.pgbouncer.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">pgBouncer<\/a> is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. pgBouncer either creates a new database connection for a client or reuses an existing connection for the same user and database. When the client disconnects, pgBouncer returns the connection to the pool for re-use.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"503\" height=\"329\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer.jpg\" alt=\"\" class=\"wp-image-3901\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer.jpg 503w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer-300x196.jpg 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer-151x99.jpg 151w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer-122x80.jpg 122w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/Connection-Pooling-with-pgBouncer-_-A-Primer-394x258.jpg 394w\" sizes=\"(max-width: 503px) 100vw, 503px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why do we need pgBouncer?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here are some reasons why you may need pgBouncer:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Improve performance: pgBouncer can help improve database performance by reducing the overhead associated with establishing and closing connections.<\/li><li>Handle connection limits: pgBouncer can handle connection limits, which can be useful in situations where the database server has a limited number of connections available.<\/li><li>Manage connections: pgBouncer allows you to manage connections to the database, such as setting up idle timeout thresholds or limiting the number of connections per user.<\/li><li>Security: pgBouncer can also enhance database security by providing authentication and authorization mechanisms that can help prevent unauthorized access to the database.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How does pgBouncer work?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pgBouncer shares connections in one of three pool modes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Session pooling \u2013 When a client connects, a connection is assigned to it as long as it remains connected. When the client disconnects, the connection is placed back into the pool.<\/li><li>Transaction pooling \u2013 A connection is assigned to a client for the duration of a transaction. When pgBouncer notices the transaction is done, the connection is placed back into the pool. This mode can be used only with applications that do not use features that depend upon a session.<\/li><li>Statement pooling \u2013 Statement pooling is like transaction pooling, but multi-statement transactions are not allowed. This mode is intended to enforce auto-commit mode on the client and is targeted for PL\/Proxy on PostgreSQL.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Install pgBouncer?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>pgBouncer can be installed just like any other Linux packages using apt or yum depending on the Linux distribution.<\/li><li>Here\u2019s the command we used to install pgBouncer on an Ubuntu 22.04 system running Postgres 15.0:<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>sudo apt-get install -y pgbouncer<\/code><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to configure pgBouncer?<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a configuration file: Next, you need to create a configuration file for pgBouncer. The configuration file is usually named <code>pgbouncer.ini<\/code> (located in the \/etc\/pgbouncer folder) and contains various settings such as the database server hostname, port, database name, username, and password.<br><\/li><li>Configure pgBouncer settings: After creating the configuration file, you need to configure pgBouncer settings. This includes setting the maximum number of connections, timeouts, and other parameters that control how pgBouncer operates.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Here is an example configuration file for pgBouncer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;databases]\ntemplate1 = host=127.0.0.1 port=5432 dbname=template1\n&#91;pgbouncer]\nlisten_addr = *\nlisten_port = 6432\nauth_type = md5\nauth_file = \/etc\/pgbouncer\/user.txt\npool_mode = session\nmax_client_conn = 100\ndefault_pool_size = 20\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This configuration file specifies a single database (template1) with the hostname 127.0.0.1 and port 5432. It also sets the maximum number of client connections to 100 and the default pool size to 20. The auth_file setting points to a file containing the usernames and passwords allowed to connect to pgBouncer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Reload pgBouncer:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can use <strong><em>reload <\/em><\/strong>command to reload the configuration file without interrupting the active connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres@localhost:\/etc\/postgresql\/15\/main $&nbsp; psql -p 6432 -U pgbouncer pgbouncer<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pgbouncer=# reload;<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Restart pgBouncer:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To stop pgBouncer:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><code>pgbouncer -d \/etc\/pgbouncer\/pgbouncer.ini -R -s<\/code><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To start pgBouncer:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><code>pgbouncer -d \/etc\/pgbouncer\/pgbouncer.ini<\/code><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When making changes that affect a large number of database users, it is often recommended to stop and start pgBouncer instead of restarting the Postgres database service:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Performance Benefits &#8211; Does pgBouncer really help?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As members of the tech community, we took it upon ourselves to validate if using a Connection Pooling application really helps to improve the database performance, and to what extent, and here is what we found:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(We ran a bare-bones pgBench test with 100 clients and 10000 transactions per client to simulate the load)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Connection Management without pgBouncer:<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Given below output is the result of the without pgBouncer<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres@ubuntu-vm:~$ pgbench -c 100 -j 2 -t 10000 osdb_pgb_test\npgbench (15.0 (Ubuntu 15.0-1.pgdg22.04+1))\nstarting vacuum...end.\ntransaction type: &lt;builtin: TPC-B (sort of)&gt;\nscaling factor: 50\nquery mode: simple\nnumber of clients: 100\nnumber of threads: 2\nmaximum number of tries: 1\nnumber of transactions per client: 10000\nnumber of transactions actually processed: 500000\/500000\nnumber of failed transactions: 0 (0.000%)\nlatency average = 96.766 ms\ninitial connection time = 526.886 ms\ntps = 516.713001 (without initial connection time)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Connection Management with pgBouncer:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Given output is the result of the with pgBouncer<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres@ubuntu-vm:~$ pgbench -c 100 -j 2 -t 10000 osdb_pgb_test\npgbench (15.0 (Ubuntu 15.0-1.pgdg22.04+1))\nstarting vacuum...end.\ntransaction type: &lt;builtin: TPC-B (sort of)&gt;\nscaling factor: 50\nquery mode: simple\nnumber of clients: 100\nnumber of threads: 2\nmaximum number of tries: 1\nnumber of transactions per client: 10000\nnumber of transactions actually processed: 500000\/500000\nnumber of failed transactions: 0 (0.000%)\nlatency average = 60.036 ms\ninitial connection time = 203.134 ms\ntps = 832.838500 (without initial connection time)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see from the above test, the initial connection time and average latency are both reduced by about 50%, and the tps increased by more than 50% in the case of pgBouncer which would be enough to validate our claims.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Conclusion:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pgBouncer is a lightweight open-source connection pooling tool for PostgreSQL that can improve the database performance and reduce the server load by optimizing database connections. It provides different pooling methods for different requirements and provides the users the flexibility to configure it as per their business needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine that you were running a promotion for your blog or website, and it caught the attention of Sarah Connor, [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[65,23,42],"tags":[27,45,29,67,37,24,44,26],"class_list":["post-3899","post","type-post","status-publish","format-standard","hentry","category-pgbouncer","category-postgresql-14","category-postgresql-15","tag-new-features","tag-open-source-databases","tag-performance","tag-pgbouncer","tag-postgres","tag-postgres14","tag-postgres15","tag-postgresql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Connection Pooling with pgBouncer: A Primer - OpenSource DB<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Connection Pooling with pgBouncer: A Primer - OpenSource DB\" \/>\n<meta property=\"og:description\" content=\"Imagine that you were running a promotion for your blog or website, and it caught the attention of Sarah Connor, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenSource DB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-12T05:33:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-26T06:19:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png\" \/>\n<meta name=\"author\" content=\"Taraka Vuyyuru\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:site\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Taraka Vuyyuru\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\"},\"author\":{\"name\":\"Taraka Vuyyuru\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/55546e9ca9552218b9376d4ecc8447a5\"},\"headline\":\"Connection Pooling with pgBouncer: A Primer\",\"datePublished\":\"2023-04-12T05:33:40+00:00\",\"dateModified\":\"2023-04-26T06:19:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\"},\"wordCount\":1089,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png\",\"keywords\":[\"new-features\",\"open-source databases\",\"performance\",\"pgBouncer\",\"postgres\",\"postgres14\",\"postgres15\",\"postgresql\"],\"articleSection\":[\"PgBouncer\",\"PostgreSQL 14\",\"PostgreSQL 15\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\",\"name\":\"Connection Pooling with pgBouncer: A Primer - OpenSource DB\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png\",\"datePublished\":\"2023-04-12T05:33:40+00:00\",\"dateModified\":\"2023-04-26T06:19:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image.png\",\"width\":1801,\"height\":945},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.opensource-db.in\/wp1\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connection Pooling with pgBouncer: A Primer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"name\":\"OpenSource DB\",\"description\":\"Your Trusted OpenSource Databases partner\",\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\",\"name\":\"OPENSOURCE DB PRIVATE LIMITED\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"width\":368,\"height\":120,\"caption\":\"OPENSOURCE DB PRIVATE LIMITED\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\",\"https:\/\/x.com\/opensource_db\",\"https:\/\/www.youtube.com\/channel\/UCmTI5h\",\"https:\/\/www.linkedin.com\/company\/opensource-db\",\"https:\/\/www.instagram.com\/opensource_db\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/55546e9ca9552218b9376d4ecc8447a5\",\"name\":\"Taraka Vuyyuru\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/54256c344d6c1f7dbb87fa257d6e318d1ddcd0a29320b642116bfa20e693616b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/54256c344d6c1f7dbb87fa257d6e318d1ddcd0a29320b642116bfa20e693616b?s=96&d=mm&r=g\",\"caption\":\"Taraka Vuyyuru\"},\"url\":\"https:\/\/test.opensource-db.in\/wp1\/author\/taraka\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Connection Pooling with pgBouncer: A Primer - OpenSource DB","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Connection Pooling with pgBouncer: A Primer - OpenSource DB","og_description":"Imagine that you were running a promotion for your blog or website, and it caught the attention of Sarah Connor, [&hellip;]","og_url":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/","og_site_name":"OpenSource DB","article_publisher":"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","article_published_time":"2023-04-12T05:33:40+00:00","article_modified_time":"2023-04-26T06:19:48+00:00","og_image":[{"url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png","type":"","width":"","height":""}],"author":"Taraka Vuyyuru","twitter_card":"summary_large_image","twitter_creator":"@opensource_db","twitter_site":"@opensource_db","twitter_misc":{"Written by":"Taraka Vuyyuru","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#article","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/"},"author":{"name":"Taraka Vuyyuru","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/55546e9ca9552218b9376d4ecc8447a5"},"headline":"Connection Pooling with pgBouncer: A Primer","datePublished":"2023-04-12T05:33:40+00:00","dateModified":"2023-04-26T06:19:48+00:00","mainEntityOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/"},"wordCount":1089,"commentCount":0,"publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png","keywords":["new-features","open-source databases","performance","pgBouncer","postgres","postgres14","postgres15","postgresql"],"articleSection":["PgBouncer","PostgreSQL 14","PostgreSQL 15"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/","url":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/","name":"Connection Pooling with pgBouncer: A Primer - OpenSource DB","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image-1024x537.png","datePublished":"2023-04-12T05:33:40+00:00","dateModified":"2023-04-26T06:19:48+00:00","breadcrumb":{"@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#primaryimage","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/04\/blog-image.png","width":1801,"height":945},{"@type":"BreadcrumbList","@id":"https:\/\/test.opensource-db.in\/wp1\/connection-pooling-with-pgbouncer-a-primer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.opensource-db.in\/wp1\/"},{"@type":"ListItem","position":2,"name":"Connection Pooling with pgBouncer: A Primer"}]},{"@type":"WebSite","@id":"https:\/\/test.opensource-db.in\/wp1\/#website","url":"https:\/\/test.opensource-db.in\/wp1\/","name":"OpenSource DB","description":"Your Trusted OpenSource Databases partner","publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.opensource-db.in\/wp1\/#organization","name":"OPENSOURCE DB PRIVATE LIMITED","url":"https:\/\/test.opensource-db.in\/wp1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","width":368,"height":120,"caption":"OPENSOURCE DB PRIVATE LIMITED"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","https:\/\/x.com\/opensource_db","https:\/\/www.youtube.com\/channel\/UCmTI5h","https:\/\/www.linkedin.com\/company\/opensource-db","https:\/\/www.instagram.com\/opensource_db\/"]},{"@type":"Person","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/55546e9ca9552218b9376d4ecc8447a5","name":"Taraka Vuyyuru","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/54256c344d6c1f7dbb87fa257d6e318d1ddcd0a29320b642116bfa20e693616b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/54256c344d6c1f7dbb87fa257d6e318d1ddcd0a29320b642116bfa20e693616b?s=96&d=mm&r=g","caption":"Taraka Vuyyuru"},"url":"https:\/\/test.opensource-db.in\/wp1\/author\/taraka\/"}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"Taraka Vuyyuru","author_link":"https:\/\/test.opensource-db.in\/wp1\/author\/taraka\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/extensions\/pgbouncer\/\" rel=\"category tag\">PgBouncer<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-14\/\" rel=\"category tag\">PostgreSQL 14<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-15\/\" rel=\"category tag\">PostgreSQL 15<\/a>","rttpg_excerpt":"Imagine that you were running a promotion for your blog or website, and it caught the attention of Sarah Connor, [&hellip;]","_links":{"self":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/3899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/comments?post=3899"}],"version-history":[{"count":7,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/3899\/revisions"}],"predecessor-version":[{"id":3909,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/3899\/revisions\/3909"}],"wp:attachment":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media?parent=3899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/categories?post=3899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/tags?post=3899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}