About Gevent, Async and server's performance

Some server’s methods (like JSON processing or compression) not supported greenlets switching while processing. It can be big performance problem on highload.

I start to implement functionality to solve this. This functionality implemented in sub-package flaskJSONRPCServer.experimental, and you can try to use it on your risk (actually this sub-package used by me on prodaction systems from 2015 year, but i want more specific testing, before it will moved from experimental).

Another big problem - not any code compatible with greenlets. This problem can be separated to 3 others:

  1. Incompatible C-python extensions, like gzip, that block greenlet-switching while processed.
  2. Incompatible IO operations, like PyMysql. Even if it patched with gevent, it can brake all server while receiving long data.
  3. Simply long-executed python code without ability for switching greenlets. It's every logical or math code, like iterating objects or arithmetic operations. While it processed, all server wait for complition.

For solving first and second problem i create a workaround, that can be used like result=server.callAsync(targerFunction, args, kwargs) and run given function asynchronously, without blocking server. It really works!

But third problem more complicated. Only really working solution for solwing this is using parallel executing backend for "heavy" dispatchers.