You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Adam Kocoloski (JIRA)" <ji...@apache.org> on 2010/10/21 18:20:17 UTC

[jira] Commented: (COUCHDB-901) refactor os process management

    [ https://issues.apache.org/jira/browse/COUCHDB-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923498#action_12923498 ] 

Adam Kocoloski commented on COUCHDB-901:
----------------------------------------

I added a feature to the couch_proc_manager in my github branch, a "soft limit" on the number of OS processes.  In contrast to the code in trunk, which delays requests for OS processes, couch_proc_manager will continue to spawn new processes, but it will only reuse the ones that are returned if the number of active processes is below the soft limit.

I can see the benefit to a hard limit, but in general I feel pretty uneasy about blocking short requests for an arbitrary amount of time.  The view updaters in particular will hold onto an OS process for a very long time.  In my opinion a hard limit is probably most useful to protect against malicious intent.

> refactor os process management
> ------------------------------
>
>                 Key: COUCHDB-901
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-901
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: Database Core
>    Affects Versions: 1.0.1
>            Reporter: Adam Kocoloski
>             Fix For: 1.1
>
>
> Wanted to make sure this doesn't get forgotten in the planning for 1.1.  Paul Davis and I independently refactored couch_query_servers.  Paul's work is much more comprehensive and includes a switch to emonk:
> http://github.com/davisp/couchdb/tree/emonk
> The work I did is here
> http://github.com/kocolosk/couchdb/tree/COUCHDB-901
> One feature not included in that branch is the ability to limit the number of OS processes.  Should be simple to add if my work ends up being merged.  I did the refactor because I was having problems with couch_query_servers "forgetting" about OS processes in BigCouch.  One of the ets tables held by couch_query_servers would list thousands of processes (and in fact there were thousands of spawned couchjs), but another table would claim that only two were running.  After digging through the code a while I became frustrated with all of the tracking of multiple ets tables and rewrote a server that used only one table.  Other changes include
> * ability to reuse an OS process when the client that requested it dies.
> * better behavior under config changes - doesn't kill all query servers when [query_servers] or [native_query_servers] block changes

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.