● $35 $25
● 1 GB Ram
● 900 MHz Quadcore ARM CPU (overclockable)
● HDMI
● 4x USB
● Micro USB power
● Audio Jack
● Camera Interface
● Network
● GPIO
● Micro SD
What Is It?
● 2A power adapter
● USB Keyboard
● USB Mouse
● MicroSD card
● An operating system
● HDMI display
● Wifi or Ethernet hookup
● LED-adorned hat (optional)
You also want/need…
#!/bin/sh
# Get current system memory max and usage, in that order
mem_system=`free -m | grep Mem: | gawk '{print $2,$3}'`
# Start by getting the pid of the largest java process
java_pid=`top -b -n 1|awk '{if ($1~/[0-9]+/) {if ($5~/m/)
{$5=int($5*1024*1024)};print}}'|sort -k5rn,5 | grep java
| head -n1 | gawk '{print $1}'`
# Get the actual heap usage
mem_heap=`jstat -gc $java_pid | tail -n 1 | gawk '{print
($1+$2+$5+$7+$9)/1000,($3+$4+$6+$8+$10)/1000}'`
Adding Memory Usage
Performance test parameters
● No overclocking
● Bumped heap size to 768 MB
● Simple page with #now()# output
● Use CLI load tool call “Siege”
● Started with 1 thread and increased to 100 threads
How fast does this baby go?
#!/bin/bash
url="http://192.168.1.xxx/bench/"
reqs=5000
NUMS="1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100"
for NUM in $NUMS
do
RPS=`siege -r $((reqs/NUM)) -c $NUM "$url" 2>&1 | grep "Transaction
rate:" | awk '{print $3}'`
echo -e "$NUMt$RPS"
done
How fast does this baby go?
GPIO
(General Purpose Input Output)
● Cobbler (breakout) board
● Solderless Breadboard
● Red LED
● 330 Ohm resistor
● Hook in series between
digital pin and ground
Pi4J
● Java-based library for interacting with GPIO pins
● Wraps “native” JNI calls to C library
● Easy to use from CFML!
Yum!!
CommandBox REPL + Pi4J =
Blinky Blinky LED
// Have you tried turning it
// off and back on again?
LED.low()
LED.high()
// Toggle the current state
LED.toggle()
// On and back off once
LED.pulse( 2000 )
What’s Next?
● Interactive projects (control from web)
● Clustered Pis (CFML, Couchbase, etc)
● Home Automation
● CFGPIO library
● What will you build?