After testing on my instance, I saw occasional 1–3 second Lock_time on simple single-row queries against TOPIC_VIEWS (e.g., SELECT … WHERE p.POST_ID = ? AND p.TOPIC_ID = t.TOPIC_ID), even though Rows_examined is always 1.
The cause is concurrent INSERTs into {table_prefix}TOPIC_VIEWS (in showflat.inc.php) when multiple users view the same thread simultaneously—each insert queues row-level locks.
A low-contention fix is to keep using the existing {table_prefix}TOPIC_VIEWS table but convert it to InnoDB and switch to INSERT … ON DUPLICATE KEY UPDATE.

Steps:

Convert engine (run once)
Code
ALTER TABLE {table_prefix}TOPIC_VIEWS ENGINE=InnoDB;
Ensure TOPIC_ID is PRIMARY KEY
Code
ALTER TABLE {table_prefix}TOPIC_VIEWS ADD PRIMARY KEY (TOPIC_ID);
Replace the INSERT block in showflat.inc.php with:
Code
if ($_SESSION['current_topic'] != $topic_info['TOPIC_ID']) {
    $query = "
        INSERT INTO {$config['TABLE_PREFIX']}TOPIC_VIEWS (TOPIC_ID)
        VALUES (?)
        ON DUPLICATE KEY UPDATE TOPIC_VIEWS = TOPIC_VIEWS + 1
    ";
    $dbh->do_placeholder_query($query, array($topic_info['TOPIC_ID']), __LINE__, __FILE__);
    $_SESSION['current_topic'] = $topic_info['TOPIC_ID'];
}
This uses InnoDB row-level locking + upsert to eliminate queueing while keeping view counts accurate. I tested a variant and Lock_time dropped to zero.
Happy to provide more detail or diffs if useful—just a performance tweak suggestion.
Thanks!


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 8.0.0
Release 20240826
Server OS Linux
Server Load 0.11
Web Server Apache/2.4.37
PHP Version 8.3.11
MYSQL Version 8.0.39
Database Size 1.82 GB