I am a newbie at using mod_wsgi. I was able to get it working using my 
swagger py module (to replace the dev flask server) , but every time the 
.wsgi file runs it causes the add.api yaml files to reload which take 3 
secs since it re-launches my py file for each api call.  This seems like a 
lot of overhead per call. How can I preload these yaml files to avoid this 
overheard?  I cannot seem to find an example of what I am trying to do.  
Everything is working except this overhead will affect performance when 
processing many rest api requests.  When I used to just run it as w/the dev 
FLASK server via app.run, I ran it as a daemon process in the background 
and it only loaded the yaml files on start up and I proxied calls to the 
specified port so I didn't see this repetitive overhead.
    
WSGIDaemonProcess mytest user=apache group=apache display-name=me-mytest 
processes=5
    WSGIScriptAlias /mytest /xxx/bin/mytest.wsgi process-group=mytest
    <Directory "/xxx/bin">
        WSGIProcessGroup mytest
        WSGIApplicationGroup %{GLOBAL}
        Require all granted
    </Directory>

mytest.wsgi
#!/usr/bin/env python3
from mytest import app as application

mytest.py
 def app(environ, start_response):
    ...
   app = connexion.App(__name__, specification_dir='./')
   app.add_api(...)
   app.add_api(...). ----> TAKING 3 seconds overall for each request being 
processed
    if __name__ == '__main__':
       app.run(host=xyz, port = 123) -> Runs dev FLASK server - generally 
run in background as daemon process
    else:
      return app(environ, start_response) -> Runs via mod_wsgi 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/2c0cb17a-4a46-4eb8-8e36-56e1d10365a6n%40googlegroups.com.

Reply via email to