On Tue, Mar 11, 2014 at 12:04 PM, Anand Kumar, Karthik <Karthik.AnandKumar@xxxxxxxxxxxxxx> wrote:
Hi all,
We're running postgres 9.3.2, server configuration below.
Seemingly randomly, we will see the number of active queries in postgres go up until we hit max_connections. The DB will recover after a few minutes.
We had the issue a couple of times in Feb 2014. We then upgraded the postgres server from 9.1 to 9.3.2, and the occurrence has gone up significantly – to several times a day.
The user CPU goes up as well to a 100%, no increase in I/O or system CPU.We have slow query logging, and there is no dramatic change in the slow queries either.There is a corresponding spike in shared locks, but that seems to be an effect not a cause – it corresponds to an increase in the number of running processes at the time.
We had a similar issue in the past – that was solved by disabling transparent_huge_pages – but the difference there was that we'd see queries slow down dramatically. Currently, we don't. Also, transparent_huge_pages is still disabled.
I do realize the issue would be caused by a spurt in incoming connections – we do not yet have conclusive evidence on whether that's happening (active queries climbs up, however no conclusive proof on whether thats because of slow down, or because of increase in traffic). Working on getting the information, will update with that information as soon as we have it.
I thought I'd send a post out to the group before then, to see if anyone has run into anything similar.
Thanks,Karthik
site=# SELECT version();PostgreSQL 9.3.2 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4), 64-bit
site=# SELECT name, current_setting(name), sourcesite-# FROM pg_settingssite-# WHERE source NOT IN ('default', 'override');application_name|psql|clientarchive_command|/usr/bin/archiver.sh %f %p|configuration filearchive_mode|on|configuration fileautovacuum_freeze_max_age|250000000|configuration fileautovacuum_max_workers|6|configuration filebgwriter_lru_maxpages|1000|configuration filebgwriter_lru_multiplier|4|configuration filecheckpoint_completion_target|0.8|configuration filecheckpoint_segments|250|configuration filecheckpoint_timeout|15min|configuration filecheckpoint_warning|6min|configuration fileclient_encoding|UTF8|clientcommit_siblings|25|configuration filecpu_tuple_cost|0.03|configuration fileDateStyle|ISO, MDY|configuration filedefault_statistics_target|300|configuration filedefault_text_search_config|pg_catalog.english|configuration fileeffective_cache_size|568GB|configuration filefsync|on|configuration filelc_messages|en_US.UTF-8|configuration filelc_monetary|en_US.UTF-8|configuration filelc_numeric|en_US.UTF-8|configuration filelc_time|en_US.UTF-8|configuration filelisten_addresses|*|configuration filelog_autovacuum_min_duration|0|configuration filelog_checkpoints|on|configuration filelog_connections|on|configuration filelog_destination|syslog|configuration filelog_directory|pg_log|configuration filelog_filename|postgresql-%a.log|configuration filelog_line_prefix|user=%u,db=%d,ip=%h |configuration filelog_min_duration_statement|100ms|configuration filelog_min_messages|debug1|configuration filelog_rotation_age|1d|configuration filelog_rotation_size|0|configuration filelog_timezone|US/Pacific|configuration filelog_truncate_on_rotation|on|configuration filelogging_collector|off|configuration filemaintenance_work_mem|1GB|configuration filemax_connections|1500|configuration filemax_locks_per_transaction|1000|configuration filemax_stack_depth|2MB|environment variablemax_wal_senders|5|configuration fileport|5432|command linerandom_page_cost|2|configuration fileshared_buffers|8GB|configuration filesynchronous_commit|off|configuration filesyslog_facility|local0|configuration filesyslog_ident|postgres|configuration fileTimeZone|US/Pacific|configuration filevacuum_freeze_table_age|0|configuration filewal_buffers|32MB|configuration filewal_keep_segments|250|configuration filewal_level|hot_standby|configuration filewal_sync_method|fsync|configuration filework_mem|130MB|configuration file
Please let us know your hardware configuration like RAM, CPU (cores) etc.
Do you see any messages indicating any processes getting terminated/killed forcibly in the Postgresql logs ?
Or do you see any shared memory related error messages ?
cpu_tuple_cost=0.03 - which is not default, any reasons for increasing this.
effective_cache_size = 568 GB - Please help us know if this is optimal for your system.
Venkata Balaji N
Sr. Database Administrator
Fujitsu Australia