Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0n9K-0002cK-Hc for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 11:52:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0n9J-0001YU-Em for pgadmin-hackers@arkaria.postgresql.org; Tue, 27 Mar 2018 11:52:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0n9J-0001YF-1h for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 11:52:21 +0000 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f0n9F-0004Ad-R1 for pgadmin-hackers@lists.postgresql.org; Tue, 27 Mar 2018 11:52:19 +0000 Received: by mail-oi0-x22a.google.com with SMTP id 188-v6so2418057oih.8 for ; Tue, 27 Mar 2018 04:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+Ns2ltTQLdK4rX2s6VinI1rzR4jieXWcHNcJTG6GU1w=; b=qlsUfmiPSd+YycYF2CaLY7lvP2qjXzBmNiKY2pW01zktZ2eos2huCMfSjY+tjjS3AQ yYQehMuWSyZRNClqktsW/YZYExwwlNUleGpMrstuh5j9ySf4/yu0kUNhkJqdYdgFs+wm ESYovvZFPa4ZEty+N9Iv5I9BtRsouPZj9uv7QZeUA38Yek1LhpBIw015oSx9Pue2QBS5 85uo/9oplRVCusXijSKOtl+zvhmj1w1Qp4psu9fjMNb//zNvcSqXsV16f7Pg+Rh2n6Tz 7RIp5WRAea5xVVl5CzllfsL1muG3sW5pRFq2ZKybXek1jhXilxxmzyD6cwpFS2PgLWYg BuPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+Ns2ltTQLdK4rX2s6VinI1rzR4jieXWcHNcJTG6GU1w=; b=tQU4zz/7EdcQFLjfst5hNY1NZCouA82MMkxc1+h349OBZDgxS15O3P2S8GiS/CKC1X 9nim+MqDfTJOSOygL+P7qvh4ptWkuT61R/Lb8xov+nUbBXiW/JJnPaaVUtpEqbbfjmFS 5zl4miQ2FFr8B1LT/DRbJf02HdMs1KIKp4ReQ4/EVr3lJHK7r5D62N02Lldpu2morVMW mEXky3NQKuvz1dyRo6a/vvOI4JRD4MYmVP9olqyo4oaexQd/PecXxnvTPQ9QoosUTMaV axdIKqP/rjOf4qlpV/+jumyCpirI0Nhzv80BDZkVom6o743pZ791t7UKGPmxvYr+Bye0 ZJgQ== X-Gm-Message-State: AElRT7GzXq8uVabmLK4a7e5XH3k+PvBA/KwlIudPaxA9qLA5Xv4Vq0y1 5AvE9aUeJlnox4l+o2MEYJjA+0Bv1bNZHmFyFLER+SeZ X-Google-Smtp-Source: AIpwx48Yd16oJ2lGFpzRJ/lPg+3BMMR3WKy7dbvng52m/yNyuRIDFVeVtlaTMj2MaH6NLFPe/+1PBisxIWFXoNxsuOk= X-Received: by 10.202.206.67 with SMTP id e64mr9947696oig.342.1522151536792; Tue, 27 Mar 2018 04:52:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.6.138 with HTTP; Tue, 27 Mar 2018 04:51:56 -0700 (PDT) In-Reply-To: <96167950.2563944.1522151063432.JavaMail.zimbra@connexgroup.net> References: <96167950.2563944.1522151063432.JavaMail.zimbra@connexgroup.net> From: Murtuza Zabuawala Date: Tue, 27 Mar 2018 17:21:56 +0530 Message-ID: Subject: Re: pgadmin healthcheck-url To: Wilhelm Wurzer Cc: pgadmin-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="001a113d23dea54985056863857e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113d23dea54985056863857e Content-Type: text/plain; charset="UTF-8" You can use '/misc/ping' route to check if pgAdmin4 is running. Example: http://localhost:5050/misc/ping On Success you will get, Status code: 200 Response text: PING -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wurzer wrote: > Hi, > > we are using pgadmin in a docker container on aws. To ensure that the > container is up and running, a healthcheck is periodically checking via > http, restarting the container if neccessary. > > When checking the filesystem, we found that for each request, a session > file is created. Healthcheck is done twice every 30secs, so we have about > 5600 session files a day. (about 100k after a few days..) > > > I looked at the sourcecode and found that in session.py, line 259 it looks > like cookies should not be created for static resources > > - > > def open_session(self, app, request): > cookie_val = request.cookies.get(app.session_cookie_name) > > if not cookie_val or '!' not in cookie_val: > # Don't bother creating a cookie for static resources > for sp in self.skip_paths: > if request.path.startswith(sp): > return None > > - > > unfortunately, in __init__.py, when setting up the session interface, > skip_paths is empty and so a cookie gets created also for static resources > (i'm no python hacker, so maybe i'm missing something) > > > So my question is - is there an url that can be used for healthchecking, > that does not create a session file on every check ? > > > thanks a lot, > > Wilhelm Wurzer > twyn group GmbH > > --001a113d23dea54985056863857e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You can use '' route to check if pgAd= min4 is running.

On Su= ccess you will get,
Status code: 200
Response text: PING


--<= div>Regards= ,
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.= com
The Enterprise PostgreSQL Company
=
=

On Tue, Mar 27, 2018 at 5:14 PM, Wilhelm Wur= zer <wilhelm.wurzer@twyn.com> wrote:
Hi,

we are using pgadmin in a docker container on aws. To ensure that the conta= iner is up and running, a healthcheck is periodically checking via http, re= starting the container if neccessary.

When checking the filesystem, we found that for each request, a session fil= e is created. Healthcheck is done twice every 30secs, so we have about 5600= session files a day. (about 100k after a few days..)


I looked at the sourcecode and found that in session.py, line 259 it looks = like cookies should not be created for static resources

-

def open_session(self, app, request):
cookie_val =3D request.cookies.get(app.session_cookie_name)

if not cookie_val or '!' not in cookie_val:
# Don't bother creating a cookie for static resources
for sp in self.skip_paths:
if request.path.startswith(sp):
return None

-

unfortunately, in __init__.py, when setting up the session interface, skip_= paths is empty and so a cookie gets created also for static resources (i= 9;m no python hacker, so maybe i'm missing something)


So my question is - is there an url that can be used for healthchecking, th= at does not create a session file on every check ?


thanks a lot,

Wilhelm Wurzer
twyn group GmbH


--001a113d23dea54985056863857e--