MUSHclient lagging or not responding - other clients work fine.

Posted by Rena on Fri 06 Feb 2009 10:22 PM — 4 posts, 17,856 views.

#0
Hi,

I installed MUSHclient a week or two ago and it had been mostly working okay, but I've started having a ton of trouble. I'll get bubbles of what seem like lag that last 30 seconds or a minute, and sometimes it'll go so long without responding that I just have to close it and open it again to get things going. I never actually lose connection to the MUD, I'm just not getting any of the output from it.

I tried deleting all but a few of the triggers and aliases I'd added, and that seemed to improve things a bit. But it's still doing it fairly often (every 20 minutes or so). Furthermore, when I log into the MUD using the built-in website client, everything runs fine, so I know it's not the MUD itself or my internet connection that's the problem.

Is there something I could have messed up in the settings that would cause this? Or something running in the background that is interfering with the program? It's driving me crazy.
Amended on Fri 06 Feb 2009 10:24 PM by Rena
Australia Forum Administrator #1
It is possible to make a trigger that take a very long time to evaluate. For example:


You see *** here.


The consecutive asterisks (wildcards) can cause the regular expression evaluator to try millions of combinations to find a match. Generally this is unintentional.

Try eyeballing your triggers and see if you have something like that. Otherwise after this delay has occurred, try going through your trigger list and editing each one, seeing if the evaluation time (shown in the bottom-right corner) is very high. For example, I see something like this: 0.000805 sec.

That is this trigger has taken less than a millisecond to evaluate. If you see something like 15.342433 seconds, then that one is probably the culprit.

If something obvious like that doesn't show up, try narrowing it down. I very rarely have reports of slow behaviour, so I think it is something you have done or installed. In the world configuration you can disable:

  • All triggers (one checkbox on the main trigger list)
  • All aliases (similar)
  • All timers (similar)


Run for a little while with them disabled and see if the problem goes away. Then gradually re-enable them (eg. enable all aliases), and try again.

Also go to the plugins window and disable all plugins (select all, click Disable).

Are you using scripting? If so, which language? Try turning scripting off.

Have you many plugins installed?

The client itself is fast and reliable. However it is beyond my control if you install (say) a plugin, written by someone else, that happens to do huge computations, or major loops, or something like that.

If turning off all these extras fixes the problem, you can then fairly quickly isolate which exact thing it is by turning half of everything back on at a time. For example, half the plugins. If it still works fine, turn on half of the remaining ones. And so on. That way, by effectively doing a binary search you can quickly isolate the problem item.


I had a posting recently from someone who said he leaves MUSHclient running for months. I myself tend to leave it running for weeks. I never notice a slowdown. However it would only take a single trigger that does something like:


for i = 1, 100000000 do
  -- something
end 


... to introduce a big delay.

#2
Thanks so much for the quick and detailed response.

I narrowed the problem down to my triggers, but couldn't find any that said they took more than .002 or .003 to evaluate, and most took more like .0002 or .0003. I hardly use any wildcards, never more than one per trigger, and none but the most trivial, one-line no-computation scripts.

As it happens, I deleted one trigger that seemed to take more resources than the rest (up to .02 or something) and ran it for half an hour with no noticeable problem. Maybe it was some sort of fluke? At any rate, I'll know what to check for if it comes up again.

Is it possible that part of the trouble is that I just have too many triggers? I have about 200, nearly all just for highlighting important messages.
Australia Forum Administrator #3
It should easily cope with 200 triggers. See this thread:

http://www.gammon.com.au/forum/bbshowpost.php?id=9189

In that I tested 1,000 randomly-generated triggers, and pumped through data as fast as I could.

My test showed that (on my PC) it could process over 670 lines a second (which is over what you would expect to receive from a MUD), each line being sent to 1,000 triggers.

Your research which showed a trigger which took .02 seconds doesn't really explain a 30-second lag. However if you can isolate it to that trigger it might be interesting to see what it does. See: http://mushclient.com/copying