Why Hesk Feels Slow and Where the Time Actually Goes

Hesk is a lightweight PHP help desk that stores everything in MySQL/MariaDB and renders pages dynamically on every request. There is no built-in template cache, no object cache layer, and no static page generation. Each time a staff member opens the ticket list or a customer submits a request, Hesk recompiles PHP, opens a database connection, runs several queries against the hesk_tickets and hesk_attachments tables, and assembles the HTML on the fly. On shared hosting this means perceived speed is dominated by three things: how fast PHP itself compiles and executes, how efficiently the database answers queries, and whether the web server is forced to re-process unchanged assets on every hit.

Before changing anything, measure. In DirectAdmin open File Manager and look at your domain's public_html (or the subfolder where Hesk lives, often /public_html/support/). Hesk writes runtime problems to the PHP error_log in the script directory, and your account's Errors view in DirectAdmin exposes the domain error log. Slow pages frequently correlate with repeated warnings there — missing OPcache, deprecated function notices under a mismatched PHP version, or timeouts while writing large attachments. Use your browser's developer tools (Network tab) to separate the two symptoms that get confused constantly: a high Time To First Byte points at PHP or the database, while slow total load with fast TTFB points at uncached CSS, JS, and images. Treat those as different problems, because the fixes live in different tools.

A practical baseline: open the admin ticket list, note the TTFB, then open a single ticket with several attachments. If the single-ticket view is dramatically slower, the bottleneck is attachment handling and table bloat, not raw CPU. Record a few numbers now so every later change can be judged against real data rather than impression.

Selecting the Right PHP Version and Enabling OPcache

The single largest free win for Hesk on CloudLinux is making sure PHP compiled bytecode is cached in memory instead of being rebuilt on every request. Hesk runs cleanly on PHP 8.1 and 8.2; running it on an older 7.x branch leaves you without current OPcache improvements and exposes you to deprecation noise. In DirectAdmin open Select PHP Version (the CloudLinux PHP Selector) and set the version for your domain to 8.1 or 8.2. On the same screen switch to the Extensions tab and confirm opcache is ticked, along with mysqli and mbstring, which Hesk needs for correct operation.

Next open the Options tab in PHP Selector to raise the per-account OPcache allocation and execution limits. Sensible values for a help desk workload are a memory consumption around 128, interned strings buffer of 16, and max accelerated files of 10000, which comfortably covers Hesk's file count with headroom. If your plan's PHP Selector does not expose every directive, you can set them per-directory with a .user.ini file placed in the Hesk root. Create or edit /public_html/support/.user.ini through File Manager:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.validate_timestamps=1
opcache.revalidate_freq=60
memory_limit=256M
max_execution_time=120
upload_max_filesize=32M
post_max_size=36M

Keep validate_timestamps=1 with a 60 second revalidation window so that when you apply a Hesk update the new code is picked up automatically within a minute rather than requiring a cache flush you cannot trigger as an unprivileged user. The upload_max_filesize and post_max_size values matter directly for Hesk because attachment uploads that exceed PHP limits fail slowly and generate retries that feel like a performance fault. Changes in .user.ini are read by PHP-FPM after the FPM pool refresh interval, usually a couple of minutes; reload a Hesk page twice, then confirm the active values by viewing phpinfo if your panel offers it, or by checking that previously failing uploads now succeed.

Using LiteSpeed to Cache Static Assets and Compress Output

Hostiso runs LiteSpeed Web Server, so Hesk benefits from two features you control entirely from .htaccess in the Hesk directory: browser caching of static files and Brotli/gzip compression. Hesk's dynamic ticket pages should not be full-page cached, because they contain per-user session content and would leak one agent's view to another. Instead, target the unchanging assets — the CSS, JavaScript, fonts, and theme images that currently reload on every navigation and inflate total page time even when TTFB is healthy.

Edit /public_html/support/.htaccess and add rules that set long cache lifetimes on static assets while leaving PHP responses untouched:

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 14 days"
  ExpiresByType application/javascript "access plus 14 days"
  ExpiresByType image/png "access plus 30 days"
  ExpiresByType image/jpeg "access plus 30 days"
  ExpiresByType image/gif "access plus 30 days"
  ExpiresByType image/svg+xml "access plus 30 days"
  ExpiresByType font/woff2 "access plus 30 days"
</IfModule>

<IfModule LiteSpeed>
  SetOutputFilter DEFLATE
</IfModule>

<filesMatch "\.(css|js|png|jpg|jpeg|gif|svg|woff2)$">
  Header set Cache-Control "public, max-age=1209600"
</filesMatch>

LiteSpeed honours mod_expires and mod_deflate syntax natively, so these directives compress HTML, CSS, and JS on delivery and instruct browsers to stop re-requesting theme files. After saving, reload the Hesk admin interface with developer tools open and confirm the asset responses now return 200 (from cache) on the second load and carry a content-encoding header. You should not attempt to install the LiteSpeed Cache plugin or Redis object cache for Hesk — there is no official Hesk integration for either, and bolting on an untested object cache risks serving stale session data. Where a plan offers Redis, it is meaningful for applications that ship a cache driver; Hesk does not, so the honest performance path here is OPcache plus static caching plus a lean database.

Trimming the Database and Attachment Load

Over months of use the slowest part of a mature Hesk install is almost always the database, because closed tickets, their replies, and especially attachment metadata accumulate without bound. Open phpMyAdmin from DirectAdmin, select the Hesk database, and sort the table list by size. The usual offenders are hesk_tickets, hesk_attachments, and the mail/log tables. Run a read-only check first to understand the scale: SELECT status, COUNT(*) FROM hesk_tickets GROUP BY status; shows how many resolved tickets are still being scanned on every list view.

Hesk's own admin area is the correct place to prune. In the Hesk AdminCP go to Settings → Misc and review the ticket retention and attachment options, then use Manage Tickets filters to bulk-delete or archive old resolved tickets rather than deleting rows manually, which keeps attachment files and database records in sync. After a large cleanup, reclaim space and refresh index statistics from phpMyAdmin by selecting the large tables, choosing Optimize table from the With selected dropdown. This defragments the tables and lets the query planner make better choices, which directly lowers TTFB on the ticket list.

Two configuration choices inside Hesk also cut per-request work. Reduce the tickets-per-page value under Settings → Help Desk so the list view fetches fewer rows at once, and disable features you do not use such as detailed attachment previews if your theme renders them inline. If customers upload large files, store attachments on disk (Hesk's default) rather than inflating database size, and periodically clear the attachments folder of records already removed through the admin tools. Re-run your original TTFB measurements after the cleanup; a help desk that was taking well over a second to render its ticket list routinely drops to a fraction of that once OPcache is warm, assets are cached by the browser, and the database is no longer dragging tens of thousands of dead rows through every query.