Forum Moderators: phranque

Message Too Old, No Replies

many services, one dispatcher

httpd dispatcher for services

         

kmufasa

10:52 am on Sep 21, 2011 (gmt 0)

10+ Year Member



Hello all,

I saw this thread on another board. It is exactly like my problem:

[stackoverflow.com...]

PROBLEM:

The problem is that our backend code is not thread safe therefore I will need to run a separate process on Solaris .... However, for performance reasons I cannot start and finish process for every request from the GUI.

This design means that I need to take care of several problems:

  • there must be a single point of contact for the GUI code,
  • the communication must happen with the instance started during first call (it should either be routed or the first call should return address of the actual server instance),
  • there must be some keep-alive messages sent between GUI and server process to manage lifetime of server process (server process cannot run forever).


  • QUESTION:

    Could you recommend a framework that would take care of these details (message routing/dispatching and lifetime management)?


    RESPONSE:

    You could technically configure Apache httpd to spawn a new instance per connection. The configuration also allows you to manage the time the processes stay alive when idle, and how many processes to leave running at a minimum. This would work well as long as the web service is stateless. A little weird, but technically feasible



    I just thought about it, and you could probably use HTTP 1.1 keep-alives to manage the life of the process too. Apache lets you configure how long it will allow the keep-alive to remain open, which keeps the thread/process for the connection active


    MY QUESTION: How do I do the items marked in bold?

    Any help, hints or advice would be greatly appreciated :-)

    Regards, Casey