{"id":12653,"date":"2019-11-07T15:38:46","date_gmt":"2019-11-07T14:38:46","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/"},"modified":"2024-09-10T17:37:43","modified_gmt":"2024-09-10T15:37:43","slug":"connection-pooling-with-pgbouncer","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/","title":{"rendered":"Connection pooling with PgBouncer"},"content":{"rendered":"<p>Some of you may know the case: As soon as the number of users grow, the number of resource problems increases. Have you ever thought about using a connection pooler? Too complex, too much administration effort? In this post I like to explain, how the connection pooler can help you with your memory, as well as showing you the simplicity of setup connection pooling with PgBouncer.<br \/>\n<!--more&gt;--><\/p>\n<h3>Introduction<\/h3>\n<p>By default PostgreSQL forks it&#8217;s main process to child processes for every new connection. In the course of time this can lead to more and more processes on the server. On one hand, this is pretty cool, because it can provide more stability and a nice view of resource utilization per connection. But if there are many short time connections, the disadvantages will predominate. The more connections you have, the more RAM will be used.<br \/>\nThe solution for that problem can be a connection pooler like PgBouncer, an opensource connection pooling middleware espacially designed for Postgres. It will act like a wrapper around the database connections. It has the internals for the connection between the database and the pool, but everything is hidden from the application that connects.<\/p>\n<h3>Installation<\/h3>\n<p>For the installation of pgBouncer you can decide between two possibilities<br \/>\n1. using yum<br \/>\n2. building from git (https:\/\/pgbouncer.github.io\/install.html#building-from-git)<\/p>\n<p>To keep it simple, we go on with method 1.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos-mini:\/u02\/pgdata\/11\/PG1\/ [PG1] sudo yum install pgbouncer\nLoaded plugins: fastestmirror\nDetermining fastest mirrors\nepel\/x86_64\/metalink                                                                |  28 kB  00:00:00\n * base: pkg.adfinis-sygroup.ch\n * epel: pkg.adfinis-sygroup.ch\n * extras: pkg.adfinis-sygroup.ch\n * updates: pkg.adfinis-sygroup.ch\nbase                                                                                | 3.6 kB  00:00:00\nepel                                                                                | 5.3 kB  00:00:00\nextras                                                                              | 2.9 kB  00:00:00\nius                                                                                 | 1.3 kB  00:00:00\npgdg10                                                                              | 3.6 kB  00:00:00\npgdg11                                                                              | 3.6 kB  00:00:00\nupdates                                                                             | 2.9 kB  00:00:00\n(1\/10): base\/7\/x86_64\/group_gz                                                      | 165 kB  00:00:06\n(2\/10): extras\/7\/x86_64\/primary_db                                                  | 153 kB  00:00:00\n(3\/10): epel\/x86_64\/group_gz                                                        |  90 kB  00:00:06\n(4\/10): epel\/x86_64\/primary_db                                                      | 6.9 MB  00:00:08\n(5\/10): epel\/x86_64\/updateinfo                                                      | 1.0 MB  00:00:08\n(6\/10): pgdg11\/7\/x86_64\/primary_db                                                  | 337 kB  00:00:01\n(8\/10): base\/7\/x86_64\/primary_db                                                    | 6.0 MB  00:00:10\n(10\/10): updates\/7\/x86_64\/primary_db                                                | 2.8 MB  00:00:01\n(11\/10): ius\/x86_64\/primary                                                         | 139 kB  00:00:06\n(12\/10): pgdg10\/7\/x86_64\/primary_db                                                 | 384 kB  00:00:06\nius                                                                                              631\/631\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package pgbouncer.x86_64 0:1.12.0-1.rhel7 will be installed\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n===========================================================================================================================================================================================================\n Package                           Arch                                               Version                                                     Repository                                          Size\n===========================================================================================================================================================================================================\nInstalling:\n pgbouncer                         x86_64                                             1.12.0-1.rhel7                                              pgdg10                                             207 k\n\nTransaction Summary\n===========================================================================================================================================================================================================\nInstall  1 Package\n\nTotal download size: 207 k\nInstalled size: 477 k\nIs this ok [y\/d\/N]: y\nDownloading packages:\npgbouncer-1.12.0-1.rhel7.x86_64.rpm                                                                                                                                                | 207 kB  00:00:06\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : pgbouncer-1.12.0-1.rhel7.x86_64                                                                                                                                                     1\/1\n  Verifying  : pgbouncer-1.12.0-1.rhel7.x86_64                                                                                                                                                     1\/1\n\nInstalled:\n  pgbouncer.x86_64 0:1.12.0-1.rhel7\n\nComplete!\n<\/pre>\n<h3>Configuration<\/h3>\n<h4> pgbouncer.ini <\/h4>\n<p>PgBouncer has one central congfiguration file called pgbouncer.ini, per default it is located under \/etc\/pgbouncer and it is used to configure the PgBouncer pool.<br \/>\nYou can define a lot of parameters in this file, most of them commented out by default and you can start with a very minimal configuration. It includes generic settings as logile, listen_addr, listen_port&#8230; as well as connectivity, console access control, admin_users and many, many more. The full list of parameters can be found in the <a href=\"http:\/\/www.pgbouncer.org\/config.html\" target=\"\u201d_blank\u201d\" rel=\"noopener noreferrer\">pgbouncer documentation<\/a>, which is really detailled and gives you a good overview.<br \/>\nLets have a look to a easy sample of pgbouncer.ini file<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ncat \/etc\/pgbouncer\/pgbouncer.ini\n[databases]\nbouncer= host=localhost dbname=bouncer\n\n[pgbouncer]\nlisten_addr=127.0.0.1\nlisten_port= 6432\nauth_type = md5\nauth_file= \/etc\/pgbouncer\/userlist.txt\nadmin_users=bounce\npool_mode=session\nmax_client_conn = 100\ndefault_pool_size = 20\nlogfile = \/etc\/pgbouncer\/log\/pgbouncer.log\npidfile = \/etc\/pgbouncer\/pgbouncer.pid\n<\/pre>\n<p>The ini-file has two sections, first the [database] section defines the alias(es) for the database(s). Just start a new line for every database. You can also define user and port etc. and afterwards the [pgbouncer] section, where the pool configuration is done. You can also start with a very minimal configuration.<\/p>\n<p>One of the most important parameters is pool_mode, which defines how a server connection can be reused. 3 modes can be defined:<br \/>\n&#8211; <strong>session<\/strong>: This is the default value: Connections are released back to the pool after disconnection.<br \/>\n&#8211; <strong>transaction<\/strong>: Releases the connection to the pool once a transaction finishes.<br \/>\n&#8211; <strong>statement<\/strong>: After a query finishes, the connection is released back to he pool.<\/p>\n<p>The other parameters in section pgbouncer shortly explained:<br \/>\nlisten_addr: List of addresses where to listen for TCP connection.<br \/>\nlisten_port: Listening port<br \/>\nadmin_users: Users from the auth_file which get access to a special pgbouncer database. This database provides performance-related information about PgBouncer.<br \/>\nmax_client_conn: This is the maximum number of client connections allowed. The default value is 100, but there is also a formula to calculate the value<br \/>\ndefault_pool_size: The number of server connections allowed per user\/database pair. The default value is 20.<br \/>\nlogfile: This one is self-explaining. The log file location.<br \/>\npidfile: The location of the PID file.<br \/>\nauth_type and auth_file: This two belong together. Auth_type specifies how to authenticate users (pam|hba|md5) against PgBouncer and auth_file contains the usernames and passwords.<\/p>\n<h4>userlist.txt<\/h4>\n<p>As already mentioned this file has a very simple structure, username and password. You can either write the password in plain text or the MD5 has of the password. Of course it is not very secure to put the plain text password in here. <\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ncat \/etc\/pgbouncer\/userlist.txt\n\"bounce\" \"md51db1c086e81505132d1834e06d07420e\"\n\"postgres\" \"md53175bce1d3201d16594cebf9d7eb3f9d\"\n<\/pre>\n<h3> Start PgBouncer<\/h3>\n<p>Now all the configuration is done and PgBouncer can be started. It is possible to start PgBouncer on command line and you see the log output directly:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos-mini:\/etc\/pgbouncer\/ [PG1] \/bin\/pgbouncer pgbouncer.ini\n2019-11-06 19:40:05.862 CET [13498] LOG kernel file descriptor limit: 1024 (hard: 4096); max_client_conn: 100, max expected fd use: 192\n2019-11-06 19:40:05.864 CET [13498] LOG listening on 127.0.0.1:16432\n2019-11-06 19:40:05.864 CET [13498] LOG listening on unix:\/tmp\/.s.PGSQL.16432\n2019-11-06 19:40:05.864 CET [13498] LOG process up: PgBouncer 1.12.0, libevent 2.0.21-stable (epoll), adns: libc-2.17, tls: OpenSSL 1.0.2k-fips  26 Jan 2017\n2019-11-06 19:41:05.868 CET [13498] LOG stats: 0 xacts\/s, 0 queries\/s, in 0 B\/s, out 0 B\/s, xact 0 us, query 0 us, wait 0 us\n2019-11-06 19:41:39.325 CET [13498] LOG C-0x18da360: db1\/user1@127.0.0.1:58648 login attempt: db=db1 user=user1 tls=no\n2019-11-06 19:41:39.326 CET [13498] LOG C-0x18da360: db1\/user1@127.0.0.1:58648 closing because: client unexpected eof (age=0s)\n2019-11-06 19:41:47.577 CET [13498] LOG C-0x18da360: db1\/user1@127.0.0.1:58652 login attempt: db=db1 user=user1 tls=no\n2019-11-06 19:41:47.579 CET [13498] LOG S-0x18e0c30: db1\/user1@[::1]:5432 new connection to server (from [::1]:37654)\n2019-11-06 19:42:05.869 CET [13498] LOG stats: 0 xacts\/s, 0 queries\/s, in 0 B\/s, out 0 B\/s, xact 0 us, query 0 us, wait 157 us\n2019-11-06 19:43:05.872 CET [13498] LOG stats: 0 xacts\/s, 0 queries\/s, in 0 B\/s, out 2 B\/s, xact 1522 us, query 1522 us, wait 0 us\n<\/pre>\n<p>Furthermore it is possible to create a service which starts automatically in the background after every reboot:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ncat \/etc\/systemd\/system\/pgbouncer.service\n[Unit]\nDescription=A lightweight connection pooler for PostgreSQL\nAfter=syslog.target\nAfter=network.target\n\n[Service]\nType=simple\n\nUser=postgres\nGroup=postgres\n\n# Path to the init file\nEnvironment=BOUNCERCONF=\/etc\/pgbouncer\/pgbouncer.ini\n\nPIDFile=\/var\/run\/pgbouncer\/pgbouncer.pid\n\n# Where to send early-startup messages from the server\n# This is normally controlled by the global default set by systemd\n# StandardOutput=syslog\n\nExecStart=\/bin\/pgbouncer ${BOUNCERCONF}\nExecReload=\/bin\/kill -HUP $MAINPID\nKillSignal=SIGINT\n\n# Give a reasonable amount of time for the server to start up\/shut down\nTimeoutSec=300\n\n[Install]\nWantedBy=multi-user.target\npostgres@centos-mini:\/etc\/ [PG1] sudo systemctl start pgbouncer\npostgres@centos-mini:\/etc\/ [PG1] sudo systemctl status pgbouncer\n\u25cf pgbouncer.service - A lightweight connection pooler for PostgreSQL\n   Loaded: loaded (\/etc\/systemd\/system\/pgbouncer.service; disabled; vendor preset: disabled)\n   Active: active (running) since Thu 2019-11-07 15:17:09 CET; 4s ago\n Main PID: 17298 (pgbouncer)\n   CGroup: \/system.slice\/pgbouncer.service\n           \u2514\u250017298 \/bin\/pgbouncer \/etc\/pgbouncer\/pgbouncer.ini\n\nNov 07 15:17:09 centos-mini systemd[1]: Started A lightweight connection pooler for PostgreSQL.\nNov 07 15:17:09 centos-mini pgbouncer[17298]: 2019-11-07 15:17:09.127 CET [17298] LOG kernel file descriptor limit: 1024 (hard: 4096); max_client_conn: 100, max expected fd use: 172\nNov 07 15:17:09 centos-mini pgbouncer[17298]: 2019-11-07 15:17:09.127 CET [17298] LOG listening on 127.0.0.1:6432\nNov 07 15:17:09 centos-mini pgbouncer[17298]: 2019-11-07 15:17:09.127 CET [17298] LOG listening on unix:\/tmp\/.s.PGSQL.6432\nNov 07 15:17:09 centos-mini pgbouncer[17298]: 2019-11-07 15:17:09.127 CET [17298] LOG process up: PgBouncer 1.12.0, libevent 2.0.21-stable (epoll), adns: libc-2.17, tls: OpenSSL 1.0.2k-fips  26 Jan 2017\n15:17:13 postgres@centos-mini:\/etc\/ [PG1]\n<\/pre>\n<p>PgBouncer is running now and you can connect to the database using PgBouncer. <\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos-mini:\/etc\/ [PG1] psql -U bounce -p 6432 -h localhost bouncer\nPassword for user bounce:\npsql (11.4 dbi services build)\nType \"help\" for help.\nbouncer=&gt;\nbouncer=&gt;\n<\/pre>\n<h3>Monitoring<\/h3>\n<p>I already mentioned the admin users before and want to explain them a little bit more detailed now.<br \/>\nPgBouncer allows users with admin rights to connect to the virtual database &#8220;pgbouncer&#8221;. You can use this database to see who is connecting, how many active connections are in a pool and of course many more. As a good starting point, use &#8220;SHOW HELP&#8221; as soon as you are connected.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos-mini:\/etc\/ [PG1] psql -U bounce -p 6432 -h localhost pgbouncer\nPassword for user bounce:\npsql (11.4 dbi services build, server 1.12.0\/bouncer)\nType \"help\" for help.\npgbouncer=# SHOW HELP;\nNOTICE:  Console usage\nDETAIL:\n        SHOW HELP|CONFIG|DATABASES|POOLS|CLIENTS|SERVERS|USERS|VERSION\n        SHOW FDS|SOCKETS|ACTIVE_SOCKETS|LISTS|MEM\n        SHOW DNS_HOSTS|DNS_ZONES\n        SHOW STATS|STATS_TOTALS|STATS_AVERAGES|TOTALS\n        SET key = arg\n        RELOAD\n        PAUSE []\n        RESUME []\n        DISABLE \n        ENABLE \n        RECONNECT []\n        KILL \n        SUSPEND\n        SHUTDOWN\nSHOW\npgbouncer=#\npgbouncer=# SHOW POOLS;\n database  |   user    | cl_active | cl_waiting | sv_active | sv_idle | sv_used | sv_tested | sv_login | maxwait | maxwait_us | pool_mode\n-----------+-----------+-----------+------------+-----------+---------+---------+-----------+----------+---------+------------+-----------\n bouncer   | bounce    |         2 |          0 |         0 |       0 |       1 |         0 |        0 |       0 |          0 | session\n pgbouncer | pgbouncer |         1 |          0 |         0 |       0 |       0 |         0 |        0 |       0 |          0 | statement\n(2 rows)\n\npgbouncer=# SHOW CLIENTS;\n type |  user  | database  | state  |   addr    | port  | local_addr | local_port |      connect_time       |      request_time       | wait | wait_us | close_needed |    ptr    | link | remote_pid | tls\n------+--------+-----------+--------+-----------+-------+------------+------------+-------------------------+-------------------------+------+---------+--------------+-----------+------+------------+-----\n C    | bounce | bouncer   | active | 127.0.0.1 | 40322 | 127.0.0.1  |       6432 | 2019-11-07 15:24:40 CET | 2019-11-07 15:24:40 CET |    0 |       0 |            0 | 0x1bd9598 |      |          0 |\n C    | bounce | bouncer   | active | 127.0.0.1 | 40332 | 127.0.0.1  |       6432 | 2019-11-07 15:25:12 CET | 2019-11-07 15:25:12 CET |    0 |       0 |            0 | 0x1bd97b0 |      |          0 |\n C    | bounce | pgbouncer | active | 127.0.0.1 | 40314 | 127.0.0.1  |       6432 | 2019-11-07 15:21:50 CET | 2019-11-07 15:25:36 CET |  221 |  440169 |            0 | 0x1bd9380 |      |          0 |\n(3 rows)\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>The above configuration is only a simple example how the configuration can look like. Of course there are many more specifics you can define. PgBouncer is a great tools for connection pooling and can help you to scale down the memory usage of your server. The connections of a pool are always available and in contrast to forking processes, it does not need reach out the database to establish a connection every time. The connections are just there.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some of you may know the case: As soon as the number of users grow, the number of resource problems increases. Have you ever thought about using a connection pooler? Too complex, too much administration effort? In this post I like to explain, how the connection pooler can help you with your memory, as well [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[358,77],"type_dbi":[],"class_list":["post-12653","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-connection-pool","tag-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Connection pooling with PgBouncer - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\" \/>\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\" \/>\n<meta property=\"og:description\" content=\"Some of you may know the case: As soon as the number of users grow, the number of resource problems increases. Have you ever thought about using a connection pooler? Too complex, too much administration effort? In this post I like to explain, how the connection pooler can help you with your memory, as well [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-07T14:38:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-10T15:37:43+00:00\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\"},\"headline\":\"Connection pooling with PgBouncer\",\"datePublished\":\"2019-11-07T14:38:46+00:00\",\"dateModified\":\"2024-09-10T15:37:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\"},\"wordCount\":848,\"commentCount\":0,\"keywords\":[\"Connection pool\",\"PostgreSQL\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\",\"name\":\"Connection pooling with PgBouncer - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2019-11-07T14:38:46+00:00\",\"dateModified\":\"2024-09-10T15:37:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connection pooling with PgBouncer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g\",\"caption\":\"Open source Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Connection pooling with PgBouncer - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/","og_locale":"en_US","og_type":"article","og_title":"Connection pooling with PgBouncer","og_description":"Some of you may know the case: As soon as the number of users grow, the number of resource problems increases. Have you ever thought about using a connection pooler? Too complex, too much administration effort? In this post I like to explain, how the connection pooler can help you with your memory, as well [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/","og_site_name":"dbi Blog","article_published_time":"2019-11-07T14:38:46+00:00","article_modified_time":"2024-09-10T15:37:43+00:00","author":"Open source Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Open source Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b"},"headline":"Connection pooling with PgBouncer","datePublished":"2019-11-07T14:38:46+00:00","dateModified":"2024-09-10T15:37:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/"},"wordCount":848,"commentCount":0,"keywords":["Connection pool","PostgreSQL"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/","url":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/","name":"Connection pooling with PgBouncer - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2019-11-07T14:38:46+00:00","dateModified":"2024-09-10T15:37:43+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/connection-pooling-with-pgbouncer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Connection pooling with PgBouncer"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/59554f0d99383431eb6ed427e338952b","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eb4fb12e386e8c41fdef0733e8114594cf2653e4f55e9fa2161442b8eaf3f657?s=96&d=mm&r=g","caption":"Open source Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=12653"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12653\/revisions"}],"predecessor-version":[{"id":34700,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12653\/revisions\/34700"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=12653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=12653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=12653"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=12653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}