I'm trying to run Airbyte on EKS with an external ...
# replication-troubleshooting
j
I'm trying to run Airbyte on EKS with an external RDS Database. It looks like everything is working, but the server component restarts quite often due to timeouts in the Liveness/Readiness probe. I've increased this value from 1s to 10s but it still times out and still shuts down the server. I'm don't understand why
I don't know if these logs are particularly useful but this is what I see
Untitled
My guess it has something to do with the health check endpoint. I looked up the code and it reads from the db as part of the health check.
p
I had the same problem and ending up disabling liveness probes (only let the readiness ones)
j
Yes. this is what I ended up doing. My hypothesis is that this db check is not as innocuous as it seems. It's subject to locking because you are essentially doing a FTS even if you only want 1 row (and you throw that row out)
Copy code
airbyte=> explain select id from workspace limit 1;
                            QUERY PLAN
------------------------------------------------------------------
 Limit  (cost=0.00..0.26 rows=1 width=16)
   ->  Seq Scan on workspace  (cost=0.00..10.40 rows=40 width=16)
what you really want is like SELECT 1 FROM DUAL or whatever as a db connectivity check; but the comment makes it seem like this is impossible. Maybe just creating an empty table for healthchecks and using that would be an alternative? Since this is postgres though; I feel like just
SELECT 1
is enough
Copy code
airbyte=> explain select 1;
                QUERY PLAN
------------------------------------------
 Result  (cost=0.00..0.01 rows=1 width=4)
(1 row)
Would a PR changing the
SELECT id FROM workspace LIMIT 1
to
SELECT 1
in
io.airbyte.config.persistence.ConfigRepository
be a welcome change? Is there some context about this I'm missing?
n
Hey Justen! I need to look more into this to get context myself! I'll get back to you on this one!
j
thank you!
The change I propose is to replace:
Copy code
database.query(ctx -> ctx.select(WORKSPACE.ID).from(WORKSPACE).limit(1).fetch()).stream().count();
with
Copy code
database.query(ctx -> ctx.fetch("SELECT 1")).stream().count();
Today I noticed that the webapp actually seems to be testing the API too since its hitting
/api/v1/health
so I needed to remove readiness/liveness checks from the webapp as well
FYI: this has some pretty good guidance around what should be probed: https://github.com/zegl/kube-score/blob/master/README_PROBES.md
in particular, readiness and liveness probes should not depend on downstream systems (ie Postgres). This could be done as part of the startup probe to prevent misconfigured pods from being considered OK.
although in the case of the server and webapp; its probably best just to have a readiness probe that returns 200 OK on some endpoint
So: • In the
server
component; instead of even doing SELECT 1 the health handler should simply return
200 OK
. for backwards compatibility maybe provide a
/api/v1/healthz
endpoint that does this • In the
webapp
component; probably just hit
/
to see if nginx is up; or maybe add a new location like
/healthz
that just returns
200 OK
@Nataly Merezhuk (Airbyte) would a PR doing the above be something that AirByte would be interested in receiving?
a
Thanks for posting @Justen Walker! If you don’t mind sharing, 1. by removing the liveness checks, did you encounter any performance issues? 2. what instance size are you using for your external RDS? We’re running into the same issue and we had removed the liveness checks. But we saw issues with instability after removing it. Appreciate your help
j
I've still not been able to get around performance issues. Removing liveness checks prevent the server from restarting when the health checks fail. My instances size is
db.m6g.xlarge
But I don't think it should actually need to be that big : I suspect the latency is some problem closer to the server / airbyte components.
🙏 1
I'm starting to think killing the server periodically (even if accidentally via the liveness check failures) is somehow masking a larger issue
a
Right on. What we’ve been doing is running 2 replicas of airbyte-server with the liveness checks. This ensures that a bad airbyte-server gets restarted and requests get retried on a working airbyte-server. We still run into issues occasionally, but better than waiting for the single airbyte-server instance to restart
It seems like
airbyte-server
just freezes after it runs for a certain amount of time. We don’t have monitoring in place but we’ve seen the memory usage go all the way up to 6gb (current image from
kubectl top pods
). Unsure if it’s a memory leak.