[Solved]Turnkey SSD issues and support?

Asking again here in a specific question.

Ive run the server off an SSD with a 500gb HDD as an archive drive.

ive also run the server on the 500gb HDD with the 256 gig SSD mounted for just the actual server directory (to ensure fast loading and saving and generating fo just the world

This works great. until the HDD fills up. and turnkey doesnt seem to be running my fstrim command at all.

so what happens is the drive gets full real quick cause of the writes.
but the system doesnt know about it.

im wondering if there has been any improvements on this front since we have quite an advanced server. and id love to use the actual drive for something.

the drive in question is s 240gb samsung EVO
I could switch it out for an intel 520 60gb

Question, if your HDD is filling up (assuming that means not an SSD), why would your 256 GB SSD (and TRIM) be affected by this? TRIM should only reclaim unused, but not emptied out SSD blocks…but if they are used, then fstrim shouldn’t be doing anything, really–what can it?

So if the drive (the SSD) is getting filled up, do you have any reason to doubt it is not actual data, that wouldn’t be trimmed?

If there are, it’d be something you’d get via normal Debian Linux upgrades, e.g., apt-get, because the Minecraft web-ui wouldn’t be making any progress in SSD performance and upkeep.

If you can, please clarify your question with regard to which drives are actually getting filled up and what behaviors are being exhibited that make you think FSTRIM isn’t being run/doing what it should be.

Ok yes that was bad i got mixed up in writiing.
“this works great, until the SDD fills up”

thats what i mean. apparently in windows the trim command works as such that every time a file is deleted it frees up the space.

the following is what ive understood from reading. i could be completely wrong

for some reason. many linux distros have been forced to rely on a timed fstrim command or another alternative which is much slower.

you run the fstrim command every x minutes/hours and it tells the controller on the ssd to that “these files are no longer stored on the server. or this is the lastest version”
where as the ssd itself is being written too each time. without clearing the previous data.
when you work with MC if this doesnt work properly and many changes are being made to many chunks the sdd can fill upp extremely quickly.

After doing a little more research i have found the two following guides. SSD do indeed have quite a few suggestions for changeing things. and im trying to figure out if i can use these optimisations for JUST the folder houseing the actual server i want to use.


Im not sure what this is. but it seems it was suggested for turnkey a few years back to add some kind of script pre or post install to help with SSD installs.
Maybe we could create some kind of script to detect and do this for SSD’s as well?

I don’t think it’ll be necessary or desirable to limit it in this way. TRIM only makes a difference after files get deleted, so either files on the rest of the FS aren’t really being changed (which is the case in most areas) and TRIM-ing doesn’t cost you anything, or files are being changed and you’re not TRIM-ing them and reclaiming the space.

In short, you can’t (or rather, shouldn’t) micromanage TRIM. If you want to have it on a schedule, that’s certainly possible with startup scripts or cronjobs, but it’s not something that only Minecraft server files should be getting.

In Linux, every time a file is deleted it is marked as unused, it is the TRIM command that frees up the space. They’re separated into two different commands to better give admins the choice of when that I/O bottleneck will take place. In most cases, it is perfectly fine for it to happen hours later (such as during low activity periods/nighttime) because there’s enough free space in the mean time.

One question, however is: have you actually run out of space? If your SSD is full, and not because of “deleted-but-not-deleted-files”…then TRIM won’t do anything; it can’t make space out of nothing, it can only reclaim 'marked for deletion space". If you have a 256 GB SSD, then, and 250GB of actual data, no amount or quantity of TRIM-img will make you have more.

To find out, run your TRIM manually and check your disk space (df command). If you’re near your limit, TRIM isn’t your issue, it’s just low disk space.

Oh no it was definately undeleted files. I was running fstrim on a 10 minute timer just to test.
It was still filling up after 1 to 2 days. crashing the server and causing corruption.
Rhe drive in question had actual file usage of about 15 gig including all files at the time. ie roughly 5% usage
the manual fstrim command would then report a release of the full drive contents. and a rerun of the same command would run zero.

I have no followed some of the above links.
First i partioned the tool with “gparted” making sure to align the partion with the MiB and making sure that it had worked.
Secondly i mounted the SSD as the var/games/minecraft directory. (the core os and everything else is stored on the HDD so they can do what they want and not affect the outcome of a trim command.
Third i took ownership of the drive with chown to the mcuser.
Lastly i set up a cronjob

This has given me quite an increase in read speed, but the write speed has been dissapointing.

After a new test, im noticing the fstrim is still doing the same thing. leave it a day and fstrim will clear well over 200 Gig of data. despite the cronjob to run “fstrim -v /var/games/minecraft” being set to hourly.

Are there any automatic HDD cleanup checks or searches that need to be disabled? IE defrag etc. that need to be turned off?

I am very well aware i could be doing something wrong. i am just not sure what.

To update all,

This now seems to be working. no crashes for 3 days and fstrim is now being run and doing its job.