> On 17 May 2018, at 10:17 pm, Michael Kirk <[email protected]> wrote: > > Hi, > > I'm running a python app using mod-wsgi-docker, as a replacement for using it > on a manually configured server. > > The application is flask/sqlalchemy/mysql, and it's working fine, except I > see occasional errors that seem > to be sqlalchemy complained that an existing transaction needs to be rolled > back. It's just a guess, but I > wondering if this due to new requests being handled by an existing process > that has handled previous > requests that have left state lying around, like unclosed sessions, that are > causing new requests to fail. > > While no doubt I should find and fix where state is not cleaned up - I'd be > keen to not be exposed to problems > like this. And I think I could do this by configuring each request to be > handled in a separate process. > > Is is easy to do this? I've been only using the default setup, which seems to > be 1 process, 5 threads. > How can I change this to, say, 5 processes, each single threaded, and would > that help? Or would it > make no difference because the same processes remain used for multiple > requests. And if that's the > case, is there a way to have a new process started and finished for each > request?
See: https://github.com/GrahamDumpleton/mod_wsgi-docker/blob/master/3.5/start.sh#L52 <https://github.com/GrahamDumpleton/mod_wsgi-docker/blob/master/3.5/start.sh#L52> You can set environment variables on the container to override processes/threads used. Can't comment on the errors you are getting without see the actual error messages so understand better what you are talking about. There are many people who would use that combination in multithreaded applications. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
