#90 Use flask and gunicorn instead of aiohttp.
Closed by cverna. Opened by cverna.
cverna/mdapi move_to_flask  into  master

Download 90.patch

This commit moves mdapi from the aiohttp framework to flask. This
is done since there is little interest in using aiohttp because all
the call to sqlite are io blocking. There is no asyncio driver for sqlalchemy
and sqlite.
Also performance with Flask and 4 gunicorn workers are better than the
performances achieved with aiohttp.

Signed-off-by: Clement Verna cverna@tutanota.com

rebased onto 99321b95f0f82088a82faf2e44d122a6a80f2f9b

rebased onto 8036b1a4fc651a410f3f0f267a1131b918fcbacc

rebased onto 670020c95a29a0a2acf74ee683a272e0427e2612

Pull-Request has been closed by cverna

Hey @cverna is there a specific reason you closed this PR?
I thought you said it made mdapi simpler, faster and more reliable?

If that's the case, I think I'd like to take the time to review it :)

Hey @cverna is there a specific reason you closed this PR?
I thought you said it made mdapi simpler, faster and more reliable?
If that's the case, I think I'd like to take the time to review it :)

Yes it is still quite slow which makes the pod crash in OpenShift (when indexing packages the health probe are failing which cause the pod to restart). The main reason I looked at flask was because I did not find any asyncio library for sqlite but I came across one (https://github.com/encode/databases) so I think that might be a simpler change to use this for all the db calls and not have blocking call to sqlite.

I also need to look at the packages script to see if it could be a bit less aggressive towards mdapi.

Metadata