Performance · ML Infrastructure
GTS Lab Platform
A performance and ML overhaul of a production lab-analytics platform — 10x faster admin pages, sub-second reporting, and an automated retraining pipeline for the ferrography classifier.
Organisation
Global Technical Services
Role
Software Development Consultant (Contract)
Timeline
Jan 2026 — Aug 2026
Stack
Overview
Global Technical Services runs an oil-condition-monitoring lab whose platform had grown faster than its data layer could handle. Brought in on contract, I took the existing Laravel application and rebuilt the parts that were failing under production load: the query layer, the reporting endpoints, the ML report pipeline and the deployment story.
Key Features
- Database layer optimisation — three migrations indexing five hot tables, eliminating full scans of 470K-row and 137K-row tables and cutting page loads from 860ms to under 100ms, a 10x speedup across every admin page.
- N+1 elimination in reporting — dashboard and reporting endpoints shared the same per-equipment query loop; folding hundreds of round trips per request into a single index-backed windowed SQL query took median response times from 78s to below 1s.
- Queue-backed ML reporting — synchronous Python report generation (ferrography classification and predictive wear modelling) moved off the request cycle onto two dedicated database-backed queue workers, taking report pages from 47–120s to near-instant.
- Containerised production stack — Docker Compose across four services (Laravel 9/PHP-FPM, Caddy with automatic HTTPS, a Flask ML inference API, and queue workers), standardising deployment and isolating ML queries from public traffic.
- Automated ML retraining pipeline for the ferrography classifier, versioning training datasets on Cloudflare R2 so the model keeps improving as new labelled lab samples accumulate in production.
Impact
Every slow surface in the product got fast: admin pages by 10x, reporting endpoints from 78 seconds to under one, and ML reports from a two-minute wait to immediate. The containerised stack replaced hand-rolled deploys, and the retraining pipeline turned the classifier from a fixed artifact into a model that improves with the lab’s own data.