1

I am going to setup Apache together with cherrypy. From the cherrypy documentation:

if you have a simple website that doesn't have a really high traffic website 
(say, less than 50 hits/second) [...], then running CherryPy exposed is fine.
Otherwise, running it behind Apache is probably the right option for you.

Cherrypy standalone would create a thread pool and serve the requests. When I am using it behind the Apache, Apache adds some magic that it can handle larger loads.

My question is: what does the apache exactly do there? Does it manage the thread pool itself? Does it create more threads? Does it do a better job with work scheduling? Does it spawn a separate cherrypy instance for each Apache thread?

My question is not what Apache does in general, I know that :) I want to know which of the cherrypy "responsibilities" are moved to Apache so this tandem perform better

Related:

Community
  • 1
  • 1
Jakub M.
  • 32,471
  • 48
  • 110
  • 179

1 Answers1

1

Basically it is an additional layer of process/threads.

If apache is configured with the worker dispatch, the configuration directives of ThreadsPerChild and MaxClients define the amount of threads and process the apache server is going to have.

For example a request of a website include 5 images, 3 scripts , 2 stylesheets and 1 for the content, that is 11 requests. The browser does not make all the request in parallel, but you are going to spend a considerable amount of memory and threads serving static content, is like passing a "raw product" through a factory which produce sophisticated products and just use the space on the factory to deliver the unmodified product and leave in the factory big empty boxes (memory) which it was used to transport the raw product.

The threads of the apache process are "cheaper" in the sense that are made to make just one job, handle the connection to the client and delivery wherever the module/handler of apache delivers to the connection.

cyraxjoe
  • 5,661
  • 3
  • 28
  • 42