What's new

Regularly flush caches. What is this? On or Off?

  • 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!

Ryan_C

Occasional Visitor
Hi all,

I apologize if this has been discussed here before. I couldn't find much information about this anywhere. I only remember I have read someone (couldn't find that thread now) said disable this function would increase performance, which agrees to the explanation in the firmware. But I was confused. What's point of having more free RAM if it's not for performance? Can someone explain what this function really achieve? Should I keep it on of off?

My router is a TM-AC1900 running Merlin 380.69_Beta 1. Thank you!
 
The router stores connection information in cache (RAM) for quick retrieval. It's faster and means RAM cache usage will grow/shrink automatically for Linux and nothing to worry about.

Some time back in the day around Merlin v378.56 some people complained (alot of people actually) that a minor change Merlin made to prefer caching instead of flushing caused the amount of RAM in use to grow - some people were upset about it - when in fact it's harmless and just Linux doing what it should be doing.

You can enable/disable this behavior when you select 'regularly flush cache'. The amount of RAM in use will be lower after flushing, with a slight penalty in milliseconds for every new connection not found in cache due to flushing.

In my opinion you should prefer to let the kernel manage cache, and do not flush, for optimum performance.
Asus flushes buffers by default for some reason. When I added the option to disable that behavior, I got flooded by "OMG my router is running out of memory" complains. So I got tired of it and now default to Asus's behavior.

Sent from my Nexus 9 using Tapatalk
 
In my opinion you should prefer to let the kernel manage cache, and do not flush, for optimum performance.
+1

It can also have some visible side effects if you enable the flush.....such as attached USB disks that have spun down now spinning up just by accessing the router gui...
 
The router stores connection information in cache (RAM) for quick retrieval. It's faster and means RAM cache usage will grow/shrink automatically for Linux and nothing to worry about.

Some time back in the day around Merlin v378.56 some people complained (alot of people actually) that a minor change Merlin made to prefer caching instead of flushing caused the amount of RAM in use to grow - some people were upset about it - when in fact it's harmless and just Linux doing what it should be doing.

You can enable/disable this behavior when you select 'regularly flush cache'. The amount of RAM in use will be lower after flushing, with a slight penalty in milliseconds for every new connection not found in cache due to flushing.

In my opinion you should prefer to let the kernel manage cache, and do not flush, for optimum performance.
Thanks a lot! Great insight there!!

A couple follow up questions -
1) Does that mean the performance penalty of flushing is only related to new connections (like quicker to recognize and connect clients?)?
2) After disabling the flush, my RAM usage could get up to 80%+ while doing some FTP file transferring and that % stays there even when the transfer was complete. I was wondering if there gonna be any problem with the high RAM usage. So I intentionally "stress tested" it by connecting all my clients and streaming 4K video on several devices, and transferring large files at same time. No matter what I did, I couldn't get the RAM usage to go over 90%, even though CPU is close to 100% in this case. My question is how possible to ran the RAM to 100% on this router? And what could go wrong if that happens??

Thanks again!
 
Last edited:
I would agree with @appleseed 's conclusion although I think he is in error when he says "Regularly flush caches" relates to connection information. The amount of memory used by connection tracking is fairly trivial anyway.

As far as I can see from the source code this option is calling the free_caches() function which in turn is using the kernel drop_caches. This functions frees up memory used by the pagecache and/or dentries and inodes. So this is predominately about freeing memory used when reading and writing to filesystems. This would be things like disk scans, Samba/FTP shares or the media server.

It's interesting to note that the kernel.org entry says:
Use of this file can cause performance problems. Since it discards cached objects, it may cost a significant amount of I/O and CPU to recreate the dropped objects, especially if they were under heavy use. Because of this, use outside of a testing or debugging environment is not recommended.
Obviously that statement must be read in the context that we are talking about a router with limited RAM and not a server.

So in answer to @Ryan_C 's question 1), I don't believe this setting has any bearing on the speed of network connections.
 
Last edited:
Is this feature still available in Merlin FWs? I can't find it in 384.9 on my AC86U.
 
Don’t mean to resurrect a old thread, but I’m having an issue with the current build in which over WiFi my Roku starts buffering continuously. After several attempts to trouble shoot it. I noticed the only fix is power cycle the r7000. What are my options here on a script that doesn’t interrupt the connection or a command to enable cache clearing, or whatever anyone else that have a solution.

Next Q is script to check wan, compare send email if different. No to using DDNS method. No to header read. I want something much faster. (Will search forum for this solution. Unless someone can hot link prior thread or script.
 
Don’t mean to resurrect a old thread, but I’m having an issue with the current build in which over WiFi my Roku starts buffering continuously. After several attempts to trouble shoot it. I noticed the only fix is power cycle the r7000. What are my options here on a script that doesn’t interrupt the connection or a command to enable cache clearing, or whatever anyone else that have a solution.
Merlin doesn't make firmware for non-Asus routers.

 
Ok, well this site says otherwise and I have never had a problem till now the latest. I will flash it back. There are articles all over the net on flashing ac1900’s to merlins. Even inside Merlin you can click on the Merlin support and it takes you to Netgear.
 
Ok, well this site says otherwise and I have never had a problem till now the latest. I will flash it back. There are articles all over the net on flashing ac1900’s to merlins. Even inside Merlin you can click on the Merlin support and it takes you to Netgear.
That firmware was not made by Merlin and is an illegal port by XVortex. Any links you find within it that go to Netgear sites will have been put there by XVortex.
 
Thank you. I feel pretty foolish. I’ll just 30-30-30 this one and flash it back to Netgear firmware. Then go order a Rapture, or something on the top end. Haven’t done side by side benchmark check. Well I guess I need to start with making sure what all is supported and actually on the Merlin site. I really like Merlin Firmware. I’m sorry I broke TOS. I just googled Merlin firmware for r7000 ac1900. I should of been more careful. I didn’t care for The limitations in Netgear firmware and I’m not to fond of DDWRT after I left Linksys. I have a stack of them. They (ddwrt) seem to put a lot of settings that are not relevant, but it makes it look superior because “it has more”. :rolleyes: Sorry again for breaking TOS. Thanks for the guidance. I understand if you have to ban me for breaking TOS. I just ask for it to be temporarily. I’ve learned my lesson but I also know TOS shall be enforced.
 
⚠ warning ⚠ don’t be dumb and install this XVortex guys build like I did. You won’t be able to remove it and rollback
@King_Fisher#187

FYI The definitive list of Merlin supported routers is on his website: https://www.asuswrt-merlin.net/about

He doesn't support the Asus GT- (aka Rapture) models.
Thank You.

I searched the net roll to default, it won’t even rollback a version. I even tried to brick this router. I cannot do either. I tried everything that I came across even if there were subtle changes. It will not even reset the settings. You can reset it to set it up again but it will keep your prior port forwarding, routing table, MAC addresses. Only thing you can do is change the Type, SSID, Login, passwords for both login and wireless. I downloaded utilities to try to flash it. I sure paid the price of not researching that they were not related. I’m going to contact Netgear today but I read multiple places they will not assist me. Im going to try to get a hold of this XVortex and see if he will help if they don’t. Then I’m going to tell him what a pos he is regardless of the source code is online.
 
⚠ warning ⚠ don’t be dumb and install this X V o r t e x guys build like I did. You won’t be able to remove it and rollback

Thank You.

I searched the net roll to default, it won’t even rollback a version. I even tried to brick this router. I cannot do either. I tried everything that I came across even if there were subtle changes. It will not even reset the settings. You can reset it to set it up again but it will keep your prior port forwarding, routing table, MAC addresses. Only thing you can do is change the Type, SSID, Login, passwords for both login and wireless. I downloaded utilities to try to flash it. I sure paid the price of not researching that they were not related. I’m going to contact Netgear today but I read multiple places they will not assist me. Im going to try to get a hold of this XVortex and see if he will help if they don’t. Then I’m going to tell him what a pos he is regardless of the source code is online.
Use revert to stock fw.
 

Sign Up For SNBForums Daily Digest

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