Discussion:
Feather: A very lightweight web service for Genode platforms.
Guido Witmond
2016-06-05 18:19:42 UTC
Permalink
Fellow Genodians,

At Heeselicht, I've been working on my web server. With all your help, I
got it working.

It's single threaded, slow as molassis and - after fixing some of my
null-pointer errors - now runs for more than 5 seconds.

Actually, it's quite stable. It has been running for a day and night
without hiccups.

However, it's slow, I get up to 1500 kB/s when serving a 1.4 MB file.
Short files (300 bytes) get served at 5.19 kB/s. So there is plenty of
room for improvement given the specs of the hardware.

The site:
- http://eccentric-authentication.org

Source code:
- github.com/gwitmond/feather

Platform:
- Fiasco.OC with kernel debugger enabled
- Genode 16.2 framework.

Hardware:
- HP ProLiant DL120 G6 (2011)
- Pentium G6950 @ 2.80GHz processor
- 4GB ECC RAM
- Network: on board Broadcom Nextreme BCM5723 with a 100Mb/s uplink
- No disk used, the site lives in a tar file loaded by grub at boot


It was a pleasure creating this, I hope someone might find it useful too.

With regards,

Guido Witmond.
Vasily A. Sartakov
2016-06-05 18:54:39 UTC
Permalink
Greetings.
Post by Guido Witmond
At Heeselicht, I've been working on my web server. With all your help, I
got it working.
It's single threaded, slow as molassis and - after fixing some of my
null-pointer errors - now runs for more than 5 seconds.
Actually, it's quite stable. It has been running for a day and night
without hiccups.
However, it's slow, I get up to 1500 kB/s when serving a 1.4 MB file.
Short files (300 bytes) get served at 5.19 kB/s. So there is plenty of
room for improvement given the specs of the hardware.
If you are interested, few years ago we have made some experiments with NGINX — famous lightweight web server. Performance of our port was reasonable as well as stability. Our out of date source code:

https://github.com/Ksys-labs/netz4mk
Post by Guido Witmond
- http://eccentric-authentication.org
- github.com/gwitmond/feather
- Fiasco.OC with kernel debugger enabled
- Genode 16.2 framework.
- HP ProLiant DL120 G6 (2011)
- 4GB ECC RAM
- Network: on board Broadcom Nextreme BCM5723 with a 100Mb/s uplink
- No disk used, the site lives in a tar file loaded by grub at boot
--
Vasily A. Sartakov
***@ksyslabs.org
Norman Feske
2016-06-06 10:00:02 UTC
Permalink
Hi Vasily.
Post by Vasily A. Sartakov
If you are interested, few years ago we have made some experiments
with NGINX — famous lightweight web server. Performance of our
port was reasonable as well as stability. Our out of date source
https://github.com/Ksys-labs/netz4mk
Cool!

Would you be fine with us moving it to the "Genode-World" repository?

https://github.com/genodelabs/genode-world

Cheers
Norman

- --
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Guido Witmond
2016-06-16 20:06:34 UTC
Permalink
Hi All,


A small update on my experiments:

- the site ran stable for about a week;

- but it got stuck on some interrupt [1]; perhaps a resource leak
somewhere. Are there known leaks in libc, vfs, lwip?

- it's not so slow as I thought it was as I was measuring it wrong. It
reaches half the speed of nginx on linux on that box.

- I get it to run on both FOC 64 and Nova 64 bit;

- with Nova, I don't see the serial console output, however, it serves
pages just as fast as FOC; any ideas how to configure it to get the Nova
console output?


According to my colo's power panel, it uses 12 watts more under FOC than
Linux. I've been looking at the cpufreq regulator that has been build
for arndale but not yet for x86. I've copied Stefan's Regulator driver
code to os/drivers/platform/spec/x86 but I lack the knowledge of the
hardware io-ranges, registers and such to implement a working version.
Who has some definitive docs on how to implement a simple power regulator.

Or is this power consumption because I run FOC with the kernel debugger
enabled?


My plans are to add a ssh-listener to allow for remote update of the web
site files.

Cheers,

Guido Witmond.

1:
CPU 0 [fffffffff00118c3]: IRQ ENTRY
CPU 1 [fffffffff003c7b2]: Maskable Interrupt

