3

I have this app I'm developing and I thought of moving the VM I was using to real hardware. My Raspberry Pi 2 came to mind, a quad-core 900mhz ARM v7 with 1GB of ram. This hardware clocks at twice the speed I set my VM to run (a typical low end VPS equivalent) so it should be more than enough.

Installed Raspbian, nginx and the nodejs package from their repository using apt-get. Everything is super! But I noticed this distinct slowness when accessing the app. It's like a 7-10 sec pause before everything loads.

To test it further I installed full-fledged Node.js app called Tiddlywiki which I installed and used many times in the past. And it's true, there it was again that 7-10 sec delay when you refresh the page.

The app seems to run fine, POST and GET is instant once it's up and running in the Web Browser, but the delay is there if I refresh the page.

NOTE: If I restart the Pi and wait for it to restart the first time I access the app URL the delay seems to double, about 15 sec. Nginx html pages seem lightning fast in comparison.

Any thoughts on this?

unom
  • 11,438
  • 4
  • 34
  • 54
  • Probably down to the the SD card transfer speeds. Also don't forget that it's single threaded, and 900mhz ARM most likely won't meet the performance of 900mhz x86/64. – Ben Fortune Mar 16 '15 at 12:46
  • The microSD card is a UHS-1 with 75 mb/s read and 35 mb/s write, I agree it's not the same performance but why always the same delay? – unom Mar 16 '15 at 13:17
  • The SD card bus tops out at 20MB/s, so it could still very well be down to an IO bottleneck. – Ben Fortune Mar 16 '15 at 13:26
  • hmm... I don't know. Even if it's 20MB/s it should still load in under a second. I've run Node.JS apps on 15 year old computers. I still feel there is some kind of configuration issue. – unom Mar 16 '15 at 13:59
  • @BenFortune some benchmarks here: http://www.raspberrypi.org/benchmarking-raspberry-pi-2/ Edited the post. Actually timed the thing with a timer. Actual delay is 7-10 sec, no matter where I load from, local lan, my 3G phone or optical fiber at my office. – unom Mar 16 '15 at 14:48

1 Answers1

0

Apparently Node.JS apps are quite fast on the Raspberry Pi 2. The app I was test driving had and still has some weird behavior when using a password to encrypt content and starting the server with --password 12345678 made everything run very slow.

Running the app without a password is lightning fast.

PS. The app in question was Tiddlywiki, which can be run as a server for collaboration and such.

unom
  • 11,438
  • 4
  • 34
  • 54