轻量级Java HTTP 服务器 Virgo
树莓派上使用轻量Java服务器Virgo
Getting started
wget http://download.eclipse.org/virgo/release/VP/3.6.2.RELEASE/virgo-nano-3.6.2.RELEASE.zip
Unzip and run the bin/startup.sh
script.
Performance
启动速度
The first startup may take a couple of seconds longer, because an initial provisioning is being performed. For subsequent starts the startup time is between 20 and 30 seconds. Not great, but usually you start the server only once in a while.
[2014-02-18 07:48:43.094] startup-tracker Kernel starting. [2014-02-18 07:48:44.565] startup-tracker Kernel started. [2014-02-18 07:48:46.701] startup-readiness Virgo ready. Started for 24.520s.
Comparing this to the under 2 second startup on my 1.7 GHz Intel Core i7 processor, you may think that the Pi not quite up to the task. Things lighten up when you start using a deployed application. The simplest thing to start with is the built in admin console of Virgo.
访问速度
对于控制台页面:http://yourPiIpAddress:8080/admin
- Load time of the admin console overview page served by Raspberry Pi: 1.99 seconds.
- Load time of the admin console overview page served by an i7: 1.73s seconds.
The difference for serving this mostly static content is minimal. What I am most interested in is using the Pi as a server for mobile apps based on our Tabris framework, because this can allow you to use the Pi as a controller for various things with a state of the art mobile UI. So here come the performance numbers for the Tabris UI demo.
top - 10:16:30 up 2:33, 2 users, load average: 1.14, 1.29, 0.72 Tasks: 66 total, 1 running, 65 sleeping, 0 stopped, 0 zombie %Cpu(s): 68.3us, 3.3sy, 0.0ni, 26.8id, 0.0wa, 0.0hi, 1.6si KiB Mem: 448180 total, 182100 used, 266080 free, 10224 buffers KiB Swap: 102396 total, 0 used, 102396 free, 71076 cached PID USER VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2526 pi 1102m 80m 7908 S 69.0 18.4 8:32.39 java 2689 pi 4692 1420 1024 R 1.3 0.3 0:00.33 top
Response times for a sample of 5 highly interactive concurrent users show that the Pi can be a reasonable java application server in a home or even small business environment. While being pretty busy serving 6 requests per second the average response time of 371 milliseconds qualifies the Pi for a number of interesting tasks, stay tuned.