With development moving forward at quite a pace on the OpenSim versions, we thought we might share a few points from our bookmarked pages that could be helpful for those working in OpenSim or developing for it.
PacketPool – Use It Wisely
For the first point, we we need to thank Myron Curtis and his suggestion regarding the PacketPool, a functionality that has been on and off through the different versions of OpenSim. It’s worth trying if you are experiencing high CPU load with many avatars in your grid. It can reduce the pressure on your CPU. To enable it, add it to your ini file like this:
; Enables the experimental packet pool. Yes, we’ve been here before. Helps CPU load when alot of avatars are in world
RecyclePackets = true;
RecycleDataBlocks = true;
Scripts Mysteriously Stopping – Is It Time Yet?
Now, if you have been having problems in your grid with a script that stops running – say a visitor counter or similar script with do while or for loops – setting the EventLimit to a higher value seems to solve most of this:
EventLimit = 86400
This appears to be the minutes in a day. Changing from the default 30 to 86400 lets your scripts run 24/7. You may still have problems with loops not quite working in your scripts. We found them a bit flaky, especially the while loops, so it may be better to use a timer event rather than a loop.
Test Your Code!
For example, reading from a notecard in a script can be done with the usual LSL commands, but OSSL has some handy alternatives that will make your code shorter, including some capabilities not available in Second Life such as creating a notecard within a prim from your script with osMakeNotecard and for reading from a card, there is osGetNotecard. Anyone who has made notecard-reading scripts in Second Life will appreciate how much simpler these OSSL commands are.
These few tweaks have made OpenSim work a bit better for us. Each new version brings some welcome steps forward with perhaps a few small glitches here and there. We’re able to devote more time to creating and improving the inworld experience and less toward merely keeping the grid up and running, or figuring out why it’s not running as expected. For us, it makes the result very much worth the effort.