Getting an “Out of memory” Nginx error when attempting to run Lancache on Raspberry Pi 3B
I have a Raspberry Pi 3B and want to run Lancache on it. I know the performance will not be very good as the Raspberry Pi only has Fast Ethernet and a mobile CPU.
The Docker image consists of three parts: Dnsmasq, Sniproxy and Nginx.
The first two are working fine, but Nginx exits with an error:
[alert] 1#1: mmap(MAP_ANON|MAP_SHARED, 268435456) failed (12: Out of memory)
The pi uses ~100MB ram from 940MB, so there shouldn't be a problem.
There is also enough disk space free.
What could be the reason for this error?
raspberry-pi nginx raspbian reverse-proxy memory-error
add a comment |
I have a Raspberry Pi 3B and want to run Lancache on it. I know the performance will not be very good as the Raspberry Pi only has Fast Ethernet and a mobile CPU.
The Docker image consists of three parts: Dnsmasq, Sniproxy and Nginx.
The first two are working fine, but Nginx exits with an error:
[alert] 1#1: mmap(MAP_ANON|MAP_SHARED, 268435456) failed (12: Out of memory)
The pi uses ~100MB ram from 940MB, so there shouldn't be a problem.
There is also enough disk space free.
What could be the reason for this error?
raspberry-pi nginx raspbian reverse-proxy memory-error
add a comment |
I have a Raspberry Pi 3B and want to run Lancache on it. I know the performance will not be very good as the Raspberry Pi only has Fast Ethernet and a mobile CPU.
The Docker image consists of three parts: Dnsmasq, Sniproxy and Nginx.
The first two are working fine, but Nginx exits with an error:
[alert] 1#1: mmap(MAP_ANON|MAP_SHARED, 268435456) failed (12: Out of memory)
The pi uses ~100MB ram from 940MB, so there shouldn't be a problem.
There is also enough disk space free.
What could be the reason for this error?
raspberry-pi nginx raspbian reverse-proxy memory-error
I have a Raspberry Pi 3B and want to run Lancache on it. I know the performance will not be very good as the Raspberry Pi only has Fast Ethernet and a mobile CPU.
The Docker image consists of three parts: Dnsmasq, Sniproxy and Nginx.
The first two are working fine, but Nginx exits with an error:
[alert] 1#1: mmap(MAP_ANON|MAP_SHARED, 268435456) failed (12: Out of memory)
The pi uses ~100MB ram from 940MB, so there shouldn't be a problem.
There is also enough disk space free.
What could be the reason for this error?
raspberry-pi nginx raspbian reverse-proxy memory-error
raspberry-pi nginx raspbian reverse-proxy memory-error
edited Jan 5 at 16:59
JakeGould
31.4k1096138
31.4k1096138
asked Jan 5 at 16:32
ComanderKai77ComanderKai77
82
82
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
When you look at the nginx configuration (data/conf/*.nginx.conf
) in this project, you will find the following lines:
proxy_cache_path /cache/arenanet keys_zone=arenanet:256m levels=1:2:2 inactive=365d;
This will result in nginx allocating 256 MiB (268435456 bytes) of memory to manage this cache. This is what fails.
Now, there are 13 of these statements, one for each service supported. In total, this requires 3.25 GiB of memory. That may add up to more than the 32-bit address space can deliver, with or without swap. It simply cannot work.
You need to either modify this configuration, reducing the size of the key cache (and thus the maximum amount of cached objects), or use a 64-bit operating system (luckily, the Pi 3 has a 64-bit CPU). Still, without real RAM to back these caches, things will be extremely slow.
add a comment |
One thing to try that I can think of is try increasing your swap space on your Raspberry Pi.
The swap file config is located at:
/etc/dphys-swapfile
The variable you're going to want to change is named "CONF_SWAPSIZE". It should have a default value of 100, try increasing it to 2048 (2GB) to see if it fixes your issue.
Here's a little script I made for increasing the swap size:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
To set the swap size back to normal:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Note that increasing your swap size is a good way to wear out your SD card, so this may not be the best solution for the long run.
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
add a comment |
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%2f1390932%2fgetting-an-out-of-memory-nginx-error-when-attempting-to-run-lancache-on-raspbe%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
When you look at the nginx configuration (data/conf/*.nginx.conf
) in this project, you will find the following lines:
proxy_cache_path /cache/arenanet keys_zone=arenanet:256m levels=1:2:2 inactive=365d;
This will result in nginx allocating 256 MiB (268435456 bytes) of memory to manage this cache. This is what fails.
Now, there are 13 of these statements, one for each service supported. In total, this requires 3.25 GiB of memory. That may add up to more than the 32-bit address space can deliver, with or without swap. It simply cannot work.
You need to either modify this configuration, reducing the size of the key cache (and thus the maximum amount of cached objects), or use a 64-bit operating system (luckily, the Pi 3 has a 64-bit CPU). Still, without real RAM to back these caches, things will be extremely slow.
add a comment |
When you look at the nginx configuration (data/conf/*.nginx.conf
) in this project, you will find the following lines:
proxy_cache_path /cache/arenanet keys_zone=arenanet:256m levels=1:2:2 inactive=365d;
This will result in nginx allocating 256 MiB (268435456 bytes) of memory to manage this cache. This is what fails.
Now, there are 13 of these statements, one for each service supported. In total, this requires 3.25 GiB of memory. That may add up to more than the 32-bit address space can deliver, with or without swap. It simply cannot work.
You need to either modify this configuration, reducing the size of the key cache (and thus the maximum amount of cached objects), or use a 64-bit operating system (luckily, the Pi 3 has a 64-bit CPU). Still, without real RAM to back these caches, things will be extremely slow.
add a comment |
When you look at the nginx configuration (data/conf/*.nginx.conf
) in this project, you will find the following lines:
proxy_cache_path /cache/arenanet keys_zone=arenanet:256m levels=1:2:2 inactive=365d;
This will result in nginx allocating 256 MiB (268435456 bytes) of memory to manage this cache. This is what fails.
Now, there are 13 of these statements, one for each service supported. In total, this requires 3.25 GiB of memory. That may add up to more than the 32-bit address space can deliver, with or without swap. It simply cannot work.
You need to either modify this configuration, reducing the size of the key cache (and thus the maximum amount of cached objects), or use a 64-bit operating system (luckily, the Pi 3 has a 64-bit CPU). Still, without real RAM to back these caches, things will be extremely slow.
When you look at the nginx configuration (data/conf/*.nginx.conf
) in this project, you will find the following lines:
proxy_cache_path /cache/arenanet keys_zone=arenanet:256m levels=1:2:2 inactive=365d;
This will result in nginx allocating 256 MiB (268435456 bytes) of memory to manage this cache. This is what fails.
Now, there are 13 of these statements, one for each service supported. In total, this requires 3.25 GiB of memory. That may add up to more than the 32-bit address space can deliver, with or without swap. It simply cannot work.
You need to either modify this configuration, reducing the size of the key cache (and thus the maximum amount of cached objects), or use a 64-bit operating system (luckily, the Pi 3 has a 64-bit CPU). Still, without real RAM to back these caches, things will be extremely slow.
edited Jan 6 at 11:18
answered Jan 5 at 19:26
Daniel BDaniel B
33.9k76387
33.9k76387
add a comment |
add a comment |
One thing to try that I can think of is try increasing your swap space on your Raspberry Pi.
The swap file config is located at:
/etc/dphys-swapfile
The variable you're going to want to change is named "CONF_SWAPSIZE". It should have a default value of 100, try increasing it to 2048 (2GB) to see if it fixes your issue.
Here's a little script I made for increasing the swap size:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
To set the swap size back to normal:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Note that increasing your swap size is a good way to wear out your SD card, so this may not be the best solution for the long run.
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
add a comment |
One thing to try that I can think of is try increasing your swap space on your Raspberry Pi.
The swap file config is located at:
/etc/dphys-swapfile
The variable you're going to want to change is named "CONF_SWAPSIZE". It should have a default value of 100, try increasing it to 2048 (2GB) to see if it fixes your issue.
Here's a little script I made for increasing the swap size:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
To set the swap size back to normal:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Note that increasing your swap size is a good way to wear out your SD card, so this may not be the best solution for the long run.
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
add a comment |
One thing to try that I can think of is try increasing your swap space on your Raspberry Pi.
The swap file config is located at:
/etc/dphys-swapfile
The variable you're going to want to change is named "CONF_SWAPSIZE". It should have a default value of 100, try increasing it to 2048 (2GB) to see if it fixes your issue.
Here's a little script I made for increasing the swap size:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
To set the swap size back to normal:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Note that increasing your swap size is a good way to wear out your SD card, so this may not be the best solution for the long run.
One thing to try that I can think of is try increasing your swap space on your Raspberry Pi.
The swap file config is located at:
/etc/dphys-swapfile
The variable you're going to want to change is named "CONF_SWAPSIZE". It should have a default value of 100, try increasing it to 2048 (2GB) to see if it fixes your issue.
Here's a little script I made for increasing the swap size:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
To set the swap size back to normal:
sudo sed -i -e 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Note that increasing your swap size is a good way to wear out your SD card, so this may not be the best solution for the long run.
answered Jan 5 at 18:50
snarpsnarp
111
111
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
add a comment |
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
I've tried it and nothing changed. The maximum memory usage is ~100MB and the Sawp is never in use.
– ComanderKai77
Jan 5 at 18:59
add a comment |
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%2f1390932%2fgetting-an-out-of-memory-nginx-error-when-attempting-to-run-lancache-on-raspbe%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