What's new

Is a USB swap file always recommended for merlin?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Code:
time -v
reports swaps and major page faults (that is, not when a page has to be swapped out, but when the kernel needs to swap it back in, and failing that, reloads it from the source), maybe by process. I wonder if there is a way to be running a debug scrip that records when a swap or major page fault occurs. Narrowing down what particular bit is triggering a swap?

Way out of my depth.
 
Last edited:
...
Technical reasons for why this works are, irrelevant.
...

All the technical reasons parroted so far, for not using it, are just so much 'blah, blah, blah', from my perspective.
...

Hmmm... Those seem like reactions from a person demonstrating a superficial understanding of software/computer engineering viewpoints. That's probably why the technical explanations looked like "blah, blah, blah" from your perspective. Moreover, you seem unable to keep the discussion fully & exclusively focused on the technical aspects of the topic at hand, and unable to keep your ego out of it.

Instead, you resorted to snarky, belittling, disparaging little comments interspersed between facile analysis/explanations, which ended up diminishing the value your reply may have had. In short, your knowledge & understanding of this subject matter may be miles wide, but only a couple of inches deep.

P.S.
By now you're probably feeling the need (perhaps even the urge) to post another reply with some more sarcastic, disparaging comments with a defensive or offensive posture (and perhaps both), mixed in with more simplistic arguments & platitudes. You'd probably say things like: "You don't know me at all" or "I have many years of experience doing..." or "You don't know what I think." And you might even be asking yourself whether or not it's worth a response. In any event, you've already shown your true colors, and this discussion here is unquestionably no longer worth my time.

C'est la vie, mate!
 
Folks, back on topic, or I will lock this thread. Enough with the bickering.
 
@Martinski, your assumptions are also incorrect about all the important points in your post above.

This isn't a hard concept to understand. I'm not disparaging anyone, I'm not being snarky. In unknown circumstances, the larger swap file allows the router to function as expected.

Nothing more, nothing less.

Yes, I'm not a programmer. But I can understand that the expected output may change by a smaller/larger swap file. Empirically. That also indicates to me that the programs/scripts and their interactions are not as fully understood as is being assumed here.

The definitions of a swap file, I'm not arguing. They just don't apply to what I'm saying. I'm sorry it is so hard to convey a simple idea to this group lately. But you may also try to understand me better, rather than just assume the worst (as your post above shows) about me and my skill set.
 
Not to discredit your thoughts in any kind of way here.

@Martinski, your assumptions are also incorrect about all the important points in your post above.

This isn't a hard concept to understand. I'm not disparaging anyone, I'm not being snarky. In unknown circumstances, the larger swap file allows the router to function as expected.

Nothing more, nothing less.

Yes, I'm not a programmer. But I can understand that the expected output may change by a smaller/larger swap file. Empirically. That also indicates to me that the programs/scripts and their interactions are not as fully understood as is being assumed here.

The definitions of a swap file, I'm not arguing. They just don't apply to what I'm saying. I'm sorry it is so hard to convey a simple idea to this group lately. But you may also try to understand me better, rather than just assume the worst (as your post above shows) about me and my skill set.

I also try to expand my understanding of what a swap and memory does.

Take a read at this:


Hopefully you won't just see it as dull teknical hoohaaa.
 
Take a read at this:
That was fascinating. Not so much the article you linked to, but the Red Hat article it linked to. It suggests that a larger swap file extends the time that a system is unresponsive before the OOM process kicks in to restore responsiveness, and recommends a swap file that is a fraction of physical memory. (I know they are not talking about little embedded devices here.)

Since I never want the router to be unresponsive just because a blocking list is being updated, this suggests some swap file may be desirable, but too much swap is undesirable.
 
That was fascinating. Not so much the article you linked to, but the Red Hat article it linked to. It suggests that a larger swap file extends the time that a system is unresponsive before the OOM process kicks in to restore responsiveness, and recommends a swap file that is a fraction of physical memory. (I know they are not talking about little embedded devices here.)

Since I never want the router to be unresponsive just because a blocking list is being updated, this suggests some swap file may be desirable, but too much swap is undesirable.
It also suggest that there is no real finite awnser since everyone(other meaning linux distros) has their own take on the matter. For example, "If you go by Red Hat’s suggestion, they recommend a swap size of 20% of RAM for modern systems."

Screenshot_20221005_123809.jpg

Screenshot_20221005_123955.jpg
 
