Jump to content

listening to channel 0, and lag. Bad, but how bad?


Rhys Goode
 Share

You are about to reply to a thread that has been inactive for 2583 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I've always taken the notion of using llListenRemove very seriously, put timers so no listen_handle is open longer than it needs to be.

But I have been playing with a chatbox script, that opens a handle on channel 0, and sucks in each and every word from local chat, parses each line, decides what to say and says it. By it's nature the script needs to listen to local chat all the time, it never stops.

So, I know in a vague sort of way, this is bad for lag. But I am really unclear if it is bad for my lag, or for the lag of people around me. I see no ill effects on my own lag, but I have a high end machine. If the listening and parsing etc are done in my own viewer, I don't see a problem using it. But what about the other guy?

And I have no understanding of how to answer the question "how bad", quantitatively. I'll be using the script on a private sim, I'd like to make a rational decision about whether or not to run it. Depending on "how bad", I might I might shrug and say "meh", or I might recoil in horror.

Anyone know how to get some useful numbers?

Link to comment
Share on other sites

Arton is probably right,  especially in your case. Keeping any channel open all the time means that the region servers will need to devote time to evaluating every message, deciding whether you are within listening range and are the intended recipient. If there are a lot of people in the region and a lot of messages,  that can add up to a lot of work and can restrict the amount of resources available for other things. That means lag for everyone. You can look at your Statistics bar (CTRL + Shift. +1) to get a feel for how much time is being devoted to messaging. I suspect that it's not much on your region. In general,  though, it's good practice to close listeners unless you really need them. Chat lag can be serious once you have many people in a region.

Link to comment
Share on other sites

See the notes section to the llListen article in the wiki for an explanation of how the server processes listen events and why open listeners on 0 are a bad idea.

I agree with Rolig and Anton -- it's probably not causing a great deal of harm in your example, and I certainly wouldn't say you should never use an open listener on 0.   

However, I would say that if you are thinking of using an open listener on 0, you should have a good reason for doing it because if there's a lot of scripts listening on 0, then it's giving the server a lot of unnecessary work.    

  • Like 1
Link to comment
Share on other sites

I don't have any numbers but I've done quite a few chat (chan 0) parsers for clients and so far no one reported noticeable sim performance degradation because of these scripts, regardless of the number of agents and chat frequency on the premises.

Link to comment
Share on other sites

Probably about 90% of the kids at the anime mall I hang out at have attachments listening on 0, such as dancers and/or autoresponders, plus there's more than one amusement item that I'm pretty sure use channel 0 for interactivity, but the only real lag I've ever noticed there is textures taking a while to load, or the same sort and frequency of chat lag I get at home with two other people and no listening attachments at all.

I've been trying (since Innula brought up the subject with me) to avoid constant listening on channel 0 when it isn't necessary (because every little bit does help), but if you're running a little chat bot or autoresponder I don't really see it having that much more impact on lag than, say, a "What The Duck" dancer. ^-^;

Edited by Berksey
Link to comment
Share on other sites

Channel 0 is one of the two default channels listened to by straight out of the box opencollars, and that means that every collar, listens to every line of chat and every emote, from every person, or object on the entire sim, THEN filters by range, to see if the text its just heard is close enough to officikally hear rather than unofficially, thewn the scripts fire up to check if the person or thing talking has a valid collar auth code, then morfe checks to see if whats said is a valid collar command then can that auth code level use that command and gah!

You want to know what a lot of chan 0 listener is is like go to the opencollar temple on a busy day.

How much lag you'll get off a chan 0 listener does depend on what you are doing with what you hear. Combat sims used to all be on chan 1, they spread to /3 and /5 because they were lagging their combat systems. smart collar users disable chan 0 as the very first thing they do with a new collar.

A simple trigger on a dancer listening for ''on' probably wont matter, but if the script does any significant checking and parsing of the input, that's gonna lag like hell if used in bulk as part of say a widely distributed attachment.
 

  • Like 1
Link to comment
Share on other sites

Kinda beating a dead horse here, but: The only reason channel 0 can be a problem is that a lot of stuff gets said on it, particularly in crowded, chatty locations. Otherwise it's exactly as (non-)laggy as any other channel. So a chatbot script doing scary hard processing on every utterance won't be any worse for the open listener being on channel 0, for the same number of utterances. The whole problem is that it won't be the same number of utterances, if listening on channel 0.

Also the load scales linearly (in listeners * chat frequency), not combinatorially or anything wicked. I.e., adding another channel 0 listener doesn't make all the other channel 0 listeners any worse than they were before.

If there is a lot of chat on any channel, it's extra important to filter as tightly as possible, keeping in mind the screening order to which Innula refers above. (E.g., if the listener can always exclude messages based on sender key, there's no point in also specifying name and message contents.) This "pre-filtering" can still save a lot, but before Mono, it mattered even more because waking up one of those old LSL scripts to process an event took even more resources.

  • Like 4
Link to comment
Share on other sites

I can totally see that. The amount of stuff it has to check is definitely going to be higher on channel 0 if there's any quantity of people around, and the amount of stuff it has to check, and having to sort through it all for specific content, and adding all sorts of parameters to check all of that within on top of it all, I can see that getting pretty gnarly. Especially if multiple people are running the same or similar scripts in the same area.

I actually spent the better part of yesterday sorting through a lot of my items and changing the listeners and checking for redundant/unnecessary processing of input. having to remember to type a / and a two-or-three digit number before a chat command might seem inconvenient for some, but I just think it's a more responsible way to script if several people might be using the same items in the same place at the same time.

Could potentially cut down a bit on chat spam too, come to think of it... I've never really liked seeing the whole chat scooted up and away by someone trying to kick-start an attachment when they can't remember what to tell it! It's as bad as having things speak multiple-line instructions out loud on top of everyone in local chat, when you could have used llOwnerSay instead...

  • Like 4
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2583 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...