-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/22/2015 10:10 AM, russ lyttle wrote:
> The "natural" language for the Raspberry PI is Python. For Arduino
> it is C++. I've confirmed that both PERL and Python drop too many
> messages when using my naif DB with sqlite3, R-PI model A, and Digi
> xbee s2 radios.

You didn't say how you structured things, and some details really matter.

Any kind of database that has durability will have to sync to storage
at various points, and that storage will be relatively very slow.  For
SQLite the default is for each statement to be its own transaction,
unless you explicitly manage transactions.  Consequently each insert
will block waiting on storage fsync.  There is tweaking you can do to
mitigate things, but we'd need to know more about what you are doing
and have done to provide advice.  Not doing anything about this will
provide dismal performance even on desktops.

The second part is about dropping messages.  Since you aren't using
real time operating systems, there will be variability in latency in
dealing with messages.  The usual solution is to put some sort of
queue/buffer between message ingestion and message processing to
smooth over the timing bumps.  It is generally a good idea to also
split that across multiple threads or processes so that priorities can
be managed.  Python's GIL is also very relevant.  For the RPi 1 with a
single core, it isn't going to matter too much, but the RPi 2 gets you
quad core.

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlTqKNAACgkQmOOfHg372QSPHQCdGj+SLu9ignj5BoI5S8L1WAjL
xQoAnjDXyKdRm38Tm9H5CQxQvPoB7Osg
=7/nt
-----END PGP SIGNATURE-----

Reply via email to