Threaded mod_python code

I wrote a Django app that uses Python streams to create a web, the spider works like a series of streams to check links.

When I run this app using django test server (built-in) the app runs fine and threads seem to start and stop in time.

However, when running the application on Apache, it seems that the threads are not starting or starting (after about 80 seconds there should be a database update in the queue and these changes are not happening).

Does anyone know what I'm missing here?

- Edit: my question is: how does Apache handle streaming applications i.e. is there a limit to the number of threads that can be started from one application?

Any help would be appreciated!

+1


source to share


1 answer


Most likely, you are missing the creation of new processes. Apache doesn't start in a single process, but it does virtual new processes for requests from time to time (depending on a dozen configuration options ). If you run django in every process, they won't use memory, and the results from one workstation won't be visible to anyone else. In addition, the Apache process may terminate (idle or after a certain amount of time), discarding your results in memory.



+3


source







All Articles