11 Replies
Project ID:
N/A
Replicas can not use volumes unfortunately
Is there any workarounds. We just use it for caching
Not that I know of, the only somewhat kinda almost functional workaround would be tomake an API for uploading and downloading files from a single server with a volume
of course this will give problems regarding scalability and of course egress counts against you in terms of price
but depending on what specifically you're doing, it could maybe help
use redis for cache?
but yeah you can only attach one volume to one service at a time currently, this will not be the case forever though
yeah we will prob use redis or something like that since our volume caching solution is pretty bad anyways
Is there a way to make replicas scale based on traffic though?
there isnt
Is there repicas support in the api?
yes you can change the amount of replicas a given service uses with the api, but I would not recommend it since adding or removing a replica causes a rebuild of the service
rebuilding means the service will be redeployed, witch means potential dropped connections during redeployment
though I am curious what's stopping you from just setting a conservative value for the replicas and calling it a day?
The amount of replicas I need is pretty volatile and I use a external api that ratelimits based on ips. So if I get a bunch of traffic all at once I need multiple IPs to make requests to prevent being ratelimited.
using replicas for that would not be the best way to overcome those limitations, as there a good chance the replicas are deployed to the same host as the original service
maybe look into caching the response from the external api?