Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not persistent across reboots #2

Closed
TheLinuxGuy opened this issue Feb 3, 2024 · 6 comments
Closed

Not persistent across reboots #2

TheLinuxGuy opened this issue Feb 3, 2024 · 6 comments

Comments

@TheLinuxGuy
Copy link

Thanks for making this script available. I have followed the setup instructions and upon reboot (regardless of sysctl.conf setting for 0 instead of 1024 the DSM seems to be resetting it to defaults).

Here is some basic debugging after a reboot, note I installed using the script run as root (sudo -i) before rebooting.

myuser@sin:/$ sudo -i
root@sin:~# date
Sat Feb  3 03:29:12 AM EST 2024
root@sin:~# uptime
 03:29:14 up 1 min,  1 user,  load average: 5.34, 1.84, 0.66 [IO: 3.79, 1.22, 0.43 CPU: 1.55, 0.62, 0.23]
root@sin:~# cat /etc/sy
synoappprivilege.db     synoinfo.conf.16tlG0    synotoprc               sysctl.conf
synoautoblock.db        synopackageslimit.conf  synouser.conf           syslog-ng/
synoinfo.conf           synosyslog/             sysconfig/              systemd/
root@sin:~# cat /etc/sysctl.conf
kernel.panic = 3
net.core.somaxconn = 65535
net.ipv4.tcp_tw_reuse  = 1
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
kernel.syno_forbid_console=0
kernel.syno_forbid_usb=0
net.ipv6.conf.default.accept_ra_defrtr=0
net.ipv4.conf.default.accept_redirects=0
net.ipv6.conf.default.accept_redirects=0
net.ipv4.conf.default.send_redirects=0
net.ipv4.conf.default.secure_redirects=0
net.ipv6.conf.default.accept_ra=0
dev.flashcache_shared_cache_vg1_alloc_cache_1+volume_1.skip_seq_thresh_kb="0"
(failed reverse-i-search)`dev': ^Cte
root@sin:~# /volume1/data/synology/scripts/
@eaDir/            syno_app_mover.sh  syno_seq_io.sh
root@sin:~# /volume1/data/synology/scripts/syno_seq_io.sh
Synology_enable_sequential_IO v1.0.1 - by 007revad

See https://github.com/007revad/Synology_enable_sequential_IO

Setting a cache's skip_seq_thresh_kb to 0 enables sequential I/O
Choose a volume with a cache to edit:
---------------------
Cache Volume  Setting
---------------------
1)  volume_1  1024
---------------------
Select cache volume to edit: 1

You selected volume_1 to set to 0

Sequential I/O for volume_1 cache is enabled.

The Synology needs to restart.
Type yes to reboot now.
Type anything else to quit (if you will restart it yourself).


@TheLinuxGuy
Copy link
Author

My workaround for now.

root@sin:~# cat /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb
1024
root@sin:~# echo "0" > /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb
root@sin:~# cat /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb
0

Verified working; otherwise the NAS won't write to nvme sequential IO (7GB linux dvd iso)

@007revad
Copy link
Owner

007revad commented Feb 4, 2024

Are you using DSM 7.2.1 Update 4?

@TheLinuxGuy
Copy link
Author

Are you using DSM 7.2.1 Update 4?

No.

DSM 7.2.1-69057 Update 3 (Release notes) on DS1522+

@skupjoe
Copy link

skupjoe commented Feb 6, 2024

I am seeing the same issue and I am running DSM 7.2.1-69057 Update 3 on DS1823xs+

After running the script and setting to 0 I immediately re-run the script and I still see a value of 1024.

# ./syno_seq_io.sh                                                                                                                                        
Synology_enable_sequential_IO v1.0.1 - by 007revad                                                         

See https://github.com/007revad/Synology_enable_sequential_IO                                              

Setting a cache's skip_seq_thresh_kb to 0 enables sequential I/O                                           
Choose a volume with a cache to edit:                                                                      
---------------------                                                                                      
Cache Volume  Setting                                                                                      
---------------------                                                                                      
1)  volume_1  1024                                                                                         
---------------------                                                                                      
Select cache volume to edit: 1                                                                             

You selected volume_1 to set to 0                                                                          

Sequential I/O for volume_1 cache is enabled.                                                              

The Synology needs to restart.                                                                             
Type yes to reboot now.                                                                                    
Type anything else to quit (if you will restart it yourself).              
<no reboot>

# cat /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb                                                                                                                                                                                                                                                                                       
1024                                                                

# ./syno_seq_io.sh                                                                                                                                        
Synology_enable_sequential_IO v1.0.1 - by 007revad                                                         

See https://github.com/007revad/Synology_enable_sequential_IO                                              

Setting a cache's skip_seq_thresh_kb to 0 enables sequential I/O                                           
Choose a volume with a cache to edit:                                                                      
---------------------                                                                                      
Cache Volume  Setting                                                                                      
---------------------                                                                                      
1)  volume_1  1024                                                                                         
---------------------                                                                                      
Select cache volume to edit: 1                                                                             

You selected volume_1 to set to 0                                                                          

Sequential I/O for volume_1 cache is enabled.                       

But if I run:

echo "0" > /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb

And then run the script immediately after (no reboot) I see it correctly set to 0:

# ./syno_seq_io.sh 
Synology_enable_sequential_IO v1.0.1 - by 007revad

See https://github.com/007revad/Synology_enable_sequential_IO 

Setting a cache's skip_seq_thresh_kb to `0` enables sequential I/O
Choose a volume with a cache to edit: 
---------------------
Cache Volume  Setting
---------------------
1)  volume_1  0
---------------------
Select cache volume to edit: q
Invalid choice! q

But then if I reboot it goes back to 1024.

# cat /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb                                                                                                                                                                                                                                                                                       
1024  

# ./syno_seq_io.sh                                                                                                                                        
Synology_enable_sequential_IO v1.0.1 - by 007revad                                                         

See https://github.com/007revad/Synology_enable_sequential_IO                                              

Setting a cache's skip_seq_thresh_kb to 0 enables sequential I/O                                           
Choose a volume with a cache to edit:                                                                      
---------------------                                                                                      
Cache Volume  Setting                                                                                      
---------------------                                                                                      
1)  volume_1  1024                                                                                         
---------------------

I've worked around this by using a scheduled boot task to run:

echo "0" > /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb

@007revad
Copy link
Owner

007revad commented Mar 3, 2024

@TheLinuxGuy @skupjoe

My Internet was down for 4 hours today so I had time to work on this script. The version I'm working on:

  1. Includes echo "0" > /proc/sys/dev/flashcache_shared_cache_vg1_alloc_cache_1+volume_1/skip_seq_thresh_kb for the selected volume.
  2. Does not need a reboot after running running the script due to point 1.

I'm currently working on making it possible to schedule the script to run at boot with an option to specify the caches you want set to sequential I/O.

007revad added a commit that referenced this issue Mar 4, 2024
v2.0.3
- Added --volumes option to make it possible to schedule script to run at boot-up.
  - You can specify multiple comma separated volumes.
- Added --kb option to replace setting kb via first parameter.
- Bug fix for "Not persistent across reboots" issue #2
- Bug fix for when no caches are found.
  - You need to schedule the script to run at boot-up.
- Bug fix for when multiple caches are found.
@007revad 007revad mentioned this issue Mar 4, 2024
@007revad
Copy link
Owner

007revad commented Mar 4, 2024

New version of the script here: https://github.com/007revad/Synology_enable_sequential_IO/releases/tag/v2.0.3

It needs to be scheduled to run as root at boot, with the --volumes=volume_n option.

See readme: https://github.com/007revad/Synology_enable_sequential_IO
and how to scheduled: https://github.com/007revad/Synology_enable_sequential_IO/blob/main/how_to_schedule.md

@007revad 007revad closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants