Understanding how to improve Time to First Byte (TTFB) elgg1.8

Increasing Speed, Reducing Time to First Byte is one of reason to take care for elgg and It is a motive because elgg goes slow. Basically the advice is moving to a better/faster server that because time to first byte is the time it takes the server to start sending the data.

 So we can think to reduce TTFB following these advices:

 

  1. Move your website to a faster/better server
  2. Use a CDN or something similar to reduce the load on the server (repeated requests to a server will increase the TTFB)
  3. Reduce the time the server spends processing the request for information.

 

But a lot of us are not really prepared to move servers, and change the way our server worked and in any case a lot of us use a hosted server so no control on them.

So what can we do? 

  • Reduce System_Log: Find if your system_log table is too big and reducing it can be an advice. TTFB depends on how many big is our database so plugins like logrotate and garbagecollector can be very useful but they need a little more support to install and configure it. I saw the time to first byte on the first call on a simple index has gone from 1,2s or more to 600/800ms. It is still a lot time. A good site must have a TTFB around 250ms.
So I want to invite all you to do a test and report your data here like below using  http://www.webpagetest.org :
Load TimeFirst ByteStart RenderDOM ElementsTimeRequestsBytes InTimeRequestsBytes In
Mysite - on server host - 

index 2.851s 0.717s 2.458s 176 2.851s 13 175 KB 3.826s 13 175 KB
blog/all 3.512s 1.180s 2.931s 628 3.512s 16 180 KB 4.436s 16 180 KB
bookmark/all 3.918s 1.348s 3.103s 724 3.918s 14 178 KB 4.718s 14 178 KB
groups/all 4.448s 1.119s 2.808s 389 4.448s 24 189 KB 4.448s 24 189 KB
members/all 3.191s 0.995s 2.695s 340 3.191s 13 173 KB 3.974s 13 173 KB
as you can see my TTFB has always an F score, this is very very bad and the server host is a medium quality like dreamhost.