Joerg Krause
Joerg Krause

Reputation: 2179

MongoDb Performance on Raspberry Pi 2

I have MongoDb running in a NodeJS app using Monk on a Raspberry Pi 2 with raspbian.

While it behaves properly, the database access is stunningly slow.

I habe roughly 1.7 million documents in one table. I call simple values (last record according to a timestamp) and little more complex (aggregate 30 values). The app writes 2 new entries per second (permantly, it's sort of logging). The client asks for some values, 1-3 per second.

The very simple takes roughly 8 seconds, the little more complex 20 seconds. It does not change over time. CPU is under load, 30 to 75% permanently, I serve just one (1) client via WiFi.

When the results return, the values are correct.

Version information:

Question:

Is known that it's that slow on Raspberry 2 with > 1 mio records and 2-4 requests per second? Or is there something I could do?

The app is completely naive, very straight.

Upvotes: 1

Views: 2637

Answers (1)

ABeltramo
ABeltramo

Reputation: 195

When you look at performance in a Raspberry PI you have to take care of two important limitation:

  1. RAM: you have only 1GB of RAM on model 2. In your use case maybe the DB index is paginated from SD card and RAM.
  2. SD: you don't have a full Sata interface like a normal desktop PC. Read and write from SD is a lot slower than any normal HD. You could try with a higher class SD card.

Said that we can't make any more precise analysis without the details of DB, query and program. What you can do is to use "top" or any similar command to show the usage of RAM, the CPU load and the IO from disk.

Upvotes: 2

Related Questions