2013-09-24 53 views
0

这是正常的,如果我有这样的:PostgreSQL的日志连接

2013-09-24 12:08:24 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:24 WIT LOG: connection received: host=xx.x.xx.91 port=59878 
2013-09-24 12:08:24 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59879 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59880 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59881 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59882 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59883 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.92 port=58015 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 
2013-09-24 12:08:25 WIT LOG: connection received: host=xx.x.xx.91 port=59885 
2013-09-24 12:08:25 WIT LOG: connection authorized: user=xxxxxx database=xxxx 

在我的PostgreSQL-9.1-main.log?仅供参考,我已经在postgresql.conf文件中打开了选项'log_connection',但我不知道我的应用程序(我使用laravel)是否使用不同的端口创建连接(可能每秒15次)是正常的?

此外,我的申请变得非常重载。它与该日志有任何关系?

Laravel或Postgresql的问题?提前致谢。

回答

0

看到这样的日志是更新的好迹象。创建新连接需要花费很多。

您可以尝试为连接极化添加pgPool或pgBouncer(或任何其他中间件)。但为了获得最佳性能,您需要在应用内管理连接池。

而这不是Postgres问题 - 它不实现连接池,将它留给中间件或应用程序本身。