• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

20. Custom Applications > Daemonize It

Daemonize It

The best way to get CGI-like behavior, with far greater performance and scalability, is a common Unix technique I call daemonization, after the Unix daemons lurking in the background of every Unix machine waiting for events to handle. The basic idea is that, instead of having a CGI start in response to a query and then die, startup a persistent CGI-like process (a daemon) along with the web server. The daemon can even be on a different machine than the web server. When the web server gets a request pointing at the daemon, it simply connects to the daemon, hands over the request, and waits for the results (while still able to handle other requests).

Java servlets run as daemons. Start servlets running and connect to them as often as you like, avoiding the overhead of startup. The fact that Java is interpreted is less significant than the performance gain derived from leaving the servlet running. Servlets are multithreaded, isolating clients from each other. See Chapter 15 of


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint