rails proc spawning question

Discussion in 'Ruby/Rails' started by jerrett, Jan 5, 2007.

  1. jerrett

    jerrett New Member

    Hello! I'm curious about the spawning of new rails processes that litespeed does...

    will litespeed spawn new procs rather than stack behind an existing/busy one if it hasn't reached max-procs? and if it has reached max-procs is it smart about which procs it sends new requests to (will it send to ones not busy before it sends to ones that are busy, or is it just round-robin?)
  2. mistwang

    mistwang LiteSpeed Staff

    LSWS will spawn one process for each rails application, this process will have the rails framework initialized then watch for new connection from web server, then fork children processes to do the real work, the cost of adding new process is the lowest, the connection between web server and a ruby process will be kept alive whenever possible.

    LSWS tracks which connection is idle and push requests to the process associated with the first idle connection. If all connections are busy and maximum allowed is reached, LSWS will queue the request until next available connection. LSWS always try to use least number of procs. Not round-robin.
  3. jerrett

    jerrett New Member

    Thanks for the quick reply, that sounds pretty much what i was hoping :)

Share This Page