Page 1 of 1

New exciting features for storage

Posted: Fri Feb 07, 2025 8:26 am
by normis
Those of you who are testing 7.18 might have noticed, but most of you probably did not notice yet.
There are plenty of new features in one specific category - storage.

Those of you with devices that support any kind of external storage, like the RB1100, X86, CHR systems or even devices with USB hubs with external drives attached, it would be great if you could test things like:

In default package: https://help.mikrotik.com/docs/spaces/R ... 3346/Disks
- Disk formatting and partitions
- Storage on RAM (tmpFS) when you don't have storage space, but have free RAM
- Swap
- Mount file as block device

In ROSE package https://help.mikrotik.com/docs/spaces/R ... SE-storage
- RAMdisk (slightly different from tmpFS)
- Mounting SMB or NFS onto your router from some NAS and storing files there
- RAID

- BtrFS https://help.mikrotik.com/docs/spaces/R ... 9711/Btrfs

and more

Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 10:45 am
by teslasystems
I want to share my feedback about SMB client (/disk add type=smb ...) and about working with large amount of files.

After connecting a new SMB share with about 50 files, a file tree is loaded pretty quickly, all files are visible in WinBox, but then RouterOS starts doing something weird. It creates a huge load on a network and eats a lot of traffic from SMB server. Within about 30 minutes it has downloaded about 4.5 GB of traffic from the server. And this never stops until you dismount your SMB disk. What the hell is it doing? (TILE, 7.18beta4)
On the Dude graph it looks like this:
.
SMB_traffic.png
--------------------------------------------------------------------------------------------------------------------------------------------------

Regarding woking with large amount of files, I often hear that you are improving the behavior for this scenario. But it will never work normally with large amount of files in current implementation. The reason is simple: RouterOS scans a whole file structure completely. If you have 10K files, 100K files, it will uselessly scan all these thousands of files, creating an unneeded load on network and server. And this process will begin over and over again after each reboot.

To work with large amount of files, file management mechanism should be completely revised:

1. RouterOS should never scan a whole file structure, only content of root directories on the disks.
2. In WinBox, 'File List' should be replaced by 'File Browser' with ability to navigate between directories like it's done in any OS.
3. CLI file commands should also change their behavior. If you type /file print, it should show the contents of root directory only. If you need to show the contents of some subdirectory, you may specify it in 'where' parameter like /file print where name~"subdir/". Sometimes, it may required to show the contents including subdirecories, in such case an additional parameter could be added, like "/file print include-subdirs" for example.
In Linux there is an 'ls' command, so it shouldn't be a problem to translate file commands into 'ls' command accordingly.

It may sound wild for those who get used to current behavior, but without this, any adequate behavior with large amount of files is impossible.

--------------------------------------------------------------------------------------------------------------------------------------------------

P.S. It's still unclear if SMB client feature is incuded in ROSE-storage package, because it works even without this package.

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 10:51 am
by normis
Which version is this?

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 10:53 am
by teslasystems
Which version is this?
I have specified it, 7.18beta4

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 11:24 am
by eworm
Current situation is a disaster for scripts. I have reported my issue here:
viewtopic.php?t=214071#p1120688

... but did not yet open an issue for support. Looks like the implementation is racy, so all scripts that handle files are randomly crashing.

Sometimes even file is available for find, but remove fails anyway, something like:
/file/remove [ find where name="file/with/path" ];

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 12:00 pm
by normis
Changelog tells you about how to do it, use the new parameters (not a bug)

*) file - allow printing specific directories via path parameter;
*) file - added "recursive" and "relative" parameters to "/file/print" for use in conjunction with "path" parameter;

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 12:01 pm
by jaclaz
Meh, this shows how old (and grumpy) I am getting , personally I don't feel particularly excited, the whole stuff appears to be at the moment more wishful thinking than anything else, and anyway it all sounds to me like, to make the usual automotive comparison:
"Hey! We added round wheels, an exciting new development from the square ones we had till now".
(the triangular ones, one bump less, were tested but abandoned earlier)

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 12:03 pm
by Ullinator
I totally agree eworm.
hc_483.jpg
this sccrenshot was made on a rb5009 with ROS 7.18beta4.
The failed script in the sceenshot downloads FW blocklists, merge them and create list entries.
To do this, some files (size <200kb) are downloaded, stored in "Files" and after creation of the "Address List" in the FW menu these files were deleted.
It runs fine on every ROS before ROS7.18Beta2 and now Beta4.
The script itself is provided by eworm.
(please see at https://git.eworm.de/cgit/routeros-scripts/about/)
Please look at it, thank you!

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 12:22 pm
by eworm
Changelog tells you about how to do it, use the new parameters (not a bug)
Wait... What!?

So find is aware of the file and returns an id. But remove still can not remove it. Does that require a path now, for a unique id?
:local FileID [ /file/find where name="file/with/path" ];
/file/remove path="file/with" $FileID;
🤪

That's bullshit, no?

Please have another look at that.

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 1:35 pm
by normis
We can't replicate what you are saying, but actually it would be better and more correct to do it this way:
/file/remove file/with/path
and not
/file/remove [ /file/find here name="file/with/path" ]

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 2:24 pm
by eworm
All that fails the same way. Not every time, but way too often.

As this is racy you need to remove a file that's not too old. Perhaps I should open an issue and provide more details... The problem is that behavior on racy things changes all the time, so there is no perfect reproducer.

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 2:47 pm
by normis
yes, please make a ticket with details how to replicate, how many files you have, which file you removed etc.

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 3:14 pm
by itimo01
- Swap
Swap appears to be working great since I'm now able to spin up a minecraft server on my ax3 :D
While previously trying to get it working, the router would crash with an OOM condition.

container/envs/add key=EULA name=mcsrv value=TRUE
container/envs/add key=MEMORY name=mcsrv value=512M

container/add remote-image=itzg/minecraft-server:latest interface=veth1 envlist=mcsrv root-dir=/usb1-part1/containers/store/mcsrv comment=mcsrv logging=yes
container/start [find comment=mcsrv]

ip/firewall/nat/add action=dst-nat chain=dstnat disabled=yes dst-address=192.168.41.1 dst-port=25565 protocol=tcp to-addresses=172.17.0.2 to-ports=25565
Sadly i cant upload my screenshot right now. (linked it externally)
Image

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 3:23 pm
by Valerio5000


Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks
I'll take a guess..you want to enter the NAS market? tell the truth :D

Anyway it's always nice to see the MK team developing and proposing new features ;)

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 9:01 pm
by dang21000
Exciting features... ? I don't understand why other networks products, forti, xtrem, cisco do like you !
Minecraft on container on network security gateway... it's a joke ?

And during this time, with evolution of routerOS, their more and more constraints about device mode, functions before allowed are now locked and need the physical button press to be changed. When router are far, it's a great feature, for sure ! But it's better to transform routerOS as a NAS, gaming server....

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 9:28 pm
by normis
Who said you have to run Minecraft? One forum user did it for testing?
You can run Greylog or Grafana.

Re: New exciting features for storage

Posted: Fri Feb 07, 2025 9:37 pm
by itimo01
Minecraft on container on network security gateway... it's a joke ?
Yes, and you can definitely run more useful things on a router if you so desire.

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 5:22 am
by teslasystems
need the physical button press to be changed. When router are far, it's a great feature, for sure !
Don't want to sound rude and sorry for offtopic, but having hardware on remote location without having additional devices (like GSM-sockets or something similar) that allow to remotely power-cycle your hardware is very strange at least. Anything could happen and power-cycling often helps. In case of device-mode changing it would also solve the problem. So, as to me, having such devices is a mandatory thing and I don't know how to explain when people don't have them. May be they like to drive (or even fly) to their remote sites each time something happens...

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 6:26 am
by eider
This is RouterOS, not StorageOS. If you desire to add file management and make a NAS out of a router then just spinoff ROS into another branch that is developed separately. Storage device does not need BGP and MPLS and router/switch does not need NFS, Btrfs support, RAID, NVMe over TCP or fancy UI for collaborative file sharing. You already have strong base with basic networking, just cut unnecessary slack, integrate rose-storage into base and sell it as separate OS to be ran on new class of devices.

The naming of ROSE is also pretty poor, "RouterOS Enterprise" - 100% enterprise storage, 0% enterprise networking.

---
You can run Greylog or Grafana.
I wouldn't dare any more than you would dare to run it on Junos :> Possible? Yes, absolutely! Good idea? In hell.

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 7:03 am
by sirbryan
I, for one, welcome our Storage overlords.

Those who are poo-pooing things haven't been paying close attention to the hyper-convergence of functions the last decade or two. Cisco built a virtual router for VMware 15 years ago, and VMware created vSAN shortly thereafter. Now you have Proxmox VE + Ceph, and with a CHR (or two) in the mix, or FRR on the bare metal, customers can build (and have) practically anything on commodity hardware.

Look at what TrueNAS has done with TrueNAS Scale. You put the server on a decent PC, spin up your ZFS pool, go download a bunch of free apps, and/or put a VM on the box. MSP's love this kind of stuff.

It looks like MikroTik is trying to get their hardware and software into this market. You can do a barebones PC, or you can buy a beefy router (RB5009, CCR2004, CCR2x16 or CHR + Ampere) with simple storage, and, like with TrueNAS scale, load up apps (micro services) on your router.

When ROSE came out, I put an NVMe to SATA adapter in a 2116, punched a hole, ran some thin SATA cables out, and hooked up six SATA drives in a bay the size of a CDROM. It works pretty well.

The advantage MikroTik has over a PC is wirespeed switching/routing (on Marvell platforms). I run a bunch of containers on my 2116. Going to have to add the Minecraft one (didn't know it existed for ARM64).

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 8:43 am
by Rox169
Mikrotik NAS?

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 9:29 pm
by noradtux
How I see it 'Tik are just making the existing features of the kernel accessible to the user. I welcome that and I do use containers and storage in private and intent to use it in enterprise.

Re: New exciting features for storage

Posted: Sat Feb 08, 2025 9:40 pm
by Larsa
@sirbryan, that’s not gonna happen. ROS is designed as an embedded NOS with its own limitations. When it comes to running ROS as CHR, there are way better options. Plus, MT lacks the skill set and experience, and ROS is too unreliable for storage solutions like hyper-convergence.

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 2:51 am
by Kentzo
I think it makes a great SoHo router though. A couple of SMB shares and SWAP for memory heavy containers is all I need. Finally can retire an rpi and run Homebridge directly on my AX3.

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 5:34 am
by eider
SWAP for memory heavy containers is all I need
SWAP over USB is a horrible idea and recipe for kernel deadlocks and freezes - definitely not something you want on a device that is also processing your network traffic. Will it work? Yes, and its also likely you won't see any issues... until you hit them hard and waste days debugging it.

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 5:46 am
by Kentzo
I got an impression that their SWAP implementation is only for containers and otherwise unused (and isolated) from network functionality.

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 3:59 pm
by BartoszP
...
Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks
My bet: fast stable shared resource to provide true HA.

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 4:33 pm
by teslasystems
Oh, and regarding this,
- Storage on RAM (tmpFS) when you don't have storage space, but have free RAM
Please read
viewtopic.php?t=214077

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 9:13 pm
by eider
I got an impression that their SWAP implementation is only for containers and otherwise unused (and isolated) from network functionality.
Since containers share kernel with host, there is no distinction here. Only consider it for devices which have PCI-E lanes exposed over physical slot (RBM33G does for example, but it's hardly a good base for it anyway because of MMIPS and 16M of storage).

Re: New exciting features for storage

Posted: Sun Feb 09, 2025 11:08 pm
by anav
Zerotrust cloudflare on a storage device??? ;-PP

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 5:08 am
by guipoletto
Regarding tmpfs:
i ran a script to create "/tmp" on several production devices:
/disk/add slot=tmp type=tmpfs;
this should create a ramdisk with "upto" 50% of RAM

it failed on all "64M" devices (RB2011iL, RB2011iLS, RB750r2, RB433)
for these, the default of 50% should probably be reviewed
they accepted up to 30M for tpmfs, even when "free-memory" was around 20-24mb

this leads to another observation:
a Netpower 16P reports 183mb free (out of 256), and also failed to create the ramdisk, with the same message as the 64m ones;
"failure: too much memory requested for tmpfs/ramdisk"

another Netpower 16P with 199mb "free" successfully created the ramdisk with the same parameters

this is weird, as 128mb are clearly free

and also leads to my main question:
when ramdisk is created near boot-time (when ram is mostly free and unfragmented),
what would be the expected behahviour when system-ram usage grows, and the ramdisk already exists with "upto" 50% of ram, but is empty / near-empty?

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 7:05 am
by teslasystems
@guipoletto
It seems, that there is some "reserved" memory. My TILE router with 2 GB of RAM, goes to reboot with out-of-memory if free RAM goes down to about 150 MB.

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 5:40 pm
by eworm
yes, please make a ticket with details how to replicate, how many files you have, which file you removed etc.
Decided against. While this breaks my scripts, I can not find a really good reproducer. This drove me crazy - every time I though I am near it changed behavior. 🤪

Instead I modified my scripts. I bumped the required version to RouterOS 7.15 - the new code for directory creation (
/file/add type=directory name=$dir;
instead of
/file/add name=$dir/file; /file/add name=$dir/file;
) made it less likely to hit the issue. Also introduced a global function for removal - there I have a central point to catch and ignore the error. 🤪
The only downside is that stale files may be around... But as I put everything into a tmpfs this is not much of a concern - a reboot does clean up.

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 8:29 pm
by toxicfusion
This is RouterOS, not StorageOS. If you desire to add file management and make a NAS out of a router then just spinoff ROS into another branch that is developed separately. Storage device does not need BGP and MPLS and router/switch does not need NFS, Btrfs support, RAID, NVMe over TCP or fancy UI for collaborative file sharing. You already have strong base with basic networking, just cut unnecessary slack, integrate rose-storage into base and sell it as separate OS to be ran on new class of devices.

The naming of ROSE is also pretty poor, "RouterOS Enterprise" - 100% enterprise storage, 0% enterprise networking.

---
You can run Greylog or Grafana.
I wouldn't dare any more than you would dare to run it on Junos :> Possible? Yes, absolutely! Good idea? In hell.
I 1000% agree with you and echo this. MikroTik, please LISTEN -- Cut this bullshit with storage on RouterOS as a network appliance hardware used for routing. Move it to StorageOS and let it be a fork and then let people test the features.

Since RouterOS 7.17 with introduction of device-mode and then "ROSE", we're leaving MikroTik -- moving onto greener pastures. This is after 10+ years. Perhaps we have matured, but we cannot risk our company name and customer satisfaction.

Storage protocols do NOT belong on a router. SMB, NFS, NVME drivers, RAID, etc. WTF? Please STOP. We're done -- we will only use MikroTik for 60Ghz connectivity, that is the only current stable wireless product [besides Cube 60 water ingestion]. Perhaps when MikroTik restructures themselves and they also grow up -- we will circle back and become again interested. Focus should be on better web interface, Winbox development, CAPsMAN management [sync], dynamic routing fixes, or cloud management... get with the times. There are better products out there. MikroTik can be so much more in 2025 and stifle competition with better investment within themselves. Perhaps better leadership guidance?

MikroTik releasing "enterprise" hardware for consumer niche market to tinker. We enjoyed MikroTik when we could "route the world" and felt satisfaction.

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 9:48 pm
by teslasystems
@toxicfusion If you hate storage features so much, just don't install ROSE package and don't use any of these features, no one forces you to use them. And if you moved to other "better" solutions - what's you problem? Leave silently without posting this bullshit.

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 11:31 pm
by toxicfusion
network storage protocols dont belong on a router, or in this case RouterOS -- even if installed as an additional package. "enterprise my ass" [Apple joke]. This would be fine for an open source project - or for kid tinker toys. MikroTik putting "Tik in Tinker" as of lately.

Introducing storage protocols on a router, home lab or dev -- that then becomes someones office production network..... is horrifying. The security risks alone should make this be a completely separate operating system by Mikrotik. Some new IT intern or "Green" IT staff would see this as cost saving measure to do SMB on their MikroTik router and put into production.. scary.

MikroTik fork the project; create your bootable linux MikroTik operating system with basic TCP/IP stack and the ROSE package loaded. Otherwise, people just install real operating system to do the job. TrueNAS these days is child's play - just works. If MikroTik was to fork this project to create MikroTik NAS -- they better hire a better engineer or web designer. Winbox4 or the new Webfig is not going to cut it. Its a sad state.

I get the "appeal" for "all-in-one". But why...... Only makes sense for a hobbyist or home lab..... This serving production workloads or REAL workloads is laughable.

Even if there was a possibility to attach high speed storage [USB-C] via JBOD external enclosure -- there are better solutions.

Re: New exciting features for storage

Posted: Mon Feb 10, 2025 11:49 pm
by toxicfusion
Further -

I'd MUCH rather see continued development of containers on RouterOS. Other vendors do this, run containers. IE: Cisco has run containers on their hardware with great success. Also ARISTA... etc.

Or look at what Palo Alto does. Their management plane on completely separate partition and CPU [How you interact and commit changes], all else runs on other available CPU's and on the ASICS - data and control plane. Now this would be better investment in resources at MikroTik.

But yet MIkroTiks marketing team loves to "market" some of the CCR hardware as enterprise ready -- IMO there appears to be a shift happening right now with all that is broken and lack of focus. [Winbox4 is a mess, 7.17 device-mode]. We're still griping about having to physically touch customer deployed hardware. If we're having to make customer physically power cycle or we have to truck roll, we will just be replacing with other vendor.

Re: New exciting features for storage

Posted: Tue Feb 11, 2025 12:36 am
by guipoletto
network storage protocols dont belong on a router
So long as these features are modularized, i don't see the problem.

Re: New exciting features for storage

Posted: Tue Feb 11, 2025 8:13 pm
by toxicfusion
Ok -- but it is a waste of CPU cycles and processing power.... When can instead be used to process packets, and firewall rules. Not all the MikroTik switch chips are that great. As they dont all have real ASICS.

Storage technology/features does not belong on a router. Its for tinker, hobbyist, or homelab. MikroTik is uncertain of their identity. Are you enterprise, or are you home-lab? If you're both -- there needs to be a clear separation in product lines.

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 7:51 am
by noradtux
Why not be the one vendor that fits in home lab _and_ enterprise? For me it was exactly this how they even got noticed by us. First used in home lab, than slowly migrating into enterprise. Give users the choice, you don't need to run those features.

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 10:49 am
by eworm
yes, please make a ticket with details how to replicate, how many files you have, which file you removed etc.
Decided against. While this breaks my scripts, I can not find a really good reproducer. This drove me crazy - every time I though I am near it changed behavior. 🤪
As this still broke with my workarounds in place I digged deeper. I think I have a reproducer now... Please have a look at SUP-179200 for details. Thanks!

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 10:51 am
by normis
We found the issue you describe, it was triggered if the file was in a subdirectory, looks like the next release will have a fix

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 11:44 am
by eworm
Eagerly waiting for that then. 😊

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 1:16 pm
by teslasystems
What about issue with SMB that I desribed at the beginning?

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 1:29 pm
by normis
RouterOS file subsystem will soon have improvements for listing large amount of files, but normally you should not be using Winbox as a file manager. Use SMB to browse the files.

I did not fully understand, you also have issues with SMB listing, if Winbox is closed?

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 2:06 pm
by teslasystems
@normis, Listing is OK. But, it's consuming a lot of traffic even if WinBox is closed. No difference, if it's opened or closed. But even if it's opened, what is it doing? I'm not downloading any files from a share, just connected an SMB disk, it has quickly downloaded a list of 50 files and then it's eating 9 GB per hour for no reason.

Regarding large amount of files, I understand, that WinBox is not a file browser, but what will happen, if you have 100K files? Doesn't matter if it's SMB, or just a USB HDD. RouterOS is collecting a whole file structure and this will happen over and over again after each reboot. This is the key problem for using it with large amount of files.

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 10:47 pm
by sikkim87
Idea for a useful and interesting feature (which shouldn't be very difficult to implement); when a device has little RAM but enough storage (NAND, SATA, NVME or USB), it would be nice to have a native swap feature (like in standard Linux where a partition/file is used as a swap when RAM runs out)

/system disk add type=swap size=8192 file=/swapfile

I'm thinking of my RB1100 Dude which is rebooting me due to out of memory condition even though I have 256GB SATA SSD and 1GB RAM

PS : Yes, I know, I could migrate to CHR my Dude... but that's not what this post is.

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 10:55 pm
by eworm
The latest beta does have support for swap. 😉

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 11:06 pm
by guipoletto
The latest beta does have support for swap. 😉
Swap is evil, and in a ROUTER, largelly indicates device-abuse
exposing some swap for *containers*, and the applications hosted therein is one thing
if those crash, who cares.


but if the host-system (which is a ROUTER) is forced into swapping ,
then trough device-abuse and feature-creep it's no longer a router and the network topology needs to be reviewed... (or a beefier router with actual RAM needs to be purchased)

Re: New exciting features for storage

Posted: Wed Feb 12, 2025 11:35 pm
by sikkim87
That's right. I didn't see this subtle line in changelog 7.18 beta.- However, I'll wait for it to arrive in the stable channel.

Let's hope it also works for system processes (such as the Dude) as this suggests!

Thanks a lot! :)

PS: It's not really the debate whether a swap is good or not- I have a 2 year old device with 1GB of RAM. It was enough for Dude/RouterOS v6... Not enough anymore for RouterOS v7. I'm not going to throw away a $400 device, redundant power supply & with a level 6 license just because it no longer has enough RAM. Swap is a linux kernel feature that should (if possible) be implemented and - at the user's option - should be usable. In my opinion, it's a more interesting feature than DLNA. :)

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 9:31 am
by normis
The latest beta does have support for swap. 😉
Swap is evil, and in a ROUTER, largelly indicates device-abuse
exposing some swap for *containers*, and the applications hosted therein is one thing
if those crash, who cares.


but if the host-system (which is a ROUTER) is forced into swapping ,
then trough device-abuse and feature-creep it's no longer a router and the network topology needs to be reviewed... (or a beefier router with actual RAM needs to be purchased)
Swap is not for the host system. Please read the manual about it before complaining: https://help.mikrotik.com/docs/spaces/R ... -Swapspace

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 9:45 am
by ConradPino
Swap is not for the host system. Please read the manual about it before complaining: https://help.mikrotik.com/docs/spaces/R ... -Swapspace
@normis, thank you and please thank Druvis Timma for making that update Feb 07, 2025 10:17. IMO a super addition.

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 10:35 am
by eworm
We found the issue you describe, it was triggered if the file was in a subdirectory, looks like the next release will have a fix
This still happens with RouterOS 7.18beta6. Is that version supposed to have the fix?

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 11:07 am
by teslasystems
@normis,
Seems, I have found, what’s happening with SMB. I’ve captured SMB packets with WireShark and see, that RouterOS is reading the contents of each file (only first 256 KB). And this repeats again and again.

On the graph at the beginning of the topic, each peak is one reading cycle. I.e., RouterOS reads the contents (first 256 KB), then pauses for about 8 seconds; reads again, pauses for 8 seconds. And so on, cyclically. Moreover, it reads each file multiple times within the same cycle, usually 3 times in each cycle.

Thats why it’s consuming so much traffic. It’s not normal.

Duplicated this to SUP-158277.
.
SMB_Cap1.png
SMB_ScansPerCyle.png

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 5:13 pm
by optio
Swap is not for the host system. Please read the manual about it before complaining: https://help.mikrotik.com/docs/spaces/R ... -Swapspace
This is not how is mentioned in documentation:
... This is useful when using containers on RouterOS to be able to run containers that require much more RAM than you RouterOS device has. ...
It stated as "useful when using containers" - ROS will not go OOM if containers consume more memory than is physically available, but is still can confuse reader if for other system processes memory pages are swapped or not.
If is really dedicated only for containers, it should be stated like that, I guess then this is implemented with Linux kernel Per-cgroup swap file only for container ROS process.

Re: New exciting features for storage

Posted: Thu Feb 13, 2025 8:14 pm
by eider
Swap is not for the host system. Please read the manual about it before complaining: https://help.mikrotik.com/docs/spaces/R ... -Swapspace
Please explain how do you achieve separation of SWAP usage between host and containers, given that both share same kernel via namespaces and cgroups. For container to use SWAP this space must be physically present to kernel on host. Similarly, you can not adjust vm.swappiness value for container without affecting host.
If is really dedicated only for containers, it should be stated like that, I guess then this is implemented with Linux kernel Per-cgroup swap file only for container ROS process.
I don't see how this would work given ROS documentation since there is no ability to configure hard memory limit for container, just soft limit. There also does not seem to be any way to dedicate specific swapfile to given container, so this would exclude per-cgroup swapfile too. My best guess so far is that any SWAP created is simply attached to host and is shared with containers in same way host memory is.