Self-hosted Tools

InitTop – Real-time MySQL/MariaDB Profiler in Your Terminal

InitTop is a real-time database monitoring tool that runs directly in your terminal, showing you exactly which SQL query is choking your system — something htop only tells you CPU is at 100% but never reveals the actual culprit.

InitTop – Real-time MySQL/MariaDB Profiler in Your Terminal

Built with pure Python using the standard curses library. No complex dependencies to install. One command and you get a live-updating TUI with full processlist, buffer pool metrics, QPS tracking, and slow-query alerts — even on the smallest VPS.

Note: InitTop is optimized for InitOps-deployed environments — auto-detects the Unix socket, zero manual configuration. Runs on any terminal with basic 8-color support, from PuTTY to Bitvise.

Install InitTop

Log in to your Ubuntu VPS as root:

ssh root@your-server-ip

Then run the one-line installer:

curl -sSL https://inithtml.com/inittop/install.sh | bash

The script automatically installs python3-mysql.connector, downloads the engine, and auto-launches immediately if an InitOps environment is detected.

Version Info

  • Version: 1.0.0
  • Updated: 2026-06-18

Usage Flow

  1. Run the install command: The script auto-detects MariaDB via Unix socket or falls back to TCP.
  2. Enter password: If MYSQL_PWD env var is not set, the tool prompts for hidden input (no history leak).
  3. Monitor in real-time: Processlist refreshes every 2 seconds, sorted by execution time.

What InitTop Shows

InitTop – Real-time MySQL/MariaDB Profiler in Your Terminal

  • Real-time Processlist — Running queries sorted by TIME descending. PID, USER, DB, COMMAND, TIME, STATE, and full SQL displayed.
  • Buffer Pool Metrics — Hit rate and used percentage shown as visual progress bars.
  • Connections Overview — Connected, Running, Slow queries, and Locked processes at a glance.
  • QPS (Queries Per Second) — Calculated in real-time from SHOW GLOBAL STATUS delta.
  • Index Hint Banner — Auto-detects large tables (>500 rows) without indexes and suggests ALTER TABLE ... ADD INDEX.

Color-Coded Visual Hierarchy

InitTop uses an 8-color safe palette that renders clearly on any terminal:

  • RED bold — Slow query (≥ --slow-threshold) or table/row lock in progress.
  • YELLOW bold — Moderate query (≥ 1 second).
  • GREEN bold — Fast, actively running query.
  • DIM white — Sleeping connection (not consuming resources).
  • White on blue — Header bar and status bar, classic htop style.
  • White on black — Currently selected row.

Keyboard Controls

  • ↑ / ↓ — Navigate the process list.
  • K (capital) — Kill the selected query (KILL QUERY <pid>).
  • e — EXPLAIN the selected query (SELECT only).
  • / — Filter processlist by user, database, or query text.
  • ESC — Clear filter or close overlay.
  • s — Cycle sort column: TIME → USER → DB → CMD.
  • p — Pause / resume auto-refresh.
  • r — Force immediate refresh.
  • ? — Toggle help screen.
  • q — Quit InitTop.

Flexible Connection Modes

InitTop supports both connection methods, auto-preferring Unix socket when detected:

# Unix socket — recommended for InitOps (faster, more secure)
inittop -u root -S /run/mysqld/mysqld.sock

# TCP fallback — for remote or custom setups
inittop -u root -H 127.0.0.1 -P 3306

# Automation/scripting — use env var, no prompt
MYSQL_PWD=secret inittop -u root -S /run/mysqld/mysqld.sock

Why Not mytop or innotop?

  • mytop — Written in Perl from the early 2000s, outdated UI, difficult to install on modern OS.
  • innotop — Also Perl-based, heavy CPAN module dependencies, complex configuration.
  • Percona Toolkit — Overkill for daily monitoring, requires deep DBA expertise.
  • InitTop — Pure Python 3, only requires mysql-connector-python, single-file executable, runs immediately after curl | bash.

System Compatibility

  • Ubuntu Server 20.04+ / 22.04+ / 24.04 LTS.
  • MySQL 5.7+ / 8.0+ or MariaDB 10.3+ / 10.6+ / 10.11+.
  • Terminal with basic 8-color ANSI support (PuTTY, Bitvise, iTerm, GNOME Terminal, etc.).
  • Requires read access to information_schema.PROCESSLIST and SHOW GLOBAL STATUS.

Conclusion

InitTop v1.0.0 simplifies database monitoring — from guessing “why is CPU at 100%” to seeing exactly which query is running slow, needs killing, or needs an index. A production-ready tool that doesn’t require deep DBA knowledge, and especially optimized for environments deployed with InitOps.

Quick Install Command

curl -sSL https://inithtml.com/inittop/install.sh | bash
5.0/5 (1)

Comments


  • No comments yet.

Web-Based Tools

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login