MESSAGE
DATE | 2021-02-09 |
FROM | Mithun Bhattacharya
|
SUBJECT | Re: [Hangout - NYLXS] Moving ExecCGI to mod_perl - performance and
|
From hangout-bounces-at-nylxs.com Tue Feb 9 17:06:28 2021 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www2.mrbrklyn.com (www2.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 9E4B616403F; Tue, 9 Feb 2021 17:06:27 -0500 (EST) X-Original-To: hangout-at-www2.mrbrklyn.com Delivered-To: hangout-at-www2.mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 1000) id 15AF416402A; Tue, 9 Feb 2021 17:05:46 -0500 (EST) Resent-From: Ruben Safir Resent-Date: Tue, 9 Feb 2021 17:05:45 -0500 Resent-Message-ID: <20210209220545.GH25519-at-www2.mrbrklyn.com> Resent-To: hangout-at-mrbrklyn.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mrbrklyn.com (Postfix) with ESMTP id 9DB88164022 for ; Tue, 9 Feb 2021 13:34:49 -0500 (EST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id EA1B0449FC for ; Tue, 9 Feb 2021 18:34:47 +0000 (UTC) Received: (qmail 28865 invoked by uid 500); 9 Feb 2021 18:34:47 -0000 Mailing-List: contact modperl-help-at-perl.apache.org; run by ezmlm Precedence: bulk Delivered-To: mailing list modperl-at-perl.apache.org Received: (qmail 28854 invoked by uid 99); 9 Feb 2021 18:34:47 -0000 Received: from spamproc1-he-fi.apache.org (HELO spamproc1-he-fi.apache.org) (95.217.134.168) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2021 18:34:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-fi.apache.org (ASF Mail Server at spamproc1-he-fi.apache.org) with ESMTP id 59373C0116 for ; Tue, 9 Feb 2021 18:34:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-fi.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamproc1-he-fi.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-fi.apache.org [95.217.134.168]) (amavisd-new, port 10024) with ESMTP id 7LM6aEzkim-J for ; Tue, 9 Feb 2021 18:34:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::933; helo=mail-ua1-x933.google.com; envelope-from=mithnb-at-gmail.com; receiver= Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id ED3487FC59 for ; Tue, 9 Feb 2021 18:34:44 +0000 (UTC) Received: by mail-ua1-x933.google.com with SMTP id a31so6146927uae.11 for ; Tue, 09 Feb 2021 10:34:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pGz7SNJy70yX9HvJwVZIQ8R8hpc7WISa36dmEDEhy0c=; b=b+G6JlGUo2BCn+7PYto+pzAYAwZF11mfJs3PTI93LAlQX/fESb4TB1kjYCEjOnaNfz j2TkoljOpE//atctV3JFyjI7B/qn1TzYkN0kohBKv0XXjJbl969Ud8WARhEEBN5CrsyP sqJQyKlTK3xxxBF7K9gDrhYaS/xyq6VFjd0DnhGYNt7hKOM6IT1Zo3CzbFDWIk6kD7wt j2F63pPlsPGHvZdkKF1wxKUlcovwZjqqJaPHxUD4mARs0NzZzXvX3iYK+DZsD6YwUs6+ 4hjM9TWC7C5KXtG/K+Bpc1Fn/bkGkyCMK/hsbGfpdwNBLaOrbRX92xoDAhqBuapJSd+y SQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pGz7SNJy70yX9HvJwVZIQ8R8hpc7WISa36dmEDEhy0c=; b=KqY7qQNXWMZQgN1mlTFYBGbdJEciA0JWPlYY1qD9qJppI6igQVtVvedc+JcSbKjwD5 VQO3t/419PqHDW/ea6TFPXlxiYEpFYey8YRiSCY6YcsP5R59VLvypFIesrFZ9v+A4YD3 XbGbH9C5Wzdr6dCVrlrmJMKzyqbJA9a+z2bNP+pF2I43R7YO8uabuHnsoNjT8T2HDPDH wuBc0DkYiOH6fW+HVPt1i15/Nr5wg5rrvPMC/VTl0Girev+0fLYJephoY7fJ2NetcNCv 1Wy67XAR+aE8v1VoljCDfShTOGZIk/k4UXeTlHZDwYZzazbfnXnKti9+GsCGZIh9wTdk f7Wg== X-Gm-Message-State: AOAM533mK7oaOxAAL6psbpCLVwpYfuVi3ET+J1kBN4i++oD4CQk+Q6pN 8ZxakinDLo2peU5P+Zb586GHMXCfAUO7CmPNiMniAN9d X-Google-Smtp-Source: ABdhPJwmGAR3gFEuSRNJcT9K04Sk+NUIzM7j9dULUkKjRCM+75v6tHdLzNVyYTeWXqH9qxygV5i2s/ASOzv3oOooiAM= X-Received: by 2002:ab0:22ca:: with SMTP id z10mr14594352uam.73.1612895678142; Tue, 09 Feb 2021 10:34:38 -0800 (PST) MIME-Version: 1.0 References: <5DT5OQ.TMVDQL2ALCKH-at-crc.id.au> <20210207200539.a916a6af80093eb8a56ab4dc-at-wanadoo.fr> <20210209184659.3e799e6d7ec5901929234d9c-at-wanadoo.fr> In-Reply-To: <20210209184659.3e799e6d7ec5901929234d9c-at-wanadoo.fr> From: Mithun Bhattacharya Date: Tue, 9 Feb 2021 12:34:26 -0600 Message-ID: To: mod_perl list Subject: Re: [Hangout - NYLXS] Moving ExecCGI to mod_perl - performance and custom 'modules' [EXT] X-BeenThere: hangout-at-nylxs.com X-Mailman-Version: 2.1.30rc1 List-Id: NYLXS Tech Talk and Politics List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0588134696==" Errors-To: hangout-bounces-at-nylxs.com Sender: "Hangout"
--===============0588134696== Content-Type: multipart/alternative; boundary="000000000000f49f1405baeb8961"
--000000000000f49f1405baeb8961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Connection caching does work for most use cases - we have to accept James works in scenarios most developers can't fathom :)
If you are just firing off simple SQL's without any triggers or named temporary tables involved you should be good. The only times we recall tripping on cached connection is when two different code snippets tried to create the same temporary table. Another time the code was expecting the disconnect to complete the connection cleanup.
On Tue, Feb 9, 2021 at 11:47 AM Vincent Veyron wrote:
> On Sun, 7 Feb 2021 20:21:34 +0000 > James Smith wrote: > > Hi James, > > > DBI sharing doesn't really gain you much - and can actually lead you > into a whole world of pain. It isn't actually worth turning it on at all. > > > > Never had a problem with it myself in years of using it, but I wrap my > queries in an eval { } and check $-at-, so that the scripts are not left > hanging; also I have a postgresql db ;-). > > I ran some tests with ab, I do see an improvement in response speed : > > my $dbh =3D DBI->connect() > Concurrency Level: 5 > Time taken for tests: 22.198 seconds > Complete requests: 1000 > Failed requests: 0 > Total transferred: 8435000 bytes > HTML transferred: 8176000 bytes > Requests per second: 45.05 [#/sec] (mean) > Time per request: 110.990 [ms] (mean) > Time per request: 22.198 [ms] (mean, across all concurrent requests= ) > Transfer rate: 371.08 [Kbytes/sec] received > > my $dbh =3D DBI->connect_cached() > Concurrency Level: 5 > Time taken for tests: 15.133 seconds > Complete requests: 1000 > Failed requests: 0 > Total transferred: 8435000 bytes > HTML transferred: 8176000 bytes > Requests per second: 66.08 [#/sec] (mean) > Time per request: 75.664 [ms] (mean) > Time per request: 15.133 [ms] (mean, across all concurrent requests= ) > Transfer rate: 544.33 [Kbytes/sec] received > > > -- > > Bien =C3=A0 vous, Vincent Veyron > > https://compta.libremen.com > Logiciel libre de comptabilit=C3=A9 g=C3=A9n=C3=A9rale en partie double > > > >
--000000000000f49f1405baeb8961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Connection caching does work for most use cases - we have = to accept James works in scenarios most developers can't fathom=C2=A0:)= =C2=A0
If you are just firing off simple SQL's witho= ut any triggers or named temporary tables involved you should be good. The = only times we recall tripping on cached connection is when two different co= de snippets=C2=A0tried to create the same temporary table. Another time the= code=C2=A0was expecting the disconnect to complete the connection cleanup.=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s= olid rgb(204,204,204);padding-left:1ex">On Sun, 7 Feb 2021 20:21:34 +0000r> James Smith <js5-at-s= anger.ac.uk> wrote:
Hi James,
> DBI sharing doesn't really gain you much - and can actually lead y= ou into a whole world of pain. It isn't actually worth turning it on at= all.
>
Never had a problem with it myself in years of using it, but I wrap my quer= ies in an eval { } and check $-at-, so that the scripts are not left hanging; = also I have a postgresql db ;-).
I ran some tests with ab, I do see an improvement in response speed :
my $dbh =3D DBI->connect()
Concurrency Level:=C2=A0 =C2=A0 =C2=A0 5
Time taken for tests:=C2=A0 =C2=A022.198 seconds
Complete requests:=C2=A0 =C2=A0 =C2=A0 1000
Failed requests:=C2=A0 =C2=A0 =C2=A0 =C2=A0 0
Total transferred:=C2=A0 =C2=A0 =C2=A0 8435000 bytes
HTML transferred:=C2=A0 =C2=A0 =C2=A0 =C2=A08176000 bytes
Requests per second:=C2=A0 =C2=A0 45.05 [#/sec] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A0110.990 [ms] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A022.198 [ms] (mean, across all c= oncurrent requests)
Transfer rate:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 371.08 [Kbytes/sec] receiv= ed
my $dbh =3D DBI->connect_cached()
Concurrency Level:=C2=A0 =C2=A0 =C2=A0 5
Time taken for tests:=C2=A0 =C2=A015.133 seconds
Complete requests:=C2=A0 =C2=A0 =C2=A0 1000
Failed requests:=C2=A0 =C2=A0 =C2=A0 =C2=A0 0
Total transferred:=C2=A0 =C2=A0 =C2=A0 8435000 bytes
HTML transferred:=C2=A0 =C2=A0 =C2=A0 =C2=A08176000 bytes
Requests per second:=C2=A0 =C2=A0 66.08 [#/sec] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A075.664 [ms] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A015.133 [ms] (mean, across all c= oncurrent requests)
Transfer rate:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 544.33 [Kbytes/sec] receiv= ed
--
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Bien =C3= =A0 vous, Vincent Veyron
">https://compta.libremen.com
Logiciel libre de comptabilit=C3=A9 g=C3=A9n=C3=A9rale en partie double
--000000000000f49f1405baeb8961--
--===============0588134696== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ Hangout mailing list Hangout-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/hangout
--===============0588134696==--
--===============0588134696== Content-Type: multipart/alternative; boundary="000000000000f49f1405baeb8961"
--000000000000f49f1405baeb8961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Connection caching does work for most use cases - we have to accept James works in scenarios most developers can't fathom :)
If you are just firing off simple SQL's without any triggers or named temporary tables involved you should be good. The only times we recall tripping on cached connection is when two different code snippets tried to create the same temporary table. Another time the code was expecting the disconnect to complete the connection cleanup.
On Tue, Feb 9, 2021 at 11:47 AM Vincent Veyron wrote:
> On Sun, 7 Feb 2021 20:21:34 +0000 > James Smith wrote: > > Hi James, > > > DBI sharing doesn't really gain you much - and can actually lead you > into a whole world of pain. It isn't actually worth turning it on at all. > > > > Never had a problem with it myself in years of using it, but I wrap my > queries in an eval { } and check $-at-, so that the scripts are not left > hanging; also I have a postgresql db ;-). > > I ran some tests with ab, I do see an improvement in response speed : > > my $dbh =3D DBI->connect() > Concurrency Level: 5 > Time taken for tests: 22.198 seconds > Complete requests: 1000 > Failed requests: 0 > Total transferred: 8435000 bytes > HTML transferred: 8176000 bytes > Requests per second: 45.05 [#/sec] (mean) > Time per request: 110.990 [ms] (mean) > Time per request: 22.198 [ms] (mean, across all concurrent requests= ) > Transfer rate: 371.08 [Kbytes/sec] received > > my $dbh =3D DBI->connect_cached() > Concurrency Level: 5 > Time taken for tests: 15.133 seconds > Complete requests: 1000 > Failed requests: 0 > Total transferred: 8435000 bytes > HTML transferred: 8176000 bytes > Requests per second: 66.08 [#/sec] (mean) > Time per request: 75.664 [ms] (mean) > Time per request: 15.133 [ms] (mean, across all concurrent requests= ) > Transfer rate: 544.33 [Kbytes/sec] received > > > -- > > Bien =C3=A0 vous, Vincent Veyron > > https://compta.libremen.com > Logiciel libre de comptabilit=C3=A9 g=C3=A9n=C3=A9rale en partie double > > > >
--000000000000f49f1405baeb8961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Connection caching does work for most use cases - we have = to accept James works in scenarios most developers can't fathom=C2=A0:)= =C2=A0
If you are just firing off simple SQL's witho= ut any triggers or named temporary tables involved you should be good. The = only times we recall tripping on cached connection is when two different co= de snippets=C2=A0tried to create the same temporary table. Another time the= code=C2=A0was expecting the disconnect to complete the connection cleanup.=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s= olid rgb(204,204,204);padding-left:1ex">On Sun, 7 Feb 2021 20:21:34 +0000r> James Smith <js5-at-s= anger.ac.uk> wrote:
Hi James,
> DBI sharing doesn't really gain you much - and can actually lead y= ou into a whole world of pain. It isn't actually worth turning it on at= all.
>
Never had a problem with it myself in years of using it, but I wrap my quer= ies in an eval { } and check $-at-, so that the scripts are not left hanging; = also I have a postgresql db ;-).
I ran some tests with ab, I do see an improvement in response speed :
my $dbh =3D DBI->connect()
Concurrency Level:=C2=A0 =C2=A0 =C2=A0 5
Time taken for tests:=C2=A0 =C2=A022.198 seconds
Complete requests:=C2=A0 =C2=A0 =C2=A0 1000
Failed requests:=C2=A0 =C2=A0 =C2=A0 =C2=A0 0
Total transferred:=C2=A0 =C2=A0 =C2=A0 8435000 bytes
HTML transferred:=C2=A0 =C2=A0 =C2=A0 =C2=A08176000 bytes
Requests per second:=C2=A0 =C2=A0 45.05 [#/sec] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A0110.990 [ms] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A022.198 [ms] (mean, across all c= oncurrent requests)
Transfer rate:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 371.08 [Kbytes/sec] receiv= ed
my $dbh =3D DBI->connect_cached()
Concurrency Level:=C2=A0 =C2=A0 =C2=A0 5
Time taken for tests:=C2=A0 =C2=A015.133 seconds
Complete requests:=C2=A0 =C2=A0 =C2=A0 1000
Failed requests:=C2=A0 =C2=A0 =C2=A0 =C2=A0 0
Total transferred:=C2=A0 =C2=A0 =C2=A0 8435000 bytes
HTML transferred:=C2=A0 =C2=A0 =C2=A0 =C2=A08176000 bytes
Requests per second:=C2=A0 =C2=A0 66.08 [#/sec] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A075.664 [ms] (mean)
Time per request:=C2=A0 =C2=A0 =C2=A0 =C2=A015.133 [ms] (mean, across all c= oncurrent requests)
Transfer rate:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 544.33 [Kbytes/sec] receiv= ed
--
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Bien =C3= =A0 vous, Vincent Veyron
">https://compta.libremen.com
Logiciel libre de comptabilit=C3=A9 g=C3=A9n=C3=A9rale en partie double
--000000000000f49f1405baeb8961--
--===============0588134696== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ Hangout mailing list Hangout-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/hangout
--===============0588134696==--
|
|