cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
544 stars 149 forks source link

master process miscounts/conflates "ready workers" and "active" processes? #2104

Open elliefm opened 7 years ago

elliefm commented 7 years ago

Noticed while experimenting with #2102. For a service with one preforked process and no clients yet, I would expect s->ready_workers to be 1, s->nforks to be 1, and s->nactive to be 0. But all three are 1.

elliefm commented 7 years ago

I then fired up thunderbird (which makes many connections), and now s->readyworkers is still 1 (per pre-fork), s->nforks is 8, and s->nactive is 8.

Looking at the counts self-reported at the same time by imapd, there are 7 processes actively serving clients and 1 (pre-forked) ready listener. So s->readyworkers and s->nforks look like they're accurate, but the s->nactive count is also including the preforked process when it seems like it isn't meant to.

elliefm commented 7 years ago

Basically, it seems like there's some confusion between comments and implementation about whether s->nactive represents the number of processes currently running (including preforked processes with no client), or whether it's the number of processes currently serving clients.

elliefm commented 7 years ago

I think this is technically trivial to sort out; the main thing is deciding what we want nactive to mean, and then making it mean that.

People with production experience, what's useful? What do you expect? What do you want? Ping @robn @brong @ksmurchison @postilion

elliefm commented 7 years ago

Throwing this back in the diceroll pile for now