Database is lagging!

Posted by 99fender on Tue 01 Apr 2003 11:21 PM — 8 posts, 32,987 views.

#0
Hey,

I got a problem with my MUSHClient. I have about 10 worlds running a computer in MUSHClient on PerlScript.

They are all linked to a main .db file. I have two computers, one is 1.4ghz 128mb RAM, the other is 200mhz 128mb RAM. I bought the second one mainly to keep the 10 worlds up all the time.

The computer itself is fine and quite fast, even the MUSHClient bots are fine themselves. But, when it comes to anything .db linked - it really lags. For instance, one of the Bots would search for a record in the DB and it would freeze mushclient for 5 seconds-odd and then come up with the result again.

This never happened on my 1.4ghz - How can i fix this! (I also had an old 75mhz testing them out for 2 days - this had less lag when it came to the database!!)

Thanx
Australia Forum Administrator #1
Can you explain about the .db file a bit more? Is this an Access database using the database plugin, or something else?
#2
Erm.. Im not entirely sure, all I know is that - when you open it in word pad, its ALL just text with many spaces between different bits of data. And it's 1000's of lines long..

I edit it in notepad or through MUSH if I ever have to..

It's never been slow accessing it before, just is now.

The .db is a very big one by the way.
Australia Forum Administrator #3
This isn't really a MUSHclient problem - it is based on a script that accesses a very large file.

For a start, you say you have gone from a 1.4 GHz PC to a 200 MHz one. That is 7 times as slow, so you will certainly notice a difference on compute-bound applications.

I am not surprised that a Perl script that scans a text files that is thousands of lines long takes a few seconds. However if you had less lag on your 75 MHz PC then maybe it is a configuration issue. Maybe a different version of Perl, or some other thing like that.

You could try rewriting the database to use a "real" database, there are some examples on this site of using Access databases, or you could use mySQL with a bit more work. This would reduce the need for linear scans of a very large file.
#4
Nick,

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=38

Perhaps my issue could be related to that? Any suggestions?
Australia Forum Administrator #5
Could be, hard to say without seeing your triggers.

Go into the configuration screens, "info" sub-screen, and see how much time (in seconds) the triggers have taken. If it is a lot for newly-opened world (eg. more than a few seconds), then look at individual triggers. Each one will list its execution time. If you find one that seems grossly more than the others (eg. most take 0.05 seconds, one takes 20 seconds) then take a close look at that one.
#6
Nick!

How do you find individual execution time?!

Thanx
Australia Forum Administrator #7
Edit the trigger, the time it has taken to execute (and the number of executions) are on the dialog in the middle somewhere.