Measuring outbound traffic

Revision as of 02:18, 3 July 2021 by Buu342 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Let's assume you're making a mod for Zandronum that does a lot of calculations, or uses heavy amounts of special effects. Maybe people are complaining that they lag out randomly after a while playing. Maybe you're just obsessive about performance. Anyway, there is a way to measure outbound traffic by actor and script.

Enable sv_measureoutboundtraffic (that is, set it to 1) on the server. The moment you do this, the server will begin to keep a record on the amount of traffic coming out from it. Once you do that, you can use dumptrafficmeasure (again, on the server) to check these records. Use cleartrafficmeasure to reset these records.

When you do a dumptrafficmeasure, you'll see something like this:

Network traffic (in bytes) caused by actor code pointers:
BFG7000Ball 11010
BFG7000Plasma 3947
BallestaArrow 528
BerserkNew 4
ClusterBombGrenade 342
Cyberdemon 270
JKERocketBox 8
Rocket 44
SpitfirerGrenade 42
StrifeMarine 814
TinyGrenade 707
WolfensteinSS 14917

Network traffic (in bytes) caused by ACS scripts:
Script 474: 2236
Script 760: 547
Script 876: 928

What this means is that, for example, WolfensteinSS has sent 14917 bytes of data out, and script 474 2236 bytes. This data, while basic, is invaluable for finding out what scripts need to be optimised (in this case, there's nothing particularly bad here, although script 474 could still be optimised).