hitch warning: frame time of N milliseconds
Something froze the server for a moment. Players feel it as a stutter. It is a symptom, not a failure.
Do this first
A few at startup are normal. Constant ones during play mean a script needs looking at.
What it means
Something blocked the main thread for that long. This is NOT an error: nothing failed and nothing crashed. It is the runtime reporting that one frame took far longer than a frame should, which players feel as a freeze.
Treat it as a symptom with a number attached. Under about 100ms it is usually startup noise; sustained hitches over 200ms during normal play are a real problem.
What causes it
Ordered by how often it is the answer.
- 1
A synchronous database query on the server
The whole tick waits for MySQL. A missing index turns this from invisible to several hundred milliseconds.
- 2
Heavy work during resource start
Parsing a large JSON config, building a big table, loading hundreds of props. Hitches only at startup are usually harmless.
- 3
A tight loop without a Wait
while true do ... endwith no yield blocks the scheduler until it finishes. - 4
Streaming a lot of assets at once
Requesting many models or animation dictionaries in the same frame.
- 5
A slow event handler
An event that fires per player, doing real work, on a full server.
How to tell which one is yours
resmon 1
in the client console shows per-resource CPU. On the server, txAdmin and the built-in profiler point at the resource. Match the timing of the hitch to what was happening: join wave, resource restart, or a specific player action.
Where to look
The resource resmon points at, then its threads and its database calls.
How to fix it
Yield inside long loops, make queries asynchronous, and index what you filter on:
-- blocking
local rows = MySQL.query.await('SELECT * FROM users')
-- non-blocking
MySQL.query('SELECT * FROM users WHERE identifier = ?', { id }, function(rows)
-- ...
end)
-- always yield
CreateThread(function()
while true do
Wait(500) -- never omit this
end
end)Still stuck on your own code?
This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.
bug_reportOpen Server Fixer