What's new

How to test swap partition - Entware

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

amplatfus

Senior Member
Hi,

I have Entware installed on USB external drive with 2Gb swap file. Until now I never saw this partition used. I see it always like below with 0 used space:
Code:
root@ac:/tmp/home/root# free
             total         used         free       shared      buffers
Mem:        515308       249828       265480            0         1664
-/+ buffers:             248164       267144
Swap:      2097148            0      2097148
root@ac:/tmp/home/root#
Please, could you share some commands for terminal/ script in order to occupy internal RAM so that swap partition space start to be used?

Thank you so much!
 
Hi,

I have Entware installed on USB external drive with 2Gb swap file. Until now I never saw this partition used. I see it always like below with 0 used space:
Code:
root@ac:/tmp/home/root# free
             total         used         free       shared      buffers
Mem:        515308       249828       265480            0         1664
-/+ buffers:             248164       267144
Swap:      2097148            0      2097148
root@ac:/tmp/home/root#
Please, could you share some commands for terminal/ script in order to occupy internal RAM so that swap partition space start to be used?

Thank you so much!

Usually you want to avoid swapping...

but, there are some sysctl values like "/proc/sys/vm/swappiness" that could could change to "100".

Really though... don't do that...


Why do you have a swap anyway?
 
Usually you want to avoid swapping...

but, there are some sysctl values like "/proc/sys/vm/swappiness" that could could change to "100".

Really though... don't do that...


Why do you have a swap anyway?
If you follow the entware-ng install instructions over at HQT, there is an option to install various size of swap...... the recommendation for 2Gb swap was for for use with plex or similar as i recall.
After i installed netdata via entware i do see slight swap usage, however i didn't tweak any settings
Code:
tOmsK@RT-AC68U-4690:/jffs/scripts# free
             total         used         free       shared      buffers
Mem:        255700        90480       165220            0          844
-/+ buffers:              89636       166064
Swap:      2097148         6784      2090364
 
If you follow the entware-ng install instructions over at HQT, there is an option to install various size of swap...... the recommendation for 2Gb swap was for for use with plex or similar as i recall.

Simply because an option exists doesn't mean it's a good option.
 
If you follow the entware-ng install instructions over at HQT, there is an option to install various size of swap...... the recommendation for 2Gb swap was for for use with plex or similar as i recall.
After i installed netdata via entware i do see slight swap usage, however i didn't tweak any settings
Code:
tOmsK@RT-AC68U-4690:/jffs/scripts# free
             total         used         free       shared      buffers
Mem:        255700        90480       165220            0          844
-/+ buffers:              89636       166064
Swap:      2097148         6784      2090364
I didn't tweak any settings too. And I wan to see it used by the system. I turned on the webserver with php and mysql, turned on all I have on rooter and usage is still 0 (maybe because I still have free RAM).

I have tried this take it from Google but is not working: http://unix.stackexchange.com/questions/1367/how-to-test-swap-partition

Code:
sysctl vm.swappiness=100
Code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char** argv) {
   int max = -1;
   int mb = 0;
   char* buffer;

   if(argc > 1)
       max = atoi(argv[1]);

   while((buffer=malloc(1024*1024)) != NULL && mb != max) {
       memset(buffer, 0, 1024*1024);
       mb++;
       printf("Allocated %d MB\n", mb);
       sleep(1);
   }     
return 0;
}
Simply because an option exists doesn't mean it's a good option.
Yes, but when you have many services on it and less free RAM could be helpful.

Sent from my ONE A2003 using Tapatalk
 
Last edited:
Simply because an option exists doesn't mean it's a good option.
Im a self confessed simpleton when it comes to many aspects of linux. When an installer says "highly recommended" when it gets to the point of asking if i want a swap, then I'm going to assume that others more knowledgeable than me know better.
Does any aspect of the way asuswrt works make a swap file a bad idea?...i.e. do i stand to lose performance
 
Im a self confessed simpleton when it comes to many aspects of linux. When an installer says "highly recommended" when it gets to the point of asking if i want a swap, then I'm going to assume that others more knowledgeable than me know better.
Does any aspect of the way asuswrt works make a swap file a bad idea?...i.e. do i stand to lose performance

Swapping is usually bad.

Unless you have apps crashing because of lack of memory, then it's likely that you don't need a swap.

Performance increases are possible but unlikely. I'd be happy to hear of some examples where swapping increases AsusWRT's performance. I think some people mentioned that it keeps SMB or UPnP media-shares from crashing, but I can't remember any performance increases.

I guess you could consider an app "not crashing" a performance increase of sorts...
 

Similar threads

Sign Up For SNBForums Daily Digest

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