I’m experiencing inconsistent performance with my fly.io deployed application. The app handles high-volume batch processing jobs efficiently, demonstrating good concurrency. However, when sending individual API requests via Postman concurrently with these batch jobs, I’m seeing extremely slow response times (30-60 seconds) or timeouts.
Key points:
-
App performs well under high load from batch processing jobs
-
Individual API requests are fast when batch jobs are not running
-
During batch processing, API requests from different IPs experience severe delays
-
This suggests a potential issue with how the load balancer or resource allocation handles mixed traffic types
My goal is to maintain responsiveness for individual API requests while batch jobs are running in the background. Could fly.io investigate if there’s an issue with how concurrent connections from different sources are being managed, particularly in relation to the load balancer or resource allocation?
I appreciate there are architectural solutions like splitting resources so batch processing is on separate worker etc. Perhaps naively, I still expect the service to handle or two extra requests ad hoc whilst batch processing jobs are running.
Any ideas / possible reasons why this might be occurring
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
processes = ["app"]
[http_service.concurrency]
type = "connections"
hard_limit = 500
soft_limit = 100
[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 2048
[autoscaling]
min_machines = 0 # Allow scaling down to 0 machines
max_machines = 4