Self-checkout terminals that stall on Saturday mornings
A supermarket chain in Malta runs 24 self-checkout terminals, each with 4 GB RAM, a dual-core 2.4 GHz CPU and a 500 GB 5400 rpm hard disk. Each terminal runs a Java-based till application plus a local SQLite journal that queues transactions for the central server. On Saturday mornings (09:00–12:00) operators report 6–10 second freezes when scanning. Monitoring during a freeze shows CPU utilisation at 12–18%, a disk queue length of 14, and 900–1400 hard page faults per second; committed memory is 9.8 GB against 4 GB of RAM, with 6.2 GB of swap in use. The vendor quotes €180 per terminal to replace the CPU with a quad-core model. The store manager has €2,500 and wants the cheapest change that removes the freezes; software changes are frozen until next year.
1. Identify the bottleneck and explain, using the figures given, why the CPU upgrade is unlikely to remove the freezes.
Read the worked answer
Bottleneck: physical memory, not processing power.
- Committed memory is 9.8 GB but only 4 GB of RAM exists, so roughly 5.8 GB of the working set must live in swap. The 900–1400 hard page faults per second mean the CPU is repeatedly stopping to fetch pages from a 5400 rpm disk.
- Disk queue length 14 with a single mechanical disk signals saturation: at roughly 80–100 random IOPS, a queue that long implies waits of well over 100 ms per request, which matches the 6–10 s freezes once fault storms build up.
- CPU utilisation of 12–18% is the decisive clue. The processor is idle most of the time waiting on I/O; adding cores gives more execution units to a resource that is not the constraint, and may even worsen contention on the disk and memory bus.
- The cost also fails the budget test: 24 × €180 = €4,320, above the €2,500 available.
A correct judgement therefore rejects the vendor's CPU proposal on both technical and financial grounds, and targets the paging path instead.
2. Recommend an upgrade plan within €2,500 and state the residual risks it leaves.
Read the worked answer
Plan (illustrative prices):
- Add an 8 GB module to each terminal, taking RAM to 12 GB: 24 × €48 = €1,152. This exceeds the 9.8 GB committed figure with headroom, so hard page faults should fall sharply.
- Replace each 5400 rpm disk with a 240 GB SATA SSD: 24 × €42 = €1,008. Total €2,160, inside the €2,500 budget.
Reasoning: RAM removes the cause of paging; the SSD reduces the cost of any paging that remains and speeds the SQLite journal writes. Do the RAM first: an SSD alone only makes a bad situation faster, while RAM alone would leave occasional fault latency on a slow disk. Confirm each terminal has a free memory slot before ordering.
Residual risks: the application may still leak memory over a long shift, so 12 GB is headroom, not a cure; monitor commit charge after the change. SSD write endurance matters with a journaling database, so enable TRIM and check SMART data. Re-test at Saturday peak, not on a quiet day, and keep the old disks for warranty returns.