mirror of
https://github.com/007revad/Synology_HDD_db.git
synced 2026-04-25 21:55:59 +03:00
[GH-ISSUE #318] Suggestion: Set Writemostly for DSM and Swap to HDD if have SSD #613
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Synology_HDD_db#613
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xeroxxx on GitHub (Jul 7, 2024).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/318
I found out if you have an hybrid environement and a SSD is part of you NAS between all those HDDs you can configure mdadm to primary read Swap and DSM from your SDD instead of the HDDs to gain access times.
Did a write-up over here: https://www.techspark.de/speed-up-synology-dsm-with-hdd-ssd/
I think that would be a great addition to your script.
Cheers
@007revad commented on GitHub (Jul 7, 2024):
Interesting. I wanted more information on this so after reading your write-up I found https://raid.wiki.kernel.org/index.php/Write-mostly.
I'll have to install another drive in my Synology to test this (because md0 and md1 are not mirrored to my NVMe drives or HDD in an expansion unit).
I might start with a separate script. It would have to also cater for newer models that use device tree and use
/sys/block/md0/md/dev-sata1p1or/sys/block/md0/md/dev-sas1p1. People would need to specify their fast drive (or drives) because the script would have no easy way to determine which drive or drives are faster. Though the script could just set all internal HDDs as writemostly if there is an innternal SSD found.Currently mine show
in_syncIt looks like the script would need to
echo writemostly > ...after each boot.@Xeroxxx commented on GitHub (Jul 8, 2024):
I've to check what happens after a restart. You can specific the parameter on volume creation as well, but this is actually risky and not a path I would follow.
Actually you don't need the determine which drive is faster, I think you want to read from ALL SSDs as you want to gain AccessTimes not Throughput for DSM.
Determine which drives are part of md0 and md1, than cat /sys/block/sda/queue/rotational. 1 HDD 0 SSD.
@Xeroxxx commented on GitHub (Jul 10, 2024):
@007revad I can confirm writemostly stays intact after a restart.
The speed of a restart feels enourmously faster.
@007revad commented on GitHub (Jul 12, 2024):
@Xeroxxx
Do you want to set your drives back in_sync then try this script: https://github.com/007revad/Synology_HDD_db/blob/test/writemostly_test.sh
It checks that there are SSD and HDD drives and if there both it sets writemostly for the HDDs.
If it works I'll add the code to syno_hdd_db
@Xeroxxx commented on GitHub (Jul 12, 2024):
Currently extending my storage pool with an additional drive. Will do afterwards! (ETA 2 days)
cat /var/log/synobootup.log
Startup finished in 13.354s (kernel) + 2min 46.683s (userspace) = 3min 38ms.Can you guide me in the script where echo -writemostly > state is set? Can find where the unset happens?
writemostly > state # sets
-writemostly > state # removes flag
default is "in_sync"
@Xeroxxx commented on GitHub (Jul 16, 2024):
It does work and sets the variable on all HDDs in my case. I can do a pull request for unset, but I'm not sure how you want this to be implemented.
@007revad commented on GitHub (Jul 16, 2024):
I chose to make it automatically set writemostly on HDDs because it was easier to do. The other alternatives are:
I'm not sure yet either. I've been trying to think of what letter to use for the optional flag that relates to what it does. These are already used:
@Xeroxxx commented on GitHub (Jul 17, 2024):
I'm sorry I completely misunderstood. I thought you want me to toggle my active writemostly back.
It works completely fine, I thought the script should set it back to in_sync and echo -writemostly when its triggered again or with a switch.
You implementation is fine, no need for option 1 or 2.
How about:
@007revad commented on GitHub (Jul 18, 2024):
I've released a new version with the writemostly option.
https://github.com/007revad/Synology_HDD_db/releases/tag/v3.5.96
@Xeroxxx commented on GitHub (Jul 18, 2024):
Maybe replace "runs" to "primary reads" from SSDs or individual configured drives. But only a suggestion. I can do a PR/MR if you like.
Thanks for your work, think that helps others alot! Thanks for the Kudos in the Release Notes, appreciate that.
@007revad commented on GitHub (Jul 18, 2024):
You can make a PR/Mr
It has to be 80 chars or less. I don't know why I put a full stop on the end.
You could change it to something like the following:
@Xeroxxx commented on GitHub (Jul 18, 2024):
I did a proposal. Feel free to edit.
@Xeroxxx commented on GitHub (Dec 12, 2024):
@007revad Just to document that. The setting survives updates. So set and forget.
In general you can see greatly improved startup times. Had several restarts now :D