简体   繁体   中英

Express Gateway degraded causing huge delays on requests

I have a Gateway configured to handle some services, but there is a huge performance issue and I don't know how can I address this. This is the config for this particular service:

http:
    port: 3020
    hostname: 'xxxx.prod.xx.xxx.net'
apiEndpoints:
    laPrdTest:
        host: 'xxx-xxxxxxxx.xxxxxxxx.com'
        paths: '/api/v1/esign/*'
serviceEndpoints:
    laPrdTest:
        urls:
            - http://xxxxxx-app1.prd.xxx.xxxxxxxx.net
            - http://xxxxxx-app2.prd.xxx.xxxxxxxx.net
policies:
    - basic-auth
    - cors
    - expression
    - log
    - jwt
    - proxy
    - rate-limit
pipelines:
laPrdTest:
        apiEndpoints:
            - laPrdTest
        policies:
            - cors:
            - log:
                - action:
                    message: ${req.method} ${req.originalUrl} ${JSON.stringify(req.headers)}
            - rate-limit:
                - action:
                    max: 50
                    windowMs: 120000
                    rateLimitBy: "${req.ip}"
            - proxy:
                - action:
                    serviceEndpoint: laPrdTest
                    changeOrigin: true

Check on this gif so you can see how this is very bad on performance:

性能不佳的快速网关

And this is a call directly to the service API with no performance issue:

无网关

Why is this happening? What can I do to solve this issue?

Finally I couldn't use this anymore an move to do the proxy through Nginx directly. Any request made through the Gateway it took seconds almost minutes and now using Nginx as a gateway it takes miliseconds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM