Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIvWR-0005gM-0j for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2019 14:03:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIvWP-0006D1-7D for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2019 14:03:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIvWN-0006Co-C2 for pgsql-general@lists.postgresql.org; Fri, 11 Oct 2019 14:03:56 +0000 Received: from [66.111.4.29] (helo=out5-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIvWJ-0005Ea-FQ for pgsql-general@postgresql.org; Fri, 11 Oct 2019 14:03:54 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A4B94214DB; Fri, 11 Oct 2019 10:03:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 11 Oct 2019 10:03:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=C 0TJVtxY4NA42I3eWCan1FgzJ94M91DCxVSxrEY+H0U=; b=4xd4YGhDPX8T7gB8t IfSulrsCd1NYMqn6owUBcRVwv9rX8E+zuYWhR+pQ8AxQ06Zt+Lf6HhLQgAFV0F0x VlBvQ8sxJPjPUcNobYbhrqUhgesnktoRxjO/wPOiDpKdgl/Wavp72xjY64KxKGip qkgEZiS7WKIaxsIYXU1dbDMp/M0H1eJV72p2V2FaIsjPL59+abTd90NYNZlYS56/ ECM52uScLb2YtG5dbCZDBrn+rzJXuWIAfPFeweqTCXynga06kotW/FeHjn/zceVo IByJYda9FgwvUioLzI6DcXaZbGKA1Z7Rd2QcQFx63z/FLR+H9Dlyc9Ry5C5U16yz +GmpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=C0TJVtxY4NA42I3eWCan1FgzJ94M91DCxVSxrEY+H 0U=; b=dQi6pdyVKO3wL+pgYU73TaY+sHQcB/xmuiRQnVeH7QXQmSS78o4qVKTiG GjVjKpGIUUwontJad4nu0+lB0n8i0s73o9pcypq4K2dyUv3E7SU0bdqD+RIBS9kC O7v5SfGCGsqOac8VEz7VWbipLxNR6TTuajy+vTc6v7Fa7OZ/lspZCICtC5Y/KFK1 azoo6vsTv2Ls7iL3WZECz1wJ95G9kHQiOA7FR6ffwKPJ3ohw4kDk65JCrWg6nriR UDa9z+JTfxefEJWPBLGQIDUjoAHGaEiKR5E2GWyh6+20DNofCz134Qy/mGpv51cr EmNvD43ims6L1yrBnR1+eVEaVMgDw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrieehgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepjedurddvuddvrddufeejrddufe ehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.137.135]) by mail.messagingengine.com (Postfix) with ESMTPA id D66C980059; Fri, 11 Oct 2019 10:03:28 -0400 (EDT) Subject: Re: Too many SET TimeZone and Application_name queries To: Amarendra Konda , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: Date: Fri, 11 Oct 2019 07:03:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.29 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/11/19 4:49 AM, Amarendra Konda wrote: > Hi, > > In our test environment, it was observed that there are too many queries > were getting fired to the database server, even though they are not part > of the SQL query execution. > > And the number of queries that were coming to server are very high. Can > you please suggest on how to avoid these queries to the database server ? My guess is your application server/framework is setting the below. What are you using for above? > > > 2019-10-10 13:37:25 UTC:172.31.77.194(36920): > user1@new_unity_green1:[2549]:LOG:  duration: 0.081 ms  statement: *SET > application_name='PostgreSQL JDBC Driver';* > 2019-10-10 13:37:25 UTC:172.31.69.112(45682): > user1@new_unity_green0:[3545]:LOG:  duration: 0.036 ms  statement: *SET > TimeZone='UTC';* > 2019-10-10 13:37:25 > UTC:172.31.77.194(36902):user1@new_unity_green1:[2112]:LOG:  duration: > 0.177 ms  statement: *SET TimeZone='Etc/UTC';SET > application_name='PostgreSQL JDBC Driver';* > > > *_Environment_* > > * PGBouncer 1.9 > * JDBC Driver 42.2.8 > * Java 1.8 > * PostgreSQL 9.6.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 > 20140911 (Red Hat 4.8.3-9), 64-bit > > > Application Server, pgBouncer and database server are all configured > with UTC only. > > =>show timezone; >  TimeZone > ---------- >  UTC > > Thanks in advance, > > Regards, Amarendra > > > > > > -- Adrian Klaver adrian.klaver@aklaver.com