Sunday, July 7, 2013

Performance issues? Remain calm and analyse.

Web companies are all about growth.
But also about speed.
It's all about getting your great idea out there, as fast as you can, which means scale and performance issues could be left 'for later' (Which is mostly a good idea at the beginning stage, when resources are sparse, and time is an issue).
Once your service scales from 100 users to 10000, you will encounter performance issues. If you have an app, response times would slow to a halt. A site, data loads slow.
In 2013 Google IO UI sessions, it was mentioned that app users tend to close their app when waiting for more than 10 seconds. While that might sound harsh, imagine tapping, waiting 10 seconds, then tapping again, waiting again - I would uninstall such an app, or never visit such a website (Unless they have something I really, really need, in that case I'll look for a competing product before uninstalling)

Clear your head. Analyse the situation.
So, what do you do?
First, don't pannick. Performance issues happen to everyone. (Kidding)
But be focused, because time is of the essence here.

An 'automatic' go to solution is upgrading your hardware - I wouldn't go there unless I was really desperate - This is hardly ever a scalable solution.

First thing you would want to do is analysis.
The base for all solutions shouldn't be by intuition alone - This could lead you to waste time on ideas that may or may not bring the solution, and waste valuable time.

- Analyse each step by time, dump it to a log file. Find the 10 most time consuming tasks, and select the easiest ones to take care of.
- Analyse DB calls - See which ones are being performed to most, or which ones take a lot of time.
- Analyse insertion rates - Maybe a queuing mechanism could solve some bottlenecks.

- Always use a perl script to 'clean' logs, do count operations on logs, and a spreadsheet to calculate and sort stuff - These are the best ways to get insights.
- Call a friend. Four eyes are always better than two.
- Call an expert. It's cheaper to pay someone for two expensive days of work and get your issues solved than lose a week of momentum.

And a final note - Don't try to rewrite your server in two days of 'no sleep'... ;)

Good luck.


No comments:

Post a Comment