pgbouncer

pgbouncer - closing because: unclean server on every connection

纵然是瞬间 提交于 2019-12-09 15:13:53
问题 I'm running Django 1.3 with PostgreSQL 9.1/PostGIS 1.5, psycopg2 2.4.2 and pgbouncer 1.4.2. On every single connection to the database I get a log entry in pgbouncer.log: 2011-11-20 02:15:25.027 29538 LOG S-0x96c2200: app_db/postgres@192.168.171.185:5432 closing because: unclean server (age=0). I can't find any solution to this problem - anybody have an idea why? I've tried reconfiguring pgbouncer (session/transaction mode, different timeouts etc), but to no avail. 回答1: Ok, I think I've

connect C# to PgBouncer

半腔热情 提交于 2019-12-08 14:09:03
问题 I am using C# and PostgreSQL. I have connected to PostgreSQL using Npgsql. Everthing is working fine. Now I want to use connection pooling with the help of PgBouncer tool.Database information has been set to PgBouncer. Because now PgBouncer will take care of connection to PostgreSQL database( If I am wrong, please correct me). But the problem is that , I could not find the way to connect PgBouncer in C#.If anyone has done the same , please tell me. Also is it good to use connection pooling in

PostgreSQL连接池pgbouncer的使用

强颜欢笑 提交于 2019-12-06 07:23:02
今天在虚拟机上整理了下pgbouncer的安装使用过程,记录如下。 说明:pgbouncer是一款轻量级针对postgresql的数据库连接工具,可以对客户端的连接做限制,防止恶意连接,另外也可以减少数据库的实际连接数,从而减少数据库的开销。 环境: VMWARE 8 CentOS 5.7 PG 9.1.2 pgbouncer 1.5.2 libevent-2.0.19 一.安装 1.下载pgbouncer的安装包 http://pgfoundry.org/frs/?group_id=1000258&release_id=1952,本次下载的安装包是pgbouncer-1.5.2.tar.gz 2.下载libevent包 http://monkey.org/~provos/libevent/,见pgbouncer源码包中的Readme 这玩意也是个好东西,在很多地方用到 3.安装libevent $ cd libevent-2.0.19-stable $ ./configure --prefix=/home/postgres/libevent $ make $ make install 4.安装pgbouncer $ cd pgbouncer-1.5.2 $ ./configure --prefix=/home/postgres/pgbouncer/ --with-libevent

Django settings when using pgbouncer

落爺英雄遲暮 提交于 2019-12-06 02:22:00
问题 I have a Django website with Postgresql backend, for which I'm utilizing pgbouncer for db connection pooling (transaction mode). The application and the DB reside on separate servers (1 server each). I have installed pgbouncer on the application server. My question is: what should the config be in settings.py ? Note that I'm using Unix sockets for connecting to pgbouncer. My current settings.py contains: DATABASE_URL = 'postgres://user1:pass1@xx.xxx.xxx.xxx:5432/db1' DATABASES = { 'default':

postgresql数据库连接池pgbouncer

好久不见. 提交于 2019-12-05 10:50:36
前端时间看了看服务器还有多余的内存,由于数据库和程序都在一个服务器上,就想看看有什么提升并发的方法。试用了下 pgbouncer ,记录下。 1.源码安装: wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz $ cd libevent-2.0.21-stable $ ./configure --prefix=/usr/local/libevent $ make $ make install wget http://pgfoundry.org/frs/download.php/3393/pgbouncer-1.5.4.tar.gz $ cd pgbouncer-1.5.4 $ ./configure --prefix=/usr/local/pgbouncer/ --with-libevent=/usr/local/libevent/ $ make $ make install 注意设置libevent 的环境变量不然后面启动 pgbouncer会出错 vim /ect/profile export LD_LIBRARY_PATH=/usr/local/libevent/lib:$LD_LIBRARY_PATH 2.pgbouncer配置 主要两个文件pgbouncer

psycopg2 + pgbouncer. Async mode with gevent error

China☆狼群 提交于 2019-12-04 18:05:38
I've got an application psycopg2 + pgbouncer + gevent. Asynchronous application, ie one process serves multiple requests. Asynchronous access to database appeared in the latest version of psycopg2, if rather then 2.2. But just in this release introduces bug for which there is a lot of disconnections from pgbouncer. In the pgbouncer logs there are entries: 2011-10-04 12:16:38.972 4590 LOG C-0x1b3f490: database/user@10.58.65.143:43849 login successful: db=database user=user 2011-10-04 12:16:38.972 4590 LOG C-0x1b3f0a0: database/user@10.58.65.143:43850 login successful: db=database user=user 2011

Prepared Statement doesn't exist

妖精的绣舞 提交于 2019-12-04 08:35:02
Currently running a simple sinatra app, using passenger, and using pgbouncer for connection pooling to a database on the same server as the app. Currently I am intermittently getting a PG error that the prepared statement "a\d" doesn't exist. A PG::Error occurred in #: ERROR: prepared statement "a2" does not exist the ruby code that is executed before the error def self.get_ownership_record(id, key) self.where("user_id=? AND key=?", id, key ).first end pgbouncer config ; ######################################################### ; ############# SECTION HEADER [DATABASES] ################ ; ####

Django settings when using pgbouncer

余生颓废 提交于 2019-12-04 07:31:00
I have a Django website with Postgresql backend, for which I'm utilizing pgbouncer for db connection pooling (transaction mode). The application and the DB reside on separate servers (1 server each). I have installed pgbouncer on the application server. My question is: what should the config be in settings.py ? Note that I'm using Unix sockets for connecting to pgbouncer. My current settings.py contains: DATABASE_URL = 'postgres://user1:pass1@xx.xxx.xxx.xxx:5432/db1' DATABASES = { 'default': dj_database_url.config(default=DATABASE_URL) } Relevant sections of pgbouncer.ini are: [databases] db1

pgbouncer - closing because: unclean server on every connection

亡梦爱人 提交于 2019-12-04 03:13:32
I'm running Django 1.3 with PostgreSQL 9.1/PostGIS 1.5, psycopg2 2.4.2 and pgbouncer 1.4.2. On every single connection to the database I get a log entry in pgbouncer.log: 2011-11-20 02:15:25.027 29538 LOG S-0x96c2200: app_db/postgres@192.168.171.185:5432 closing because: unclean server (age=0). I can't find any solution to this problem - anybody have an idea why? I've tried reconfiguring pgbouncer (session/transaction mode, different timeouts etc), but to no avail. Ok, I think I've figured this out. The problem lies with a long-standing issue with Django and Psycopg2. Basically, Psycopg2 will

How to increase the connection throughput for pgbouncer?

你。 提交于 2019-11-30 22:37:55
问题 I am using pgbouncer in transaction mode & trying to allow close to 500 active transaction. The purpose is simply to stress test the setup Current setup: [ 'n' clients --->1 pgbouncer ----> 1 postgres ] I notice that my transaction/second (tps) decreases considerably when I use pgbouncer instead of a direct connection to postgres. For the same set to transaction (via pgbench) Direct connections => 10k (tps) appx pgbouncer connection => 3k (tps) appx Is there any configuration in pgbouncer