#Cannot write variables fast enough

1 messages · Page 1 of 1 (latest)

noble hawk
#

I'm getting an error message in my console that says [Skript variable save thread/WARN]: [Skript] Cannot write variables to the database 'default' at sufficient speed; server performance may suffer and many variables will be lost if the server crashes. (this warning will be repeated at most once every 10 seconds) I believe it is what crashed my server earlier today. Does anyone know how to fix this?

teal mica
#

Did you make a while loop without adding wait?

untold hemlock
#

his server would just instantly

#

crash every time

#

well depends on the if statement ig

#

if its a player online insta crash on login

#

if its another prob wouldn't crash until a lil while after

#

depends on what the if statement is

#

idk

zenith tundra
#

Not being able to write fast enough to the .csv or whatever file is caused by attempting to save too many variables normally

untold hemlock
#

ah

zenith tundra
#

best fix is splitting the work flow to

Database/NBT/.dat file for player data
.csv for static never changing variables
and temp/ram vars for things you would maybe only change via on load or in on skript load

noble hawk
#

any way to reduce that number?

#

or at least reset the variables.csv file?

zenith tundra
#

there is no good method for dealing with stuff within the variable file, you'd have to open it and figure out what variables are being saved along with what ones you don't need

storm ferry
zenith tundra
#

for what part of it

nbt, .dat or database?

#

since nbt and .dat can all be done using skbee
while database depends fully on yourself

storm ferry
#

.dat
really, SkBee? interesting

zenith tundra
#

.dat files are basically nbt

noble hawk
#

Basically, my .csv is being filled up with a bunch of checkpoints of players (its on a parkour map). Is there a way to flush the variables.csv every time the server reboots?

storm ferry
#

How many players are on the server when the code is running?

#

Instead of setting the value of the variable how ever fast you are doing it, just do it only when they go on the checkpoint. Otherwise, why bother changing the variable at all?

zenith tundra
#

he most likely is doing that as the .csv file doesn't update automatically it takes by default 2 hours between server start
start -> load -> wait 2 hours -> save -> wait 2 hours -> save *repeat

#

the issue is skript loads all data as it can't tell what value is needed at the time so each save he's saving all new and existing

storm ferry
#

True. Adding to the suggestion of file storage, if you can't for some reason use SkBee, you can try either SkUtilities (not recommended, but possible) or skript-yaml (highly recommended) to save the info to a yaml file, which can be read like normal (whereas .dat cannot without certain applications or in-game via an addon). I personally use yaml.

zenith tundra
#

No if you can't use skbee then you give up. yaml is made for configs not player data
skUtilities guessing refering to the file modification stuff, this shouldn't even be mentioned

storm ferry
#

I was saying SkUtilites because it also has yaml syntax.

#

And for player data, tell that to Essentials xD

zenith tundra
#

Essentials devs don't care and generally don't add a bunch of stuff. while yes yaml is fine, if you have the ability to use a database or nbt then you should.

nbt files are one of the best sterilizers and encoding stuff. a 10mb .csv file isn't even 80kb in .nbt

#

courtesy of ShaneBeee

10k items saved in each one

storm ferry
#

oh, dang.

#

I might actually convert my stuff over to nbt then. I'm just so used to using yaml at this point that I kinda just use it everywhere.

#

But anyways, I digress.