{"action":"created","issue":{"url":"https://api.github.com/repos/leafo/pgmoon/issues/47","repository_url":"https://api.github.com/repos/leafo/pgmoon","labels_url":"https://api.github.com/repos/leafo/pgmoon/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/leafo/pgmoon/issues/47/comments","events_url":"https://api.github.com/repos/leafo/pgmoon/issues/47/events","html_url":"https://github.com/leafo/pgmoon/issues/47","id":196576831,"number":47,"title":"postgresql say too many clients already.","user":{"login":"yjdwbj","id":321919,"avatar_url":"https://avatars.githubusercontent.com/u/321919?v=3","gravatar_id":"","url":"https://api.github.com/users/yjdwbj","html_url":"https://github.com/yjdwbj","followers_url":"https://api.github.com/users/yjdwbj/followers","following_url":"https://api.github.com/users/yjdwbj/following{/other_user}","gists_url":"https://api.github.com/users/yjdwbj/gists{/gist_id}","starred_url":"https://api.github.com/users/yjdwbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjdwbj/subscriptions","organizations_url":"https://api.github.com/users/yjdwbj/orgs","repos_url":"https://api.github.com/users/yjdwbj/repos","events_url":"https://api.github.com/users/yjdwbj/events{/privacy}","received_events_url":"https://api.github.com/users/yjdwbj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-20T03:18:23Z","updated_at":"2016-12-20T03:26:44Z","closed_at":null,"body":"Hello,here my postgresql conf.\r\n```\r\ngrep -v '^#' /etc/postgresql/9.5/main/postgresql.conf  | grep -v '^$' | grep -v '#'\r\narchive_mode = on\r\neffective_cache_size = 20GB\r\nsyslog_facility = 'LOCAL0'\r\nsyslog_ident = 'postgres'\r\nlog_checkpoints = on\r\nlog_disconnections = on\r\nlog_timezone = 'PRC'\r\nstats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp'\r\ndatestyle = 'iso, ymd'\r\ntimezone = 'PRC'\r\ndefault_text_search_config = 'pg_catalog.english'\r\nroot@25-108:/home/www/test_openresty# grep -v '^#' /etc/postgresql/9.5/main/postgresql.conf  | grep -v '^$' \r\ndata_directory = '/data/pgdata'\t\t# use data in another directory\r\n\t\t\t\t\t# (change requires restart)\r\nhba_file = '/etc/postgresql/9.5/main/pg_hba.conf'\t# host-based authentication file\r\n\t\t\t\t\t# (change requires restart)\r\nident_file = '/etc/postgresql/9.5/main/pg_ident.conf'\t# ident configuration file\r\n\t\t\t\t\t# (change requires restart)\r\nexternal_pid_file = '/var/run/postgresql/9.5-main.pid'\t\t\t# write an extra PID file\r\n\t\t\t\t\t# (change requires restart)\r\nlisten_addresses = '*'\t\t# what IP address(es) to listen on;\r\n\t\t\t\t\t# comma-separated list of addresses;\r\n\t\t\t\t\t# defaults to 'localhost'; use '*' for all\r\n\t\t\t\t\t# (change requires restart)\r\nport = 5432\t\t\t\t# (change requires restart)\r\nmax_connections = 4000                  # (change requires restart)\r\nunix_socket_directories = '/var/run/postgresql'\t# comma-separated list of directories\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\nssl = true\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\nssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'\t\t# (change requires restart)\r\nssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'\t\t# (change requires restart)\r\n\t\t\t\t\t# 0 selects the system default\r\n\t\t\t\t\t# 0 selects the system default\r\n\t\t\t\t\t# 0 selects the system default\r\nshared_buffers = 16GB # min 128kB\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\ntemp_buffers = 32MB\t\t\t# min 800kB\r\n\t\t\t\t\t# (change requires restart)\r\nwork_mem = 8192MB\t\t\t\t# min 64kB\r\nmaintenance_work_mem = 8192MB\t\t# min 1MB\r\nmax_stack_depth = 4096\t\t\t# min 100kB\r\ndynamic_shared_memory_type = posix\t# the default is the first option\r\n\t\t\t\t\t# supported by the operating system:\r\n\t\t\t\t\t#   posix\r\n\t\t\t\t\t#   sysv\r\n\t\t\t\t\t#   windows\r\n\t\t\t\t\t#   mmap\r\n\t\t\t\t\t# use none to disable dynamic shared memory\r\n\t\t\t\t\t# in kB, or -1 for no limit\r\n\t\t\t\t\t# (change requires restart)\r\nvacuum_cost_delay = 10ms\t\t\t# 0-100 milliseconds\r\nvacuum_cost_limit = 10000\t\t# 1-10000 credits\r\nbgwriter_delay = 10ms\t\t\t# 10-10000ms between rounds\r\nwal_level =  hot_standby  # minimal, archive, hot_standby, or logical\r\n\t\t\t\t\t# (change requires restart)\r\nsynchronous_commit = on\t\t# synchronization level;\r\n\t\t\t\t\t# off, local, remote_write, or on\r\n\t\t\t\t\t# supported by the operating system:\r\n\t\t\t\t\t#   open_datasync\r\n\t\t\t\t\t#   fdatasync (default on Linux)\r\n\t\t\t\t\t#   fsync\r\n\t\t\t\t\t#   fsync_writethrough\r\n\t\t\t\t\t#   open_sync\r\n\t\t\t\t\t# (change requires restart)\r\nwal_buffers = 16MB\t\t\t# min 32kB, -1 sets based on shared_buffers\r\n\t\t\t\t\t# (change requires restart)\r\nwal_writer_delay = 20ms\t\t# 1-10000 milliseconds\r\ncheckpoint_timeout = 5min\t\t# range 30s-1h\r\narchive_mode = on\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# placeholders: %p = path of file to archive\r\n\t\t\t\t#               %f = file name only\r\n\t\t\t\t# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'\r\n\t\t\t\t# number of seconds; 0 disables\r\nmax_wal_senders = 32\t\t# max number of walsender processes\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# comma-separated list of application_name\r\n\t\t\t\t# from standby(s); '*' = all\r\nhot_standby = on # \"on\" allows queries during recovery\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# when reading WAL from archive;\r\n\t\t\t\t\t# -1 allows indefinite delay\r\n\t\t\t\t\t# when reading streaming WAL;\r\n\t\t\t\t\t# -1 allows indefinite delay\r\n\t\t\t\t\t# 0 disables\r\n\t\t\t\t\t# query conflicts\r\n\t\t\t\t\t# communication from master\r\n\t\t\t\t\t# in milliseconds; 0 disables\r\n\t\t\t\t\t# retrieve WAL after a failed attempt\r\neffective_cache_size = 20GB\r\n\t\t\t\t\t# JOIN clauses\r\nlog_destination = 'csvlog'\t\t# Valid values are combinations of\r\n\t\t\t\t\t# stderr, csvlog, syslog, and eventlog,\r\n\t\t\t\t\t# depending on platform.  csvlog\r\n\t\t\t\t\t# requires logging_collector to be on.\r\nlogging_collector = on\t\t# Enable capturing of stderr and csvlog\r\n\t\t\t\t\t# into log files. Required to be on for\r\n\t\t\t\t\t# csvlogs.\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# can be absolute or relative to PGDATA\r\n\t\t\t\t\t# can include strftime() escapes\r\n\t\t\t\t\t# begin with 0 to use octal notation\r\nlog_truncate_on_rotation = on # If on, an existing log file with the\r\n\t\t\t\t\t# same name as the new log file will be\r\n\t\t\t\t\t# truncated rather than appended to.\r\n\t\t\t\t\t# But such truncation only occurs on\r\n\t\t\t\t\t# time-driven rotation, not on restarts\r\n\t\t\t\t\t# or size-driven rotation.  Default is\r\n\t\t\t\t\t# off, meaning append to existing files\r\n\t\t\t\t\t# in all cases.\r\nlog_rotation_age = 1d\t\t\t# Automatic rotation of logfiles will\r\n\t\t\t\t\t# happen after that time.  0 disables.\r\nlog_rotation_size = 10MB\t\t# Automatic rotation of logfiles will\r\n\t\t\t\t\t# happen after that much log output.\r\n\t\t\t\t\t# 0 disables.\r\nsyslog_facility = 'LOCAL0'\r\nsyslog_ident = 'postgres'\r\nclient_min_messages = notice # values in order of decreasing detail:\r\n\t\t\t\t\t#   debug5\r\n\t\t\t\t\t#   debug4\r\n\t\t\t\t\t#   debug3\r\n\t\t\t\t\t#   debug2\r\n\t\t\t\t\t#   debug1\r\n\t\t\t\t\t#   log\r\n\t\t\t\t\t#   notice\r\n\t\t\t\t\t#   warning\r\n\t\t\t\t\t#   error\r\nlog_min_messages = notice # values in order of decreasing detail:\r\n\t\t\t\t\t#   debug5\r\n\t\t\t\t\t#   debug4\r\n\t\t\t\t\t#   debug3\r\n\t\t\t\t\t#   debug2\r\n\t\t\t\t\t#   debug1\r\n\t\t\t\t\t#   info\r\n\t\t\t\t\t#   notice\r\n\t\t\t\t\t#   warning\r\n\t\t\t\t\t#   error\r\n\t\t\t\t\t#   log\r\n\t\t\t\t\t#   fatal\r\n\t\t\t\t\t#   panic\r\n\t\t\t\t\t#   debug5\r\n\t\t\t\t\t#   debug4\r\n\t\t\t\t\t#   debug3\r\n\t\t\t\t\t#   debug2\r\n\t\t\t\t\t#   debug1\r\n\t\t\t\t\t#   info\r\n\t\t\t\t\t#   notice\r\n\t\t\t\t\t#   warning\r\n\t\t\t\t\t#   error\r\n\t\t\t\t\t#   log\r\n\t\t\t\t\t#   fatal\r\n\t\t\t\t\t#   panic (effectively off)\r\nlog_min_duration_statement = 1000ms\t# -1 is disabled, 0 logs all statements\r\n\t\t\t\t\t# and their durations, > 0 logs only\r\n\t\t\t\t\t# statements running at least this number\r\n\t\t\t\t\t# of milliseconds\r\nlog_checkpoints = on\r\nlog_disconnections = on\r\nlog_error_verbosity = verbose # terse, default, or verbose messages\r\nlog_line_prefix = '%t [%p-%l] %q%u@%d '\t\t\t# special values:\r\n\t\t\t\t\t#   %a = application name\r\n\t\t\t\t\t#   %u = user name\r\n\t\t\t\t\t#   %d = database name\r\n\t\t\t\t\t#   %r = remote host and port\r\n\t\t\t\t\t#   %h = remote host\r\n\t\t\t\t\t#   %p = process ID\r\n\t\t\t\t\t#   %t = timestamp without milliseconds\r\n\t\t\t\t\t#   %m = timestamp with milliseconds\r\n\t\t\t\t\t#   %i = command tag\r\n\t\t\t\t\t#   %e = SQL state\r\n\t\t\t\t\t#   %c = session ID\r\n\t\t\t\t\t#   %l = session line number\r\n\t\t\t\t\t#   %s = session start timestamp\r\n\t\t\t\t\t#   %v = virtual transaction ID\r\n\t\t\t\t\t#   %x = transaction ID (0 if none)\r\n\t\t\t\t\t#   %q = stop here in non-session\r\n\t\t\t\t\t#        processes\r\n\t\t\t\t\t#   %% = '%'\r\n\t\t\t\t\t# e.g. '<%u%%%d> '\r\nlog_lock_waits = on # log lock waits >= deadlock_timeout\r\n\t\t\t\t\t# than the specified size in kilobytes;\r\n\t\t\t\t\t# -1 disables, 0 logs all temp files\r\nlog_timezone = 'PRC'\r\n\t\t\t\t\t# (change requires restart)\r\nstats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp'\r\nautovacuum = on\t\t\t# Enable autovacuum subprocess?  'on'\r\n\t\t\t\t\t# requires track_counts to also be on.\r\nlog_autovacuum_min_duration = 0 \t# -1 disables, 0 logs all actions and\r\n\t\t\t\t\t# their durations, > 0 logs only\r\n\t\t\t\t\t# actions running at least this number\r\n\t\t\t\t\t# of milliseconds.\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# vacuum\r\n\t\t\t\t\t# analyze\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# before forced vacuum\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# autovacuum, in milliseconds;\r\n\t\t\t\t\t# -1 means use vacuum_cost_delay\r\n\t\t\t\t\t# autovacuum, -1 means use\r\n\t\t\t\t\t# vacuum_cost_limit\r\n\t\t\t\t\t# only default tablespace\r\ndatestyle = 'iso, ymd'\r\ntimezone = 'PRC'\r\n\t\t\t\t\t# abbreviations.  Currently, there are\r\n\t\t\t\t\t#   Default\r\n\t\t\t\t\t#   Australia (historical usage)\r\n\t\t\t\t\t#   India\r\n\t\t\t\t\t# You can create your own file in\r\n\t\t\t\t\t# share/timezonesets/.\r\n\t\t\t\t\t# encoding\r\nlc_messages = 'en_US.UTF-8'\t\t\t# locale for system error message\r\n\t\t\t\t\t# strings\r\nlc_monetary = 'zh_CN.UTF-8'\t\t\t# locale for monetary formatting\r\nlc_numeric = 'zh_CN.UTF-8'\t\t\t# locale for number formatting\r\nlc_time = 'zh_CN.UTF-8'\t\t\t\t# locale for time formatting\r\ndefault_text_search_config = 'pg_catalog.english'\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# directory 'conf.d'\r\nroot@25-108:/home/www/test_openresty# ^C\r\nroot@25-108:/home/www/test_openresty# grep -v '^#' /etc/postgresql/9.5/main/postgresql.conf  | grep -v '^$'  \r\ndata_directory = '/data/pgdata'\t\t# use data in another directory\r\n\t\t\t\t\t# (change requires restart)\r\nhba_file = '/etc/postgresql/9.5/main/pg_hba.conf'\t# host-based authentication file\r\n\t\t\t\t\t# (change requires restart)\r\nident_file = '/etc/postgresql/9.5/main/pg_ident.conf'\t# ident configuration file\r\n\t\t\t\t\t# (change requires restart)\r\nexternal_pid_file = '/var/run/postgresql/9.5-main.pid'\t\t\t# write an extra PID file\r\n\t\t\t\t\t# (change requires restart)\r\nlisten_addresses = '*'\t\t# what IP address(es) to listen on;\r\n\t\t\t\t\t# comma-separated list of addresses;\r\n\t\t\t\t\t# defaults to 'localhost'; use '*' for all\r\n\t\t\t\t\t# (change requires restart)\r\nport = 5432\t\t\t\t# (change requires restart)\r\nmax_connections = 4000                  # (change requires restart)\r\nunix_socket_directories = '/var/run/postgresql'\t# comma-separated list of directories\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\nssl = true\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\nssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'\t\t# (change requires restart)\r\nssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'\t\t# (change requires restart)\r\n\t\t\t\t\t# 0 selects the system default\r\n\t\t\t\t\t# 0 selects the system default\r\n\t\t\t\t\t# 0 selects the system default\r\nshared_buffers = 16GB # min 128kB\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# (change requires restart)\r\ntemp_buffers = 32MB\t\t\t# min 800kB\r\n\t\t\t\t\t# (change requires restart)\r\nwork_mem = 8192MB\t\t\t\t# min 64kB\r\nmaintenance_work_mem = 8192MB\t\t# min 1MB\r\nmax_stack_depth = 4096\t\t\t# min 100kB\r\ndynamic_shared_memory_type = posix\t# the default is the first option\r\n\t\t\t\t\t# supported by the operating system:\r\n\t\t\t\t\t#   posix\r\n\t\t\t\t\t#   sysv\r\n\t\t\t\t\t#   windows\r\n\t\t\t\t\t#   mmap\r\n\t\t\t\t\t# use none to disable dynamic shared memory\r\n\t\t\t\t\t# in kB, or -1 for no limit\r\n\t\t\t\t\t# (change requires restart)\r\nvacuum_cost_delay = 10ms\t\t\t# 0-100 milliseconds\r\nvacuum_cost_limit = 10000\t\t# 1-10000 credits\r\nbgwriter_delay = 10ms\t\t\t# 10-10000ms between rounds\r\nwal_level =  hot_standby  # minimal, archive, hot_standby, or logical\r\n\t\t\t\t\t# (change requires restart)\r\nsynchronous_commit = on\t\t# synchronization level;\r\n\t\t\t\t\t# off, local, remote_write, or on\r\n\t\t\t\t\t# supported by the operating system:\r\n\t\t\t\t\t#   open_datasync\r\n\t\t\t\t\t#   fdatasync (default on Linux)\r\n\t\t\t\t\t#   fsync\r\n\t\t\t\t\t#   fsync_writethrough\r\n\t\t\t\t\t#   open_sync\r\n\t\t\t\t\t# (change requires restart)\r\nwal_buffers = 16MB\t\t\t# min 32kB, -1 sets based on shared_buffers\r\n\t\t\t\t\t# (change requires restart)\r\nwal_writer_delay = 20ms\t\t# 1-10000 milliseconds\r\ncheckpoint_timeout = 5min\t\t# range 30s-1h\r\narchive_mode = on\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# placeholders: %p = path of file to archive\r\n\t\t\t\t#               %f = file name only\r\n\t\t\t\t# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'\r\n\t\t\t\t# number of seconds; 0 disables\r\nmax_wal_senders = 32\t\t# max number of walsender processes\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# (change requires restart)\r\n\t\t\t\t# comma-separated list of application_name\r\n\t\t\t\t# from standby(s); '*' = all\r\nhot_standby = on # \"on\" allows queries during recovery\r\n\t\t\t\t\t# (change requires restart)\r\n\t\t\t\t\t# when reading WAL from archive;\r\n\t\t\t\t\t# -1 allows indefinite delay\r\n\t\t\t\t\t# when reading streaming WAL;\r\n\t\t\t\t\t# -1 allows indefinite delay\r\n\t\t\t\t\t# 0 disables\r\n\t\t\t\t\t# query conflicts\r\n\t\t\t\t\t# communication from master\r\n\t\t\t\t\t# in milliseconds; 0 disables\r\n\t\t\t\t\t# retrieve WAL after a failed attempt\r\neffective_cache_size = 20GB\r\n\t\t\t\t\t# JOIN clauses\r\nlog_destination = 'csvlog'\t\t# Valid values are combinations of\r\n\t\t\t\t\t# stderr, csvlog, syslog, and eventlog,\r\n\t\t\t\t\t# depending on platform.  csvlog\r\n\t\t\t\t\t# requires logging_collector to be on.\r\nlogging_collector = on\t\t# Enable capturing of stderr and csvlog\r\n```\r\n\r\n-------------------\r\n\r\n\r\n016-12-20 11:14:09 CST [24633-1] [unknown]@[unknown] LOG:  incomplete startup packet\r\n2016-12-20 11:14:09 CST [25669-1] mqtt@test_mqtt FATAL:  sorry, too many clients already\r\n2016-12-20 11:14:09 CST [25667-1] mqtt@test_mqtt FATAL:  remaining connection slots are reserved for non-replication superuser connections\r\n2016-12-20 11:14:09 CST [25668-1] mqtt@test_mqtt FATAL:  remaining connection slots are reserved for non-replication superuser connections\r\n2016-12-20 11:14:09 CST [25670-1] mqtt@test_mqtt FATAL:  remaining connection slots are reserved for non-replication superuser connections\r\n"},"comment":{"url":"https://api.github.com/repos/leafo/pgmoon/issues/comments/268144800","html_url":"https://github.com/leafo/pgmoon/issues/47#issuecomment-268144800","issue_url":"https://api.github.com/repos/leafo/pgmoon/issues/47","id":268144800,"user":{"login":"leafo","id":15198,"avatar_url":"https://avatars.githubusercontent.com/u/15198?v=3","gravatar_id":"","url":"https://api.github.com/users/leafo","html_url":"https://github.com/leafo","followers_url":"https://api.github.com/users/leafo/followers","following_url":"https://api.github.com/users/leafo/following{/other_user}","gists_url":"https://api.github.com/users/leafo/gists{/gist_id}","starred_url":"https://api.github.com/users/leafo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafo/subscriptions","organizations_url":"https://api.github.com/users/leafo/orgs","repos_url":"https://api.github.com/users/leafo/repos","events_url":"https://api.github.com/users/leafo/events{/privacy}","received_events_url":"https://api.github.com/users/leafo/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T03:26:44Z","updated_at":"2016-12-20T03:26:44Z","body":"are you closing your connections or re-using them after you're done with them?"}}
{"actor":{"display_login":"leafo"}}