You are here

Web Site Optimization: FrontEnd and BackEnd

MySQL Performance Blog - Thu, 26/06/2008 - 7:04pm

I spent Monday and Tuesday this week on Velocity Conference It was
quite interesting event worth attending and it was very good to see
the problems in this are going beyond Apache, PHP, Memcache and MySQL.

A lot of talks on this conference was focusing on what is called
“FrontEnd”. The meaning of Frontend is not the frontend web server
commonly used in many architectures but rather optimization on the
client side - how to make a browser to do less requests, make them
parallel, fetch less data and execute client side code faster.

Steve Souders mentioned in his talk for Alexa 10 web sites he examined
typically 80-90% of page response time comes from other things than
fetching HTML of the main page - fetching CSS, JavaScript, Images
which makes it number one thing to focus your optimization on.

I do not fully agree for number of reasons.

First - a lot of people focus on Backend optimization first, have
monitoring and graphing setup based on the main HTML page response
this means quite frequently we speak about sites which have relatively
well optimized backends but have not spent time on the frontend
optimization. In this case not a big surprise there are more low
hanging fruits on frontend part. We often deal with people with
less than optimized backends with some pages (search,reports etc)
taking minutes to load which makes these few seconds you can shave off
by client side optimization secondary.

Second - The stakes for backend optimization are higher. If you do not
optimize your web site on Frontend you will have worse user experience
- users may not engage so actively, leave your site faster or not
convert. This is very important. However if you do not optimize
backend enough to handle your load your web site can simply get
overloaded and die. Remember all these “slashdotted” or
“techcrunched” sites which went down because their back end just was
not ready.

Third - Even if your backend is reasonably fast say you can have under
100ms response time on main HTML page there are still reasons to optimize
it, especially for large scale systems. If you can come up with idea
to provide same response time just with lower hardware requirements
you can save on hardware, power and operations which are considerable
costs for large projects.

I would say instead the same rule as back end optimization applies
here - if you spend 90% time running PHP code and only 10% fetching
data from MySQL database it does not make sense to focus on MySQL
optimization. If 90% is spent on other tasks than fetching your HTML
page all together you surely should focus on it. But get real numbers
for your application before you decide.

Having said that I will now go and read Steve’s book which he kindly
signed for me to get up to speed with front end optimization.

Entry posted by peter | 3 comments

Add to: delicious | digg | reddit | netscape | Google Bookmarks