Last edited:
That was fascinating. Not so much the article you linked to, but the Red Hat article it linked to. It suggests that a larger swap file extends the time that a system is unresponsive before the OOM process kicks in to restore responsiveness, and recommends a swap file that is a fraction of physical memory. (I know they are not talking about little embedded devices here.)

Since I never want the router to be unresponsive just because a blocking list is being updated, this suggests some swap file may be desirable, but too much swap is undesirable.
Here is CentOS , which I find more reasonable.

Screenshot_20221005_124135.jpg



Lastly, Ubuntu which takes into consideration of hibernating operating systems:

Screenshot_20221005_124344.jpg
 
Last edited:
So, I opened diversion and edited the whitelist file to add one entry, at a time when I had 50 mb of free space. That triggered a swap usage of 170kB. My swap file is 500mb and physical memory is 1GB. Then I processed an update to the blocking list (151,000 entries), which immediately increased my free space to 457mb and no swap usage.

Swapping in the first instance and not in the second surprised me.
 
So, I opened diversion and edited the whitelist file to add one entry, at a time when I had 50 mb of free space. That triggered a swap usage of 170kB. My swap file is 500mb and physical memory is 1GB. Then I processed an update to the blocking list (151,000 entries), which immediately increased my free space to 457mb and no swap usage.

Swapping in the first instance and not in the second surprised me.

Sounds like the specific use case called for something to be swapped when dealing with the whitelist.
 
Lastly, Ubuntu which takes into consideration of hibernating operating systems:

Screenshot_20221005_124344.jpg
Math is tough. I have exactly 1GB, so I am caught between a minimum of 1GB and a minimum of the square root of 1GB. While calculating that puts me to sleep, fortunately the router never sleeps.

The square root of 4GB is not 2GB. :)
 
Math is tough. I have exactly 1GB, so I am caught between a minimum of 1GB and a minimum of the square root of 1GB. While calculating that puts me to sleep, fortunately the router never sleeps.

The square root of 4GB is not 2GB. :)
Yeaaa, those people at Ubuntu land have always been trying to figure that one out.

But here is the last bit that @Martinski said about thrashing!

Screenshot_20221005_125814.jpg


Sounds like a band.... The Thrashers! -i.e. the 10GB swappers.
 
Last edited:
Yes, a more typical example and the specific example Red Hat was suggesting was a bad idea. Competitive instincts kicking in!
Per some of the forum scholars , the recommended SWAP math for 1GB of ram is

SWAP=(RAM+RAM)×5 (SSD is recommended.)

That is (1+1)×5=10.

Going by the original posters ram size, a 512MB router is used.
In this instance the math would look like

RAM x 20 = 10GB.

However, users do have the option to pick a smaller size on the list.

(Keep in mind the correct list reflects 2gb as the recommended swap.)

Screenshot_20221005_135304.jpg


I personally would go as far to say if 2GB wasn't enough, than 5GB might be acceptable. But keep in mind a swap that is of no use, should be considered of no use. That being said, I don't see any applications under normal or script use ever needing a full 10GB swap.
 
Last edited:
If you don't install any addon scripts (e.g. skynet, diversion, etc.) then there is no point in having a swap file as there would be nothing running on the router that would require it.
I support this statement. Even with AMTM, ENTWARE and NGINX webserver, I still have not even touched my "10GB" swap. Note I am also running resource hungry transmission, but I limit how many connections. However, none of the other user scripts are being ran on this platform.


1664995062169.png


In the last 15 hours my memory usage has roughly stayed the same. And I have yet to touch the 10GB swap.

1664994789015.png


Note this is using an SSD, and not the typical USB flashdrive. Also, I use it in USB3.0 mode.

Code:
RT-AX88U:/tmp/home/root# free
             total       used       free     shared    buffers     cached
Mem:        903544     466876     436668       4696      16464      92832
-/+ buffers/cache:     357580     545964
Swap:     10485756          0   10485756
 
I still have not even touched my "10GB" swap.

Indeed. I never managed to force swap use either. I would like to see an example/screen shot of... let's say 1GB swap used on an Asus router. Come on folks, give me something to play with on AX86U. :)
 
Indeed. I never managed to force swap use either. I would like to see an example/screen shot of... let's say 1GB swap used on an Asus router. Come on folks, give me something to play with on AX86U. :)

My AX88:
1665001866790.png
 
I actually managed to get to ~200MB swap used once, but the router crashed before I can get a screenshot.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top