id cpu name pr sp wait to stack state
249 0 platform_ep 80 184 (1528) ready
240 0 irq_sig_recv 80 184 242* (1528) rcv_wait
238 0 signal handler 80 79 7b* (1032) rcv_wait
232 0 signal handler 80 ae (1032) ready
22c 0 signal handler 80 e3 e5* (1032) rcv_wait
226 0 signal handler 80 119 11b* (1032) rcv_wait
20a 0 signal handler 80 14d 14f* (1032) rcv_wait
1ff 0 signal handler 80 184 186* (1032) rcv_wait
1f4 0 timer_drv_ep 80 79 - (1528) rcv_wait
1ed 0 nic_drv_ep 80 ae 249 (1528) ready,rcv_wait
1e6 0 ep 80 e3 1e8* (1528) rcv_wait,fpu
1df 0 ep 80 119 1e1* (1528) rcv_wait
1d8 0 report_rom_ep 80 14d - (1528) rcv_wait
1bd 0 ep 80 184 1bf* (1528) rcv_wait
1ac 0 platform_drv 80 184 1bd (1528) rcv_wait
19d 0 platform_drv 80 39 - (1528) rcv_wait
177 0 acpi_report_rom 80 14d 179* (1528) rcv_wait
168 0 acpi_report_rom 80 39 - (1528) rcv_wait
140 0 acpi_drv 80 119 1df (1032) rcv_wait
132 0 acpi_drv 80 39 - (1528) rcv_wait
10c 0 feather 80 e3 1e6 (1032) rcv_wait
fd 0 feather 80 39 - (1528) rcv_wait
d5 0 nic_drv 80 ae 1ed (1528) rcv_wait
present list: (tid-sorted) <Space>=mode
<CR>=select
Alexander Boettcher
2016-06-17 08:51:47 UTC
Permalink
Hi,
Post by Guido Witmond
- with Nova, I don't see the serial console output, however, it serves
pages just as fast as FOC; any ideas how to configure it to get the Nova
console output?
please try to add the following patch (see steps below) to your foc
build directory and re-run. You should get some message of the form:

...
using comport xxx

L4 Bootstrapper
...

What does the comport is in your case ?

If it is 1,2,3 or 4 then the io_ports are 0x3f8, 02f8, 0x3e8, 0x2e8 -
otherwise the shown value is already the io_port.

The i/o port value you may add manually to the nova kernel in
contrib/nova-<hash>/src/kernel/nova/src/console_serial.cpp in
Console_serial(). Set "base" to your value and remove the if base statement.

Does it help ?

Cheers,

Alex.




Step 1: patch foc

In genode/contrib/foc-<hash>/src/kernel/foc apply the patch:

patch -p1 < foc.patch

Step 2: remove bootstrap code in foc build directory manually

rm -rf genode/build/<foc_x86_64/bootstrap

Step 3: rebuild your foc seetup and re-run
Guido Witmond
2016-06-22 07:17:00 UTC
Permalink
Post by Alexander Boettcher
Hi,
Post by Guido Witmond
- with Nova, I don't see the serial console output, however, it serves
pages just as fast as FOC; any ideas how to configure it to get the Nova
console output?
please try to add the following patch (see steps below) to your foc
...
using comport xxx
L4 Bootstrapper
...
What does the comport is in your case ?
Hi Alex,

I'm using comport 1 at 0x3f8. I've configured that port at Nova.
I do get a little output:

NOVA Microhypervisor v7-172fe0d (x86_64): May 28 2016 01:38:13 [gcc 4.9.2]
[ 0] CORE:0:0:0 6:25:5:1 [2] Intel(R) Pentium(R) CPU G6950 @ 2.80GHz
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)
[ 0] sys_assign_pci: Invalid Hint (0x2200)

Then it stays blank. But the server runs. I expect it to either change
baud rate from 115200 (correct) to something else, or it doesn't hand
the port to the LOG service.

Could you provide some hints as where to look?

Thanks, Guido.
Norman Feske
2016-06-22 09:18:00 UTC
Permalink
Hi Guido,
Post by Guido Witmond
Then it stays blank. But the server runs. I expect it to either change
baud rate from 115200 (correct) to something else, or it doesn't hand
the port to the LOG service.
Could you provide some hints as where to look?
Genode's core component reads the I/O-port information for the comport
from the BIOS data area (BDA). By default, it points to comport 0. If
the bender chain boot loader detects a PCI device with a comport, it
changes the port accordingly (see Section 7.7.3. "Log output on modern
PC hardware" in the manual [1]). Since your hardware uses a comport that
is neither comport 0 nor a port provided by a PCI card, it remains unused.

As a quick and dirty fix, you may manually hard-code the port at
'base-nova/src/include/base/internal/core_console.h' instead of
obtaining the port from the BDA.

[1] http://genode.org/documentation/genode-foundations-16-05.pdf

Cheers
Norman
--
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Guido Witmond
2016-06-22 20:36:16 UTC
Permalink
Hi Norman,
Post by Norman Feske
As a quick and dirty fix, you may manually hard-code the port at
'base-nova/src/include/base/internal/core_console.h' instead of
obtaining the port from the BDA.
The q&d solution works. Thanks.

Funny thing, browsing the site feels 'faster' on Nova but the benchmarks
show a lower maximum transfer rate of 1240 kB/s for Nova against 1500
for FOC.

But this is my totally unscientific benchmark :-)

Cheers, Guido.

Sebastian Sumpf
2016-06-17 09:02:12 UTC
Permalink
Hi,
Post by Guido Witmond
Hi All,
- the site ran stable for about a week;
- but it got stuck on some interrupt [1]; perhaps a resource leak
somewhere. Are there known leaks in libc, vfs, lwip?
- it's not so slow as I thought it was as I was measuring it wrong. It
reaches half the speed of nginx on linux on that box.
- I get it to run on both FOC 64 and Nova 64 bit;
- with Nova, I don't see the serial console output, however, it serves
pages just as fast as FOC; any ideas how to configure it to get the Nova
console output?
According to my colo's power panel, it uses 12 watts more under FOC than
Linux. I've been looking at the cpufreq regulator that has been build
for arndale but not yet for x86. I've copied Stefan's Regulator driver
code to os/drivers/platform/spec/x86 but I lack the knowledge of the
hardware io-ranges, registers and such to implement a working version.
Who has some definitive docs on how to implement a simple power regulator.
This is ARM and Exynos5 specific code, therefore it will not work at all
on x86 platforms. For x86 one would have to implement ACPI power
management and also per device driver support in order to safe some
watts here. So, please don't follow this path any further.

Sebastian
Post by Guido Witmond
Or is this power consumption because I run FOC with the kernel debugger
enabled?
My plans are to add a ssh-listener to allow for remote update of the web
site files.
Cheers,
Guido Witmond.
CPU 0 [fffffffff00118c3]: IRQ ENTRY
CPU 1 [fffffffff003c7b2]: Maskable Interrupt
id cpu name pr sp wait to stack state
249 0 platform_ep 80 184 (1528) ready
240 0 irq_sig_recv 80 184 242* (1528) rcv_wait
238 0 signal handler 80 79 7b* (1032) rcv_wait
232 0 signal handler 80 ae (1032) ready
22c 0 signal handler 80 e3 e5* (1032) rcv_wait
226 0 signal handler 80 119 11b* (1032) rcv_wait
20a 0 signal handler 80 14d 14f* (1032) rcv_wait
1ff 0 signal handler 80 184 186* (1032) rcv_wait
1f4 0 timer_drv_ep 80 79 - (1528) rcv_wait
1ed 0 nic_drv_ep 80 ae 249 (1528) ready,rcv_wait
1e6 0 ep 80 e3 1e8* (1528) rcv_wait,fpu
1df 0 ep 80 119 1e1* (1528) rcv_wait
1d8 0 report_rom_ep 80 14d - (1528) rcv_wait
1bd 0 ep 80 184 1bf* (1528) rcv_wait
1ac 0 platform_drv 80 184 1bd (1528) rcv_wait
19d 0 platform_drv 80 39 - (1528) rcv_wait
177 0 acpi_report_rom 80 14d 179* (1528) rcv_wait
168 0 acpi_report_rom 80 39 - (1528) rcv_wait
140 0 acpi_drv 80 119 1df (1032) rcv_wait
132 0 acpi_drv 80 39 - (1528) rcv_wait
10c 0 feather 80 e3 1e6 (1032) rcv_wait
fd 0 feather 80 39 - (1528) rcv_wait
d5 0 nic_drv 80 ae 1ed (1528) rcv_wait
present list: (tid-sorted) <Space>=mode
<CR>=select
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
genode-main mailing list
https://lists.sourceforge.net/lists/listinfo/genode-main
Loading...