Discussion:
Running Freenet on an ARM based NAS
Kasper
2013-03-12 19:23:51 UTC
Permalink
Hello,

I just wanted to share my success in making Freenet run on my NAS,
which is ARM architecture using Oracles Embedded Java 7. It required
me to manually replace the wrapper with the latest version 3.5.17
binary (as ARM support was only introduced in 3.5.16 forward), but
this worked fine with the old freenet-ext.jar file. Then I changed
the wrapper.conf file to use SOCKET instead of PIPE, and that was all
it took to make it work - albeit very slowly. I then started work on
compiling libNativeThread & libjbigi for arm as well, and substituting
them in freenet-ext.jar (ugly hack, but I didn't wish to deal with
compiling all of freenet-ext.jar, as well as make it recognize my
processor, etc.), and this worked fine. On restart it used both libs
and ran noticably faster (despite only having a 2GHz Marvell ARM cpu
and 512Mb RAM).

Only real problem I have now is that libjcpuid apparently only exists
for x86 and I can't find the sources to try and compile it for ARM
myself (if even possible). I do not know if that's the reason it uses
too much CPU - between 90-100% at all times.

But I managed to get it working on this alternative architecture,
despite being rather new to both Linux and ARM, although with basic
understanding of programming and compiling. It would not take much to
make such support out of the box, as seen by my experiences, although
of course optimizing could be another matter. But I guess getting
freenet-ext.jar carved up in smaller parts would be a big help both
for tweaking, and official support. But I definitely see an advantage
in being available for ARM devices for a program that should ideally
run 24/7. If I could get lower CPU usage it would run 24/7 at my place
now. Any advise on configurations to tweak to try and lower it or
insights regarding whether I'm correct in suspecting the lack of
libjcpuid is why it's running full throttle all the time?

Regards
/Kasper
Matthew Toseland
2013-03-13 11:27:05 UTC
Permalink
Post by Kasper
Hello,
I just wanted to share my success in making Freenet run on my NAS,
which is ARM architecture using Oracles Embedded Java 7. It required
me to manually replace the wrapper with the latest version 3.5.17
binary (as ARM support was only introduced in 3.5.16 forward), but
this worked fine with the old freenet-ext.jar file. Then I changed
the wrapper.conf file to use SOCKET instead of PIPE,
I wonder why this is necessary? It works fine on x86-64 linux.
Post by Kasper
and that was all
it took to make it work - albeit very slowly. I then started work on
compiling libNativeThread & libjbigi for arm as well, and substituting
them in freenet-ext.jar (ugly hack, but I didn't wish to deal with
compiling all of freenet-ext.jar, as well as make it recognize my
processor, etc.), and this worked fine. On restart it used both libs
and ran noticably faster (despite only having a 2GHz Marvell ARM cpu
and 512Mb RAM).
Only real problem I have now is that libjcpuid apparently only exists
for x86 and I can't find the sources to try and compile it for ARM
myself (if even possible). I do not know if that's the reason it uses
too much CPU - between 90-100% at all times.
But I managed to get it working on this alternative architecture,
despite being rather new to both Linux and ARM, although with basic
understanding of programming and compiling. It would not take much to
make such support out of the box, as seen by my experiences, although
of course optimizing could be another matter. But I guess getting
freenet-ext.jar carved up in smaller parts would be a big help both
for tweaking, and official support. But I definitely see an advantage
in being available for ARM devices for a program that should ideally
run 24/7. If I could get lower CPU usage it would run 24/7 at my place
now. Any advise on configurations to tweak to try and lower it or
insights regarding whether I'm correct in suspecting the lack of
libjcpuid is why it's running full throttle all the time?
How much memory does the device have, and what is the memory limit set to? If the memory limit is too low you could easily see high CPU usage just from garbage collection.

Also are you doing any downloads?
Post by Kasper
Regards
/Kasper
Kasper
2013-03-13 11:45:31 UTC
Permalink
On Wed, Mar 13, 2013 at 12:27 PM, Matthew Toseland
Post by Matthew Toseland
Post by Kasper
Hello,
I just wanted to share my success in making Freenet run on my NAS,
which is ARM architecture using Oracles Embedded Java 7. It required
me to manually replace the wrapper with the latest version 3.5.17
binary (as ARM support was only introduced in 3.5.16 forward), but
this worked fine with the old freenet-ext.jar file. Then I changed
the wrapper.conf file to use SOCKET instead of PIPE,
I wonder why this is necessary? It works fine on x86-64 linux.
I'm unsure, but it could be due to the limited Linux distro running on
the device, perhaps? If I used pipe it gave me errors about
wrapper.port being undefined in the log.
Post by Matthew Toseland
Post by Kasper
Only real problem I have now is that libjcpuid apparently only exists
for x86 and I can't find the sources to try and compile it for ARM
myself (if even possible). I do not know if that's the reason it uses
too much CPU - between 90-100% at all times.
How much memory does the device have, and what is the memory limit set to? If the memory limit is too low you could easily see high CPU usage just from garbage collection.
Also are you doing any downloads?
That is likely the issue. The device only has 512MB ram + 512MB swap,
so I set max memory use to 192MB as a conservative estimate. I'll
tinker around a bit with more ram, but I'm aware the device is low on
RAM for running something like Freenet. It was/is a testbed for now.

No downloads, although it sees quite decent throughput just from what
other nodes send/receive through it having sent and received about 6GB
data total over the last 15 hours.
Matthew Toseland
2013-03-13 11:28:58 UTC
Permalink
Post by Kasper
Hello,
I just wanted to share my success in making Freenet run on my NAS,
which is ARM architecture using Oracles Embedded Java 7. It required
me to manually replace the wrapper with the latest version 3.5.17
binary (as ARM support was only introduced in 3.5.16 forward), but
this worked fine with the old freenet-ext.jar file. Then I changed
the wrapper.conf file to use SOCKET instead of PIPE, and that was all
it took to make it work - albeit very slowly. I then started work on
compiling libNativeThread & libjbigi for arm as well, and substituting
them in freenet-ext.jar (ugly hack, but I didn't wish to deal with
compiling all of freenet-ext.jar, as well as make it recognize my
processor, etc.), and this worked fine. On restart it used both libs
and ran noticably faster (despite only having a 2GHz Marvell ARM cpu
and 512Mb RAM).
Only real problem I have now is that libjcpuid apparently only exists
for x86 and I can't find the sources to try and compile it for ARM
myself (if even possible). I do not know if that's the reason it uses
too much CPU - between 90-100% at all times.
Does it manage to load the native version of libjbigi? IMHO the native thread library is probably most important in terms of interactive usability.
Post by Kasper
But I managed to get it working on this alternative architecture,
despite being rather new to both Linux and ARM, although with basic
understanding of programming and compiling. It would not take much to
make such support out of the box, as seen by my experiences, although
of course optimizing could be another matter. But I guess getting
freenet-ext.jar carved up in smaller parts would be a big help both
for tweaking, and official support. But I definitely see an advantage
in being available for ARM devices for a program that should ideally
run 24/7. If I could get lower CPU usage it would run 24/7 at my place
now. Any advise on configurations to tweak to try and lower it or
insights regarding whether I'm correct in suspecting the lack of
libjcpuid is why it's running full throttle all the time?
Yes, we should support it out of the box.
Kasper
2013-03-13 11:51:12 UTC
Permalink
On Wed, Mar 13, 2013 at 12:28 PM, Matthew Toseland
Post by Matthew Toseland
Post by Kasper
Only real problem I have now is that libjcpuid apparently only exists
for x86 and I can't find the sources to try and compile it for ARM
myself (if even possible). I do not know if that's the reason it uses
too much CPU - between 90-100% at all times.
Does it manage to load the native version of libjbigi? IMHO the native thread library is probably most important in terms of interactive usability.
Yes. It manages to load both the native version libjbigi and
libNativeThread, and I could really feel a difference in
responsiveness from compiling these as native, so I'd say you are
right they are most important for interactive usability.
Post by Matthew Toseland
Post by Kasper
But I managed to get it working on this alternative architecture,
despite being rather new to both Linux and ARM, although with basic
understanding of programming and compiling. It would not take much to
make such support out of the box, as seen by my experiences, although
of course optimizing could be another matter. But I guess getting
freenet-ext.jar carved up in smaller parts would be a big help both
for tweaking, and official support. But I definitely see an advantage
in being available for ARM devices for a program that should ideally
run 24/7. If I could get lower CPU usage it would run 24/7 at my place
now. Any advise on configurations to tweak to try and lower it or
insights regarding whether I'm correct in suspecting the lack of
libjcpuid is why it's running full throttle all the time?
Yes, we should support it out of the box.
Well I hope I can help even if just a little. If nothing else by
confirming how close you are... I really lack both the theoretical
foundation and programming skills to contribute much directly, but I'd
be happy to do what I can, which at this point is probably mostly
testing, and feedback unfortunately...

Loading...