Calling 'OnServerCommand' on Logger took XmsNot An Issue
This is crushing my server FPS. Not sure exactly why it's doing this

OnServerCommand - Logger
That amount of time is actually pretty trivial, it’s actually more likely the warning spam that is trashing the FPS. Any sort of excess console output can cause the server to lock up. The higher spike in the text there is likely during a server save.

The logging that the plugin uses isn’t optimized though, so that’s be something for improvement in Oxide itself.

Without seeing he full log though, it is hard to tell what is going on.
Yeah not sure, but I had to remove Logger to get my server FPS back up to 256. Where is the full log? Nothing notable found in my console output.txt log that I can see...
After switching from linux to windows, im getting that warning a lot. Logs aren't informative as well. I disabled almost everything, except logging connections and commands. Also did some debugging, and every client command or server command handling takes from 35 to 50 ms on an empty server. The problem is at this line:
LogToFile(filename, $"[{DateTime.Now}] {Lang(key, null, args)}", this);
I tried to pull out all string template parameters and replace them with single variables, but that didn't helped, so i suppose, that the problem is somewhere at the implementation of LogToFile()

And after a certain time server might get into a big troubles, leading to a 100-300ms execution time for every client/server command.
Server is at SSD, its a Windows 2019 version, and my log directory is almost empty. Linux, log directory which has some GB of logs worked fine (at least without warnings about 100-300ms)

Even 30-50ms lag at every client/server command isn't something you are really want to see for a full loaded server. Maybe i will test it at a more loaded server until i got 100-300ms because those might be caused by another code and will post it on this thread.

UPD:
Omg, thats a super weird, but the same code on different plugins executes a very different time.
double start = (DateTime.Now - pluginStartDate).TotalMilliseconds;
Puts("test");
double end = (DateTime.Now - pluginStartDate).TotalMilliseconds;
Puts("Testing took: " + (end - start) + "ms");        
            ​
If i put this in a Logger.cs file, it tells ~100ms
Hovewer if i put this on a RustPlugin class, this code executes in ~0ms. Maybe something wrong between RustPlugin/CovalencePlugin implementation?
Oh, found it. If you remove the log file (which was 700kb at the moment), LogToFile() takes just 4-5ms then.

Just a tiny snippet of what spams my server all day when this plugin runs. The delays this plugin causes forcing me not to use it.


Aracelis[15718970/1981403] was killed by Explosion

Reiko[15719005/5641353] was killed by Explosion

Remedios[15719039/7422587] was killed by Explosion

Calling 'OnServerCommand' on 'Logger v2.2.1' took 155ms

<color=#aff>[saddletest[15582816]] SwitchParent Missed horse.corpse[15763413]</color=#aff>

<color=#aff>[saddletest[15582814]] SwitchParent Missed horse.corpse[15764461]</color=#aff>

Calling 'OnItemCraftFinished' on 'Logger v2.2.1' took 135ms

<color=#aff>[saddletest[15583242]] SwitchParent Missed horse.corpse[15766055]</color=#aff>

<color=#aff>[saddletest[15583904]] SwitchParent Missed horse.corpse[15766702]</color=#aff>

Aleen[15199638/8833877] was killed by Blunt

[CHAT] Smoke[13073290/76561197973168969] : I now have electricity.

Calling 'OnItemCraftFinished' on 'Logger v2.2.1' took 133ms

<color=#aff>[saddletest[15585824]] SwitchParent Missed horse.corpse[15775336]</color=#aff>

Calling 'OnItemCraftFinished' on 'Logger v2.2.1' took 160ms

Calling 'OnItemCraftFinished' on 'Logger v2.2.1' took 156ms

<color=#aff>[saddletest[15589954]] SwitchParent Missed horse.corpse[15780648]</color=#aff>

<color=#aff>[saddletest[15588983]] SwitchParent Missed horse.corpse[15781459]</color=#aff>

<color=#aff>[saddletest[15589384]] SwitchParent Missed horse.corpse[15781692]</color=#aff>

Calling 'OnServerCommand' on 'Logger v2.2.1' took 161ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 127ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 160ms

<color=#aff>[saddletest[15589952]] SwitchParent Missed horse.corpse[15784247]</color=#aff>

Calling 'OnServerCommand' on 'Logger v2.2.1' took 162ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 162ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 164ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 162ms

Calling 'OnServerCommand' on 'Logger v2.2.1' took 161ms



Merged post

I removed all log files and it still does this on everything thing that would cause a log write. 

It's not a machine issue, it's something with the mod  thatn optimizing. 

What is causing this?
squirrelof09
I removed all log files and it still does this on everything thing that would cause a log write. 

It's not a machine issue, it's something with the mod  thatn optimizing. 

What is causing this?

It and the method it uses for logging is not optimized, so it will potentially trigger hook warnings, especially if the server is already bogged down.

Locked automatically