I can’t blindly tell you why your software is slow and won’t scale. Everyone’s software and situation are different. If you’re stuck with no idea where to begin, these are my top 5 tactics for getting started when you don’t know what to do.
These tactics will improve the performance and stability of your system. They will help you understand the system’s constraints and bottlenecks. They probably won’t be the optimal solution to your problem, but they are a great place to start
- Fix the errors in the logs and stop logging things that don’t matter. Not all errors are bugs, and not all bugs produce errors. Noisy logs that are full of meaningless errors make it hard to see “real” problems. Fixing or suppressing the noise will help you, learn the code, and fix a bunch of small problems. Exceptions are also slow, so this will make the system faster and more stable
- Reduce the amount of db usage. Add caching for data that gets requested and doesn’t change. At scale even trivial queries add up. Ex: loading countries or states from a db.
- Make work async – move it to queues. This allows you to keep api/ui moving and sets you up for eventual parallelism.
- Make work restartable/idempotent/recoverable. Things break, make it easy to just try again
- Shadow users. Learn what they think is important and broken. It probably isn’t what you thought.