Are you also writing output periodically? Take a look at the spelled sub in the Jumble solver script. It periodically prints out ".oOo.oOo" string to the browser. Are you doing something like that? If not you'll timeout even though you set autoflush.