gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] How to get the best performance out of gpsd?


From: pisymbol .
Subject: Re: [gpsd-users] How to get the best performance out of gpsd?
Date: Thu, 15 Aug 2019 09:10:48 -0400



On Thu, Aug 15, 2019 at 7:24 AM pisymbol . <address@hidden> wrote:

So there were a couple of things I thought of:

1) The nmea_lock is contentious (I tried removing it just for S&G's and it did nothing to.help, pretty sure self.nmea.copy() is not thread safe anyway and I rarely rely on CPython implementation nuances).

2) the trimble.next() call is sometimes slow (recv() call from gps.py/read() sits there too long as the Trimble fills the socket buffer) in the gpsd client library. I didn't really think select I/O would be that faster since we are only dealing with one socket here?!

3) The system is overloaded so the scheduler just can't give this process enough time slice to keep up (hence why I tried the os.nice(-10))

4) The Trimble unit is not really emitting these sentences even close to 10Hz

5) I have a bug in my crappy code above. I sure hope so! Would make my life a lot less stressful.

Or I think what might be more lightly than all of the above is the sample() call is happening at irregular rates.

So for instance, let's define 'sample' as when a thread takes the latest sample and 'report' when my process updates its concept of the current NMEA via the gpsd/Trimble:

report: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
sample: {'lat': 41.671888994, 'time': 1565874479.3, 'lon': -93.718450699}
report: {'lat': 41.671889013, 'time': 1565874479.4, 'lon': -93.718450688}

It seems I have thundering herd of sample() calls which is causing me grief! :-(

-aps

reply via email to

[Prev in Thread] Current Thread [Next in Thread]