Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimization tips and tricks [closed]

I need to optimize our web service, but don't know where to begin. We're running GWT, PHP and PostgreSQL. Without even having peaked at any performance data, I'm guessing that the major optimizations are going to happen in the database.

I don't know anything about restructuring the DB, nor indexing. (Don't know anything 'bout DBs really.) All pointers greatly appreciated in any of the three areas!

like image 425
Jonas Byström Avatar asked Feb 23 '10 14:02

Jonas Byström


2 Answers

Always start with measurement. Until you know where any bottlenecks are, you don't know what to improve. "Without even having peeked at any performance data" you're unlikely to make the right call - or at least, I frequently find that I make incorrect guesses about where performance is hurting. Maybe you're better at guessing than me :) (Of course, it may well be in the database in your code...)

Measuring tools can be as simple as log statements to see how long different types of requests take, to full profilers, query analyzers etc. On the database side, you'll almost certainly want to use EXPLAIN to look at the query execution plans... but before that you'll want to know which queries are hurting you in the first place, and more than that, which requests to the web service itself are costly.

like image 110
Jon Skeet Avatar answered Oct 11 '22 00:10

Jon Skeet


Look at the best practices from yahoo before touching the db (and before that identify your bottleneck). You don't want to spend lot of time for a small speed improvement, usually big speed ups could be achieved using the tips in the link.

To profile your frontend you could use page speed.

like image 35
Alberto Zaccagni Avatar answered Oct 10 '22 22:10

Alberto Zaccagni