A batch server is constantly swapping and the job is 10× slower. What do you do?
IntermediateScenarioMigrations, performance and fleet operations
Answer
Situation read → The working set doesn't fit in RAM.
What I'd do →
- Confirm:
vmstat 1(si/sohigh),sar -B(major faults),smem -s swaporgrep VmSwap /proc/*/status. - Short term: reduce concurrency or memory settings (JVM
-Xmx, worker count). - Lower
vm.swappiness(e.g. 10) if cache is pushing app pages out. - Long term: add RAM / bigger instance, or fix the job to stream data instead of loading it all.
Why → Swapping replaces nanosecond memory access with millisecond disk access.
Interview tip → Say you'd use cgroups (MemoryHigh) to isolate the batch job from other services.
More on Migrations, performance and fleet operations
You must migrate 2 TB of application data from an old server to a new one with less than 5 minutes of downtime. How?IntermediateThe new server has different UIDs for the same users than the old one. What breaks during migration and how do you handle it?IntermediateA server is "slow" according to users. What is your first 60 seconds of investigation?BeginnerYour team must capacity-plan for a server whose disk grows 4% per week. How do you predict when it fills?IntermediateYou need to replace a physical server with a VM without changing its IP or hostname. Plan the cutover.IntermediateMemory usage on a server shows 95% used but the app is fine. A manager is worried. How do you explain and verify?Beginner