public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: cygwin@cygwin.com
Subject: Re: cygserver - Postgres Multiple connection Load Testing - Inifinte Loop
Date: Tue, 28 Mar 2017 05:48:00 -0000	[thread overview]
Message-ID: <20170328052652.GA2351961@tornado.leadboat.com> (raw)
In-Reply-To: <20170324171101.GI29995@calimero.vinschen.de>

On Fri, Mar 24, 2017 at 06:11:01PM +0100, Corinna Vinschen wrote:
> - cygserver is using a defined number of threads in a thread pool for
>   application requests.  Every request is added to a request submission
>   queue and handled by the next free thread in the pool.
> 
>   The default number of threads in the pool is 10.  Each wait for a
>   semaphore is blocking one thread.  If more than the number of threads
>   in the pool are supposed to wait on a semaphore the pool starves.

Interesting.  I can confirm that, without updating software, "cygserver -r 40"
fixes both my self-contained test and my PostgreSQL test case.  Folks can use
that workaround in released-version installations.

>   So what I did now is to allow cygserver to raise the number of worker
>   threads on demand.  That is, if a request is in the queue and all
>   worker threads are busy, just create a new one.
> 
>   There's no way yet to drop threads again, but this should be a minor
>   problem in scenarions which really have a lot of contention.

Agreed.  This is nicer.

> I pushed a patchset now, and uploaded new developer snapshots for
> testing to https://cygwin.com/snapshots/

> Please give it a try

Self-contained test case results look good:

cygwin-20170321.tar.xz "cygserver -r40": ok
cygwin-20170324.tar.xz "cygserver -r40": ok
cygwin-20170321.tar.xz "cygserver -r10": freezes (expected)
cygwin-20170324.tar.xz "cygserver -r10": ok; cygserver output concludes with
  "cygserver: All threads busy, added one (now 21)".

I then tried my PostgreSQL test case ("pgbench -i -s 50" once to setup, then
"pgbench -S -j2 -c16 -T900 -P5" to test):

cygwin-20170321.tar.xz "cygserver -r40": ok for >3600s
cygwin-20170324.tar.xz "cygserver -r40": limited freeze in <1000s; no
  cygserver output
cygwin-20170321.tar.xz "cygserver -r10": classic freeze in <1000s (expected)
cygwin-20170324.tar.xz "cygserver -r10": limited freeze in <1000s; no
  cygserver output for most of the run, then output concluding with
  "cygserver: All threads busy, added one (now 15)" just before the freeze

I call the cygwin-20170324 freezes "limited" because the symptoms differ from
the classic freeze I described upthread.  "strace /bin/true" and "cat
/proc/sysvipc/sem" do not hang, but every PostgreSQL backend process is stuck
waiting on a synchronization primitive.

I can distill another self-contained test case for the limited freeze seen in
cygwin-20170324, but that make take awhile.  I'm sending this early report so
you're aware of the possible regression in cygwin-20170324.

Thanks,
nm

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2017-03-28  5:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200408030333.i733XEXn023894@mx3.redhat.com>
2004-08-03 10:06 ` Corinna Vinschen
2004-08-03 20:45   ` Saravanan Bellan
2004-08-03 20:54     ` Christopher Faylor
2004-08-03 21:10       ` Saravanan Bellan
2017-03-21  2:56   ` Noah Misch
2017-03-21  7:29     ` Marco Atzeri
2017-03-24 17:52     ` Corinna Vinschen
2017-03-25 10:55       ` Marco Atzeri
2017-03-25 12:02         ` Corinna Vinschen
2017-03-25 12:31           ` Marco Atzeri
2017-03-28  5:48       ` Noah Misch [this message]
2017-04-02  2:36         ` Noah Misch
2017-05-07  3:35           ` Noah Misch
2017-05-07  4:01             ` Larry Hall (Cygwin)
2017-06-14 23:32               ` Marco Atzeri
2017-06-20 11:11                 ` Corinna Vinschen
2017-06-20 17:29                   ` Marco Atzeri
2017-06-21  7:58                     ` Corinna Vinschen
2004-08-03  3:33 sarbx-cygwin6344
     [not found] <200407302132.i6ULWwXn016838@mx3.redhat.com>
2004-08-02  9:45 ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2004-07-30 22:09 sarbx-cygwin6344
     [not found] <200407290319.i6T3JCXn018245@mx3.redhat.com>
2004-07-30 13:43 ` Corinna Vinschen
2004-07-29 10:35 sarbx-cygwin6344

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170328052652.GA2351961@tornado.leadboat.com \
    --to=noah@leadboat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).