Connect ETIMEDOUT error ?

Options
Hi everybody,
I have a recurring problem and I do not understand where it comes from... 
After 1200/1300 different API calls, I often get an error "connect ETIMEDOUT"...

Each endpoint uses an authentication and I am in place "Scale x1".

What could be the cause of this? 

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    Are you seeing that error in Xano or is it your front-end refusing to connect to Xano? (Or is this a background processs and not about frontend/backend at all?)
  • Peter
    Peter Member
    Options
    Both, but more often on the Front side. Do you know if there is a limit to the number of API requests per hour in Scale x1?
  • Chris Coleman
    Chris Coleman Administrator

    ADMIN

    Options
     There is no rate limiting on the Scale plan, so any timeout errors you find could be attributed to an external API request not completing in the specified timeout duration or due to maxing out instance resources.
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     How long do your API calls typically take to return? under a second? Over 10s? Do some endpoints take a lot longer than others? (maybe those that have a dependency on an external API call?)
  • Peter
    Peter Member
    Options
    Hi , 
    ok, but what is the limits of instance resources ?
    Indeed, I had the feeling that the cache/memory was saturated on the Xano side. We had a migration to do recently to send data to Xano and every 1500 requests or so, a "connect ETIMEDOUT" was coming.

    After that, we did some load tests (like simple newletter record) and beyond 15 requests per second, the instance shows signs of fatigue.

    We are currently studying all our logics to optimize as much as possible
  • Peter
    Peter Member
    Options
    Hi ,
    less than a second, I sequenced by putting 500ms between each call to relieve the server. 
    I have to specify that I used n8n on a dedicated server to iterate on the data and coordinate the calls to Xano.
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     Ah! Are you using this for some kind of data ingress? Like each request adds a new record to the database, something like that? And if I'm way off track, can you set me straight? More context might help me see through to the bottleneck and maybe that leads to recommendations.
  • Peter
    Peter Member
    Options
     , 
    indeed, new record and update the record. We have a lot of records can be updated by different sources (like webhook for example)
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     Are these large tables? Are there multiple indexes on them? Add-or-update is actually kind of expensive because it puts a high-integrity read in front of the write action. If you know, for example, that this is an add vs an update, you can save yourself pain. 

    Another thought: since you are on scale, you also have the option of using Redis to cache new answers pretty darn fast and add them to the database in a batch process that could run pretty frequently. This ersatz queuing process creates eventual consistency while preventing your database from being a bottleneck. 
  • Peter
    Peter Member
    Options
    Hi ,
    Yes, we have several thousand entries and regular additions or updates. An entry can contain up to 50 fields.
    We also use Redis for heavy queries, however, I wonder if it would be relevant to cache after each new entry or update of a cached entry, it could represent a lot of data... do you know what is the max capacity of cache with Redis?  
  • Kumar Majethia
    Options

    Hi, was this issue resolved? We're seeing similar issues on our scale1x instance. Any help around how to solve this is truly appreciated.

    We have a firebase tasks queue that sends out a batch of requests (sequentially 1 per second and 1 active task) over 30 minutes or so. It's a batch process that needs to run each night. The response time in all cases is <500 ms so it doesn't seem to be server load causing this. The API doesn't call any external APIs.

    Our Google Cloud instance is in the same region as Xano. Do we need a VPN or something?

  • Kumar Majethia
    Options

    Hi, our issue was on the firebase side. We had a serverless vpc connector and were directing all traffic through a static ip associated with the vpc connector. We removed that and the issue got resolved.

    If you have any other subsystem or micro service environment talking to Xano, it might help to test the Xano APIs directly from a local client first. That will help isolate the problem.