How to Install Tideways: A Complete Guide

What is Tideways?

Tideways is a tool that helps you keep an eye on how well your PHP application is running. It provides insights into what's happening behind the scenes, helping you spot and fix performance problems.

Key Features

  1. Tideways tracks how long your code takes to run and how much memory it uses.

  2. You can see which parts of your code are slow and need improvement.

  3. It monitors errors and issues in your application.

  4. It helps developers understand how their applications perform in real-world scenarios and enables them to make informed decisions about optimization efforts.

  5. The goal of Tideway profiling is to identify bottlenecks, inefficiencies, and areas for optimization within an application. This information is crucial for developers looking to improve the performance and efficiency of their software.

Create a Free Trial Account in Tideways

  1. Visit the Tideways website and create a free trial account.

  2. After successfully creating the account, navigate to the Tideways dashboard.

  3. In the dashboard, find and select the option to create a new project.

  4. An API key will be generated. Ensure you note down this API key, as it will be needed for subsequent steps.

Install Tideways

Step 1: Add Tideways Repository

echo 'deb [signed-by=/usr/share/keyrings/tideways.gpg] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list
wget -qO - 'https://packages.tideways.com/key.gpg' | gpg --dearmor | tee /usr/share/keyrings/tideways.gpg > /dev/null

Step 2: Update the server and install Tideways package

apt update  
apt install tideways-daemon tideways-php

Step 3: Configure PHP with Tideways API-Key

nano /etc/php/8.x/cli/php.ini
nano /etc/php/8.x/fpm/php.ini

Add the following lines to the php.ini file:

[tideways]
tideways.api_key= YOUR_API_KEY
tideways.sample_rate=25

Replace YOUR_API_KEY with your actual Tideways API key.

Step 4: Start Tideways Daemon

systemctl start tideways-daemon
systemctl enable tideways-daemon

Step 5: Restart PHP-FPM

systemctl restart php8.x-fpm
systemctl status php8.x-fpm

Step 6: Verify Installation

php8.x -m | grep tideways

You should see tideways in the list of installed PHP modules.

From Web Browser:

Create t.php file under your website root directory.

nano t.php

Add below lines to the file and save it.

<?php
phpinfo();
?>

You should see the tideways information on the page: https://wwww.domain.com/t.php

Tideways Profiling

  1. Download and enable Tideways Chrome Extension.

  2. Select the Tideways Profiler chrome extension and select profile for 60 seconds.

  3. Refresh the page you want to profile.

  4. Check the slow traces from Tideways dashboard.

Note:

The profiler should only be enabled temporarily as it affects the performance of the site. Once the profiling process is complete and the bottlenecks have been identified, it is recommended to uninstall Tideways.

Uninstall Tideways

Step 1: Remove Tideways API-Key from PHP

nano /etc/php/8.x/cli/php.ini
nano /etc/php/8.x/fpm/php.ini

Remove the following lines from the php.ini file:

[tideways]
tideways.api_key= YOUR_API_KEY
tideways.sample_rate=25

Step 2: Remove Tideways package from server

apt purge tideways-daemon tideways-php

Step 3: Restart PHP-FPM

systemctl restart php8.x-fpm

Step 4: Verify if Tideways is Uninstalled

php8.x -m | grep tideways

From Web Browser:

https://wwww.domain.com/t.php

You should not see tideways information on the page.

Step 5: Delete t.php file from server

Go to your website root directory and remove the created "t.php" file.

rm t.php

Conclusion

Tideways is a cool tool that helps keep your PHP app running smoothly. With its profiling, error tracking, and tracing features, you can easily find and fix performance issues. Try Tideways to make your PHP apps faster and more reliable.

0
Subscribe to my newsletter

Read articles from Sachin Yalagudkar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sachin Yalagudkar
Sachin Yalagudkar