I’m running regression calculations in a CF worker and I’m seeing weird CPU spikes which eventually cause some request to fail. I have done some profiling on my code; using more features etc is not the reasons for these spikes since accessing the weights object is O(1). I might be completely wrong here, but I suspect that this is somehow related to memory allocation/deallocation.
This setup would be perfect unless P99.9 wouldn’t spike 4-6x higher (200-400ms) than p99.
What might be an explanation for the CPU spikes? Are there any actions I could take to prevent this weird behaviour? Can I profiler the worker in any way?