简体   繁体   中英

apache mod_wsgi process state

So far I've known how do Java servers work and how does PHP/Apache works:

  • Java servers can hold the state of the application in the memory. For example, you define an integer value in a bean and each page request increments display count. After each refresh, the value is incremented
  • PHP/apache doesn't store the application state, at least as far as I know. Each request is just a new PHP process which loads everything from scratch (if there is no accelerator, the server can be damn slow) and more or less, there's no possibility to share any state between requests directly. You have to use either persistence (files, dbs) or session.

Now I'm starting to use wsgi. I can see, that it can hold the app state (I just did analogical example as with Java). My question is - how does it work - since Apache/PHP doesn't store app state and Apache/python-wsgi does. Does it mean that, although the server software is the same, mod_php and mod_wsgi are totally different? Addiionally, I see that if I change anything under my python application, I need to restart apache to update the application. Can I pgrep wsgi process somehow?

Go read:

for an understanding of the different ways Apache/mod_wsgi can run.

There is a section towards the end about process state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM