What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

*Question about the speed /response time of the glue API…* I’ve got a docker instance running the S

U02P7B6K2LC
U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet

Question about the speed /response time of the glue API…

I’ve got a docker instance running the Spryker B2C demo. I’ve built a separate Angular app that connects to the Spryker Glue API. At the moment I’m doing simple things like requesting the Category tree and a list of products.

What I’m finding is that the Glue API is taking a long time to respond to requests. Much longer than what you’d expect on a local machine. Some API requests can take 12-15 seconds to respond.

Is this common? Or have I missed some setup configuration?

Many thanks

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    It's definitely not ok.
    There are multiple possible reasons to cause such behaviour:
    • the speed of the host machine itself
    • local env type: docker/sdk or vagrant devvm
    • etc.
    I would say that you need to trace\profile the request and find where it takes time to be processed.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    For example https://glue.at.b2b.demo-spryker.com/catalog-search?q= takes ~140ms to respond.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
  • U02P7B6K2LC
    U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet

    Thank you… I’m using the New M1 Mac with a high spec - and I’m using the Docker setup here: https://github.com/spryker/docker-sdk/pull/225.

    ** but I noted that my previous laptop which was not M1 had the same issue.

    I’m using the docker/sdk

  • U02P7B6K2LC
    U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet

    Ok… so from the developer console… it looks like the DNS lookup is taking 10 seconds.

  • U02P7B6K2LC
    U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet

    With the actual processing taking 0.01 seconds

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited January 2022

    Sorry, I can't help here. I haven't seen any problems like this and I don't experience anything like this on my own but I'm on linux.

    AFAIK M1 support is still on the way and even then there may be performance problems not related to Spryker but to the stack itself on M1\arm chips.

  • U02P7B6K2LC
    U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet

    Thank you Valerii! I’m already deep in StackOverflow threads on DNS! 🙂

  • U012PCVT2DB
    U012PCVT2DB Posts: 66 🧑🏻‍🚀 - Cadet

    Can you paste the answer here, what to do, in order to decrease the DNS-lookup-time?
    If i remember correctly, some other Mac-Users experiences similar problems

  • U02P7B6K2LC
    U02P7B6K2LC Posts: 121 🧑🏻‍🚀 - Cadet
    edited January 2022

    Ok… so I think I found something… but I need a Spryker expert to verify.

    (note: full disclosure… I’ve only been learning Spryker and Docker for a few weeks. So I don’t know if this solution is correct or what the potential consequences are)

    So…

    The DNS lookup delay is actually 5 seconds (ignore comment above I misread the console).

    The delay is EXACTLY 5 seconds… each and every time… which (with my debugging hat on here) tells me there is a setting somewhere that is telling requests to wait 5 seconds.

    So I searched the Spryker installation for “5000” (configs are usually in milliseconds) but this yielded nothing.

    Then I searched “5s” and found settings in: “/docker/deployment/default/docker-compose.yml”

    The setting was under a node called “healthcheck >> timeout”…

    I changed these to “0s” and all requests started running instantly.

    Could someone with more Spryker knowledge than me confirm that this was the fix? Also… was the change I made advisable?

    Many thanks.

  • U013M1LC46A
    U013M1LC46A Posts: 23 🧑🏻‍🚀 - Cadet

    No clue about the DNS lookup & timeout thing, but I can tell you that I recently setup a Spryker project on an M1 machine and had these Glue API response times: access-tokens ~1000ms, guest-cart-items ~600ms. For comparison, the same project with the same settings was ~5x faster on an Intel MacBook.
    And I did not need to modify any healthchecks or timeouts to get it running properly. So something’s definitely off with your project setup or local environment or the machine itself somehow…