OpenWRT running out of memory
I have an OpenWRT router I set up many months ago. It's a TP-Link Archer C5 v1.20, which comes with 128M of RAM. Lately it's been running out of memory (logs show the OOM killer coming in). I installed rsyslog
to get remote logging, this is my rsyslog.conf
file:
module(load="imuxsock")
module(load="imklog")
module(load="imudp")
input(type="imudp" port="514")
#module(load="imtcp")
#input(type="imtcp" port="514")
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#*.info;mail.none;authpriv.none;cron.none /var/log/messages
#authpriv.* /var/log/secure
#mail.* /var/log/maillog
#cron.* /var/log/cron
#local7.* /var/log/boot.log
*.* @10.0.1.49:514
As you can see I've commented out all the local logs and just left the one that does remote logging.
I'm running htop
but the RES and SHR usage of all processes seems stable. My next thought was the RAMdisk (I did have that problem before, which led me to comment out all the local log files). However, disk usage also seems to be stable:
# ls -ld $(find / -mtime -1 -type f | egrep -v '/proc|/dev|/sys')
-rw------- 1 root root 2414 Dec 20 12:23 /overlay/upper/root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /overlay/upper/root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /overlay/upper/root/meminfo.new
-rw------- 1 root root 2414 Dec 20 12:23 /root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /root/meminfo.new
-rw-r--r-- 1 root root 568 Dec 21 11:33 /tmp/dhcp.leases
-rw-r--r-- 1 root root 5 Dec 21 10:45 /tmp/run/wifi-phy0.pid
-rw-r--r-- 1 root root 24 Dec 21 10:44 /tmp/state/dnsmasqsec
I did a cat /proc/meminfo|sort
, once shortly after booting up and then again after 20 minutes, so I could do a diff
. Here's the result:
# diff meminfo.base meminfo.new
1,4c1,4
< Active(anon): 2904 kB
< Active(file): 5164 kB
< Active: 8068 kB
< AnonPages: 2852 kB
---
> Active(anon): 2864 kB
> Active(file): 5252 kB
> Active: 8116 kB
> AnonPages: 2812 kB
7c7
< Cached: 7744 kB
---
> Cached: 7808 kB
9c9
< Committed_AS: 7120 kB
---
> Committed_AS: 6972 kB
12,13c12,13
< Inactive(file): 4372 kB
< Inactive: 4408 kB
---
> Inactive(file): 4348 kB
> Inactive: 4384 kB
15,17c15,17
< Mapped: 3168 kB
< MemAvailable: 64540 kB
< MemFree: 76508 kB
---
> Mapped: 3164 kB
> MemAvailable: 66524 kB
> MemFree: 78460 kB
21,23c21,23
< PageTables: 328 kB
< SReclaimable: 7484 kB
< SUnreclaim: 5528 kB
---
> PageTables: 320 kB
> SReclaimable: 7488 kB
> SUnreclaim: 5544 kB
25c25
< Slab: 13012 kB
---
> Slab: 13032 kB
However, this does not tell me much. Any ideas?
openwrt
add a comment |
I have an OpenWRT router I set up many months ago. It's a TP-Link Archer C5 v1.20, which comes with 128M of RAM. Lately it's been running out of memory (logs show the OOM killer coming in). I installed rsyslog
to get remote logging, this is my rsyslog.conf
file:
module(load="imuxsock")
module(load="imklog")
module(load="imudp")
input(type="imudp" port="514")
#module(load="imtcp")
#input(type="imtcp" port="514")
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#*.info;mail.none;authpriv.none;cron.none /var/log/messages
#authpriv.* /var/log/secure
#mail.* /var/log/maillog
#cron.* /var/log/cron
#local7.* /var/log/boot.log
*.* @10.0.1.49:514
As you can see I've commented out all the local logs and just left the one that does remote logging.
I'm running htop
but the RES and SHR usage of all processes seems stable. My next thought was the RAMdisk (I did have that problem before, which led me to comment out all the local log files). However, disk usage also seems to be stable:
# ls -ld $(find / -mtime -1 -type f | egrep -v '/proc|/dev|/sys')
-rw------- 1 root root 2414 Dec 20 12:23 /overlay/upper/root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /overlay/upper/root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /overlay/upper/root/meminfo.new
-rw------- 1 root root 2414 Dec 20 12:23 /root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /root/meminfo.new
-rw-r--r-- 1 root root 568 Dec 21 11:33 /tmp/dhcp.leases
-rw-r--r-- 1 root root 5 Dec 21 10:45 /tmp/run/wifi-phy0.pid
-rw-r--r-- 1 root root 24 Dec 21 10:44 /tmp/state/dnsmasqsec
I did a cat /proc/meminfo|sort
, once shortly after booting up and then again after 20 minutes, so I could do a diff
. Here's the result:
# diff meminfo.base meminfo.new
1,4c1,4
< Active(anon): 2904 kB
< Active(file): 5164 kB
< Active: 8068 kB
< AnonPages: 2852 kB
---
> Active(anon): 2864 kB
> Active(file): 5252 kB
> Active: 8116 kB
> AnonPages: 2812 kB
7c7
< Cached: 7744 kB
---
> Cached: 7808 kB
9c9
< Committed_AS: 7120 kB
---
> Committed_AS: 6972 kB
12,13c12,13
< Inactive(file): 4372 kB
< Inactive: 4408 kB
---
> Inactive(file): 4348 kB
> Inactive: 4384 kB
15,17c15,17
< Mapped: 3168 kB
< MemAvailable: 64540 kB
< MemFree: 76508 kB
---
> Mapped: 3164 kB
> MemAvailable: 66524 kB
> MemFree: 78460 kB
21,23c21,23
< PageTables: 328 kB
< SReclaimable: 7484 kB
< SUnreclaim: 5528 kB
---
> PageTables: 320 kB
> SReclaimable: 7488 kB
> SUnreclaim: 5544 kB
25c25
< Slab: 13012 kB
---
> Slab: 13032 kB
However, this does not tell me much. Any ideas?
openwrt
add a comment |
I have an OpenWRT router I set up many months ago. It's a TP-Link Archer C5 v1.20, which comes with 128M of RAM. Lately it's been running out of memory (logs show the OOM killer coming in). I installed rsyslog
to get remote logging, this is my rsyslog.conf
file:
module(load="imuxsock")
module(load="imklog")
module(load="imudp")
input(type="imudp" port="514")
#module(load="imtcp")
#input(type="imtcp" port="514")
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#*.info;mail.none;authpriv.none;cron.none /var/log/messages
#authpriv.* /var/log/secure
#mail.* /var/log/maillog
#cron.* /var/log/cron
#local7.* /var/log/boot.log
*.* @10.0.1.49:514
As you can see I've commented out all the local logs and just left the one that does remote logging.
I'm running htop
but the RES and SHR usage of all processes seems stable. My next thought was the RAMdisk (I did have that problem before, which led me to comment out all the local log files). However, disk usage also seems to be stable:
# ls -ld $(find / -mtime -1 -type f | egrep -v '/proc|/dev|/sys')
-rw------- 1 root root 2414 Dec 20 12:23 /overlay/upper/root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /overlay/upper/root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /overlay/upper/root/meminfo.new
-rw------- 1 root root 2414 Dec 20 12:23 /root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /root/meminfo.new
-rw-r--r-- 1 root root 568 Dec 21 11:33 /tmp/dhcp.leases
-rw-r--r-- 1 root root 5 Dec 21 10:45 /tmp/run/wifi-phy0.pid
-rw-r--r-- 1 root root 24 Dec 21 10:44 /tmp/state/dnsmasqsec
I did a cat /proc/meminfo|sort
, once shortly after booting up and then again after 20 minutes, so I could do a diff
. Here's the result:
# diff meminfo.base meminfo.new
1,4c1,4
< Active(anon): 2904 kB
< Active(file): 5164 kB
< Active: 8068 kB
< AnonPages: 2852 kB
---
> Active(anon): 2864 kB
> Active(file): 5252 kB
> Active: 8116 kB
> AnonPages: 2812 kB
7c7
< Cached: 7744 kB
---
> Cached: 7808 kB
9c9
< Committed_AS: 7120 kB
---
> Committed_AS: 6972 kB
12,13c12,13
< Inactive(file): 4372 kB
< Inactive: 4408 kB
---
> Inactive(file): 4348 kB
> Inactive: 4384 kB
15,17c15,17
< Mapped: 3168 kB
< MemAvailable: 64540 kB
< MemFree: 76508 kB
---
> Mapped: 3164 kB
> MemAvailable: 66524 kB
> MemFree: 78460 kB
21,23c21,23
< PageTables: 328 kB
< SReclaimable: 7484 kB
< SUnreclaim: 5528 kB
---
> PageTables: 320 kB
> SReclaimable: 7488 kB
> SUnreclaim: 5544 kB
25c25
< Slab: 13012 kB
---
> Slab: 13032 kB
However, this does not tell me much. Any ideas?
openwrt
I have an OpenWRT router I set up many months ago. It's a TP-Link Archer C5 v1.20, which comes with 128M of RAM. Lately it's been running out of memory (logs show the OOM killer coming in). I installed rsyslog
to get remote logging, this is my rsyslog.conf
file:
module(load="imuxsock")
module(load="imklog")
module(load="imudp")
input(type="imudp" port="514")
#module(load="imtcp")
#input(type="imtcp" port="514")
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#*.info;mail.none;authpriv.none;cron.none /var/log/messages
#authpriv.* /var/log/secure
#mail.* /var/log/maillog
#cron.* /var/log/cron
#local7.* /var/log/boot.log
*.* @10.0.1.49:514
As you can see I've commented out all the local logs and just left the one that does remote logging.
I'm running htop
but the RES and SHR usage of all processes seems stable. My next thought was the RAMdisk (I did have that problem before, which led me to comment out all the local log files). However, disk usage also seems to be stable:
# ls -ld $(find / -mtime -1 -type f | egrep -v '/proc|/dev|/sys')
-rw------- 1 root root 2414 Dec 20 12:23 /overlay/upper/root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /overlay/upper/root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /overlay/upper/root/meminfo.new
-rw------- 1 root root 2414 Dec 20 12:23 /root/.bash_history
-rw-r--r-- 1 root root 952 Dec 21 11:12 /root/meminfo.base
-rw-r--r-- 1 root root 952 Dec 21 11:31 /root/meminfo.new
-rw-r--r-- 1 root root 568 Dec 21 11:33 /tmp/dhcp.leases
-rw-r--r-- 1 root root 5 Dec 21 10:45 /tmp/run/wifi-phy0.pid
-rw-r--r-- 1 root root 24 Dec 21 10:44 /tmp/state/dnsmasqsec
I did a cat /proc/meminfo|sort
, once shortly after booting up and then again after 20 minutes, so I could do a diff
. Here's the result:
# diff meminfo.base meminfo.new
1,4c1,4
< Active(anon): 2904 kB
< Active(file): 5164 kB
< Active: 8068 kB
< AnonPages: 2852 kB
---
> Active(anon): 2864 kB
> Active(file): 5252 kB
> Active: 8116 kB
> AnonPages: 2812 kB
7c7
< Cached: 7744 kB
---
> Cached: 7808 kB
9c9
< Committed_AS: 7120 kB
---
> Committed_AS: 6972 kB
12,13c12,13
< Inactive(file): 4372 kB
< Inactive: 4408 kB
---
> Inactive(file): 4348 kB
> Inactive: 4384 kB
15,17c15,17
< Mapped: 3168 kB
< MemAvailable: 64540 kB
< MemFree: 76508 kB
---
> Mapped: 3164 kB
> MemAvailable: 66524 kB
> MemFree: 78460 kB
21,23c21,23
< PageTables: 328 kB
< SReclaimable: 7484 kB
< SUnreclaim: 5528 kB
---
> PageTables: 320 kB
> SReclaimable: 7488 kB
> SUnreclaim: 5544 kB
25c25
< Slab: 13012 kB
---
> Slab: 13032 kB
However, this does not tell me much. Any ideas?
openwrt
openwrt
asked Dec 21 '18 at 10:45
Mario CamouMario Camou
1012
1012
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1386612%2fopenwrt-running-out-of-memory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1386612%2fopenwrt-running-out-of-memory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown