On Nov 11, 7:18 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Or use mod_wsgi daemon mode and delegate TG application to run in > > since mod_wsgi daemon mode process. > > But isn't that also subject to occasional shutdowns through apache?
No. The 'occasional shutdown' issue you are referring to is most like pertaining to the fact that for Apache child worker processes (ie., mod_wsgi embedded mode), Apache can create additional processes on demand and will then reap processes which are no longer available when demand drops off. When using mod_wsgi daemon mode you specify the number of processes and threads and unless you configure mod_wsgi for inactivity-timeout or maximum-requests, those processes will persist indefinitely, or at least until you perform an explicitly restart or shutdown. > If not, the problem of several daemon processes not being able to > communicate with the same serial line still persists. You could go for > just one process with several threads - but that takes away IMHO one of > the main reasons for apache. No it doesn't need to. The first reason is that dynamic Python web applications of a typical user never tax the web server bad enough that you need to have multiple processes. Also, only the dynamic requests are handled by the separate single daemon process, static requests, provided you configured them, are still handled by the Apache child worker processes. Even if it turns out you need multiple processes for your web application, for example if it isn't thread safe, then mod_wsgi is still flexible to accommodate pyserial as you could delegate a specific URL subset of your application to be handled in single daemon process group and have all others handled across multiple processes or even in embedded mode. That way all serial port manipulations can be isolated from the rest of the application. In other words, mod_wsgi allows you to quite easily direct URLs to be handled in different processes yet overall appear as if they are the same application. Thus, if have constraints on usage of a shared resource by single process, delegate the URLs for that resource to a single process. If you have URLs that have high transient memory usage or leak memory, delegate them to a set of processes which define maximum-requests and inactivity-timeout so process reclaimed on a regular basis to try and constrain overall memory usage. There is more to mod_wsgi and what it can do than most would realise. :-) Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

