Some replicas are not being utilized
jonas-admin
PROOP

2 months ago

I'm trying to load test a Go microservice using Locust.

We've been exploring Railway's horizontal scaling since we are considering that a distributed approach might yield better results.

I tried a 4-replica setup with 2vCPU and 2GB RAM. The performance is definitely better than vertical scaling alone (as tested on 8vCPU, 8GB RAM).

However, I've noticed that based on the metrics, 2 replicas seem to not work at all. Their usage seem to be 0vCPU and just ~50MB RAM even under load.

21 Replies

jonas-admin
PROOP

2 months ago

Locust charts

1445252167421268000


jonas-admin
PROOP

2 months ago

Tried to bump it to 2000 VUs since I thought maybe it needed more traffic.


jonas-admin
PROOP

2 months ago

1445252493020893200


jonas-admin
PROOP

2 months ago

1445252552689188900


jonas-admin
PROOP

2 months ago

The two replicas seem to not work at all. Is this a load balancing issue?


jonas-admin
PROOP

2 months ago

1445254932952514800


jonas-admin
PROOP

2 months ago

Redeployed the service


jonas-admin
PROOP

2 months ago

replicas 1 and 3 seem to work now but replica 0 dropped in utilization


jonas-admin
PROOP

2 months ago

Still testing with 1000 VUs

1445255200112640000


brody
EMPLOYEE

2 months ago

Where is Locust making these requests from?


jonas-admin
PROOP

2 months ago

Inside the project


brody
EMPLOYEE

2 months ago

Aka, private networking?


jonas-admin
PROOP

2 months ago

Yes


brody
EMPLOYEE

2 months ago

Then I suspect Locust is not correctly balancing its requests across all returned IP addresses from the DNS lookup.


jonas-admin
PROOP

2 months ago

Is it also possible to encounter this in public networking?


brody
EMPLOYEE

2 months ago

No, on the public network, our L7 proxy will randomly distribute incoming requests to all replicas.


jonas-admin
PROOP

2 months ago

I see. I hope this issue is not present when using cloudflared since we are considering the use of CF tunnels to route in/outbound traffic of our services in Railway.


brody
EMPLOYEE

2 months ago

I am not sure if the Cloudflare Tunnel service will correctly distribute requests to all DNS results.

I feel like you may have told me previously, but why use a Cloudflare tunnel instead of our proxy?


jonas-admin
PROOP

2 months ago

For compliance reasons. We are aiming to be PCI-DSS compliant, among other things, and using a centralized approach for a WAF/Network stack is a business decision.


jonas-admin
PROOP

2 months ago

Also, using CF tunnels instead of other service mesh solutions is a better fit in terms of cost and maintainability in our case


brody
EMPLOYEE

2 months ago

Fair enough.


Loading...