Python Environment: add gevent based WSGI server framework (#750)
* Python Environment: add gevent based WSGI server framework This supply gevent based WSGI server framework to Python Environment, to allow customer to run their functions under multi-threads. * classify the flask based application This set up the flask based application as individual class, to make sure the consistent and integrity. * Add instruction of WSGI server selection applied in Python Environment * Python Environment starting logger: provide framework name
This commit is contained in:
@@ -43,3 +43,23 @@ Or, if you already have an environment, you can update its image:
|
||||
|
||||
After this, fission functions that have the env parameter set to the
|
||||
same environment name as this command will use this environment.
|
||||
|
||||
## Web Server Framework
|
||||
|
||||
Python environment build and start a WSGI server, to support high HTTP
|
||||
traffic. As it is applied in different use cases, this provides two server
|
||||
frameworks: `bjoern` and `gevent`. They all support high concurrency request.
|
||||
|
||||
`bjoern` has good performance on RPS, to be ideal for most light resource
|
||||
utilization cases.
|
||||
|
||||
`gevent` is a good supplement because of its internal multi-threads. It
|
||||
supports heavy resource load functions, with well distribution of response
|
||||
time.
|
||||
|
||||
Python environment pod remains `bjoern` framework by default. And it runs `gevent`
|
||||
framework by setting the container environment `WSGI_FRAMEWORK` value to `GEVENT`.
|
||||
|
||||
The environment value is configured normally in two ways. One way is to set in Dockerfile
|
||||
and build it into image. The other way is to set in Kubernetes deployment spec during
|
||||
pod running and restart it.
|
||||
|
||||
Reference in New Issue
Block a user