spec-first / connexion

Connexion is a modern Python web framework that makes spec-first and api-first development easy.
https://connexion.readthedocs.io/en/latest/
Apache License 2.0
4.48k stars 761 forks source link

Connexion and zappa on AWS Lambda: very slow cold starts #934

Closed dirkgomez closed 3 years ago

dirkgomez commented 5 years ago

Description

Evaluating Connexion for our microservices application which fully runs on AWS lambda.

I'm experiencing fairly slow cold starts with Connexion, e. g. it takes ~3 seconds just to run

import connexion

The API in case is really small as it is merely a sample project, it has 6 REST endpoints, which in turn are more or less just sample endpoints. The endpoints use operationId to associate connexion and the code itself, like this:

  /api/hello:
    get:
      operationId: api.hello
      summary: Say hello world
      responses:
        200:
          description: 'Hello World Flask and Zappa'
          schema:
            type: string

(See #306, it's fairly outdated though)

The Lambda runs with 512MB memory.

Expected behaviour

Cold starts are faster.

Actual behaviour

Steps to reproduce

Cold starts are very slow.

Additional info:

Output of the commands:

Lambdas with Python 3.6 Connexion 2.2.0

BorisCodinis commented 4 years ago

I'm having the same problem. Any news?

kanbber commented 4 years ago

I run into the same problem... Any solution?