May 22, 2023

What is TTLB or Time To Last Byte?

Introduction to TTFB and the importance of server response times.

In the world of web hosting, we often talk about TTFB, an acronym for Time To First Byte. It is a fundamental parameter to measure the speed with which a web server responds to a request. TTFB is the time between a client sending an HTTP request and the server receiving the first byte of data.

However, another parameter deserves our attention, even if it is often overlooked: the TTLB, or Time To Last Byte. This metric, while lesser known, plays an equally critical role in determining a website's overall performance. Although it is not talked about much, its importance is undeniable.

What is TTLB (Time To Last Byte)?

The TTLB, as the name suggests, represents the time it takes for a server to send the last response byte to a client request. In other words, it is the total time that a client must wait to receive the entire response from the server. This metric is especially useful for measuring how fast data is downloaded from the server.

The TTLB includes the content transmission time, i.e. the time required to transfer all data from the source to the recipient, as well as the time taken by the server to process the request. This parameter is important for understanding how quickly a user can view the entire web page or download a file from the server.

The relationship between TTFB and TTLB

While the TTFB indicates how quickly a server can start responding to a request, the TTLB indicates how long it takes to complete the response. A lower TTFB indicates that the server is able to start responding quickly, which is critical to user experience, especially for dynamic web pages.

However, a low TTFB does not necessarily guarantee a low TTLB. If the server takes a long time to send the entire response, the user may have to wait a significant amount of time to view the entire page or to download a file, even if the response started quickly. This underscores the importance of monitoring both TTFB and TTLB.

How to optimize the TTLB.

Slow server response can seriously affect performance. If the browser waits more than 600ms for a response, that's an indication that something isn't working as it should. Excessive delay in server response can cause long page load times, a problem that web users do not tolerate.

When users visit a URL through their browser, it sends a network request to get the desired content. The server receives this request and delivers the page content. It can take considerable server effort to generate a page with all the dynamic content that users want to see. For example, if a user is checking his order history, the server must collect this information from the database and then integrate it into the page.

Improving server performance to reduce the waiting time while loading pages is a crucial step. The first step in optimizing server response time is to identify the main operations that the server must perform to generate the page content and then measure how long it takes for each of them. Once the most time-consuming activities have been identified, solutions can be sought to speed them up.

There are numerous reasons that can cause a slow server to respond, and consequently there are multiple ways to make improvements:

  1. Enable GZIP compression for connections.
  2. Improve server application logic to generate pages faster. Each technology stack and web server has its own specific recommendations for optimizing performance; for PHP, for example, OPCACHE is available.
  3. Review and optimize how your server interacts with databases, or consider upgrading to higher-performance database systems.
  4. Upgrade your server hardware by increasing memory or CPU.

More briefly, our Hosting solutions are already optimized to solve all TTFB and TTLB problems.

How to measure TTLB using Linux commands

There are several ways to measure TTLB, and one of the most common methods makes use of the command curl on a Linux system. Here is an example of how this can be done:

time curl -so /dev/null http://example.com

In this command, time is a Linux command that measures the execution time of another command. curl is a command used to download or send data through various network protocols. The option -s causes that curl works silently, without showing the progress bar, while the option -o redirect the output to a file, or in this case, a /dev/null, so that you don't see the downloaded data in the terminal.

The command will return something like:

real 0m0.412s user 0m0.006s sys 0m0.005s

The 'real' time is the TTLB we are looking for. Indicates the total time elapsed from the moment the command was sent until the moment the last byte was received.

Conclusion

In conclusion, TTLB is an extremely useful metric for measuring server performance. While not discussed as much as TTFB, it is critical to understanding how long a user will have to wait to receive the entire response from the server. Monitoring TTLB in conjunction with TTFB can provide a more complete picture of your server's performance and allow you to make targeted optimizations to improve the end user experience.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

DISCLAIMER, Legal Notes and Copyright. RedHat, Inc. holds the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of the AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. holds the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt; Oracle Corporation holds the rights to Oracle®, MySQL®, MyRocks®, VirtualBox®, and ZFS®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; PostgreSQL® is a registered trademark of PostgreSQL Global Development Group; SQLite® is a registered trademark of Hipp, Wyrick & Company, Inc.; KeyDB® is a registered trademark of EQ Alpha Technology Ltd.; Typesense® is a registered trademark of Typesense Inc.; REDIS® is a registered trademark of Redis Labs Ltd; F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB; HAProxy® is a registered trademark of HAProxy Technologies LLC; Traefik® is a registered trademark of Traefik Labs; Envoy® is a registered trademark of CNCF; Adobe Inc. owns the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited; Automattic Inc. holds the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert owns the rights to Drupal®; Shopify® is a registered trademark of Shopify Inc.; BigCommerce® is a registered trademark of BigCommerce Pty. Ltd.; TYPO3® is a registered trademark of the TYPO3 Association; Ghost® is a registered trademark of the Ghost Foundation; Amazon Web Services, Inc. owns the rights to AWS® and Amazon SES®; Google LLC owns the rights to Google Cloud™, Chrome™, and Google Kubernetes Engine™; Alibaba Cloud® is a registered trademark of Alibaba Group Holding Limited; DigitalOcean® is a registered trademark of DigitalOcean, LLC; Linode® is a registered trademark of Linode, LLC; Vultr® is a registered trademark of The Constant Company, LLC; Akamai® is a registered trademark of Akamai Technologies, Inc.; Fastly® is a registered trademark of Fastly, Inc.; Let's Encrypt® is a registered trademark of the Internet Security Research Group; Microsoft Corporation owns the rights to Microsoft®, Azure®, Windows®, Office®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®; Apache® is a registered trademark of The Apache Software Foundation; Apache Tomcat® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group; Docker® is a registered trademark of Docker, Inc.; Kubernetes® is a registered trademark of The Linux Foundation; OpenShift® is a registered trademark of Red Hat, Inc.; Podman® is a registered trademark of Red Hat, Inc.; Proxmox® is a registered trademark of Proxmox Server Solutions GmbH; VMware® is a registered trademark of Broadcom Inc.; CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV; Grafana® is a registered trademark of Grafana Labs; Prometheus® is a registered trademark of The Linux Foundation; Zabbix® is a registered trademark of Zabbix LLC; Datadog® is a registered trademark of Datadog, Inc.; Ceph® is a registered trademark of Red Hat, Inc.; MinIO® is a registered trademark of MinIO, Inc.; Mailgun® is a registered trademark of Mailgun Technologies, Inc.; SendGrid® is a registered trademark of Twilio Inc.; Postmark® is a registered trademark of ActiveCampaign, LLC; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Hetzner® is a registered trademark of Hetzner Online GmbH; OVHcloud® is a registered trademark of OVH Groupe SAS; Terraform® is a registered trademark of HashiCorp, Inc.; Ansible® is a registered trademark of Red Hat, Inc.; cURL® is a registered trademark of Daniel Stenberg; Facebook®, Inc. owns the rights to Facebook®, Messenger® and Instagram®. This site is not affiliated with, sponsored by, or otherwise associated with any of the above-mentioned entities and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. All other trademarks mentioned are the property of their respective registrants.

JUST A MOMENT !

Have you ever wondered if your hosting sucks?

Find out now if your hosting provider is hurting you with a slow website worthy of 1990! Instant results.

Close the CTA
Back to top