@cmkelley has made great points about the swap file size, as have others in different threads too.
So, why do I stick to my recommendation to have a 2GB swap file on the current crop of Asus routers?
As I have stated many times, I believe that our routers need a minimum of 2GB RAM, with 4GB or more even more optimal. Yes, there will be a lot of RAM free for most users, but Asus (and other manufacturers), let us upgrade the RAM if we want to!
On my RT-AX88U with a 2GB swap file and 1GB RAM, the free RAM has been as low as 16MB with almost 458MB of the swap file used. No slowdowns observed, no crashes, and after I rebooted (after another round of testing all the scripts I'm interested in), the free RAM was back to normal at around 28MB and the swap file at about 100MB.
The point of a swap file is 'catch' a crash and so far, 2GB is enough, even for me. Same reason I use a 256GB USB drive even if all the scripts + Entware are using just 0.17GB after 2 days uptime. Having extra storage is cheap, so I'd rather use it.
Even if amtm allowed for an
unlimited swap file size (yes, I know, that makes no sense), I might be pushing for 3 or 4GB sizes, but I know that is overkill on today's routers and the work they can and need to do today. Maybe some future router when we have multi-gig connections and the ports (all ports) on the routers to use them.
I'd rather have a (much) larger swap file go unused than a 'correctly' sized swap file that may not be enough in certain usage (to keep the router from crashing).
Of course, I have tried many different USB drives and have found one that works great with the RT-AX88U (and the RT-AC86U before too) in USB 3.0 mode in a USB 3.0 port, the Patriot Supersonic Rage Elite 256MB. When prices fall again or I find one on sale, I also want to try the same model in the 512GB capacity because it's even faster. But I'll have to see if it's faster in the RT-AX88U too.
I'll repeat again what a great router will be for me: a quad-core or better CPU, 4GB of RAM and more, and an SSD for both/all storage the router and I need. Until then, a 2GB swap file on a fast 256GB USB drive will have to do.
For the record, I had a horrible experience with a home-built pfSense box with Intel LAN (search the forum for more details). At default install values, it would just get slower and slower. Very 'over-built' with 16GB RAM and an i5 Intel CPU, the pfSense box failed miserably vs. any of the Asus routers I've owned.
Great hardware doesn't make a router great. But great firmware needs great hardware (more).