On Thu, 05 Nov 2015 13:02:13 +0100,
Stefano Miccoli mo...@icloud.com wrote:
...
> Just a few numbers, collected with
> https://github.com/miccoli/pyownet/blob/master/test/timing.py
> <https://github.com/miccoli/pyownet/blob/master/test/timing.py> querying a
> non localhost production owserver

> pyownet: ver. 0.8.2
> proxy_obj: ownet server at ('10.48.74.112', 4304)
> server info: pid 2662, ver. unknown
> 
> timeit:
> statement: proxy_obj.dir("/")
> number: 20
> repetitions: 5
> 
> ** non persistent :  1.29 ms,  1.30 ms,  1.30 ms,  1.33 ms,  1.36 ms,
> ** persistent     :  0.77 ms,  0.77 ms,  0.79 ms,  0.80 ms,  0.97 ms,

> The figure reported here are time for a single call to the given method,
> computed as the average of 20 consecutive calls. (Please note that I read
> the cached temperature value? uncached is of course much slower, but this
> is due to 1-wire) 
 
 
I was surprised by the timing numbers you posted. So I tried your test script 
with my BBB installation...  

Running on the BBB with the owserver:
---
ubuntu@arm:~/Lpkg$ python3 StefanoTimingTest.py3
pyownet: ver. 0.8.2 (/usr/local/lib/python3.4/dist-packages/pyownet/__init__.py)
proxy_obj: ownet server at ('127.0.0.1', 4304)
server info: pid 1243, ver. unknown

timeit:
statement: proxy_obj.dir("/")
number: 20
repetitions: 5

** non persistent : 37.55 ms, 37.78 ms, 39.26 ms, 40.15 ms, 41.11 ms,
** persistent     : 36.22 ms, 36.41 ms, 36.62 ms, 37.10 ms, 38.26 ms,
---


Running Python on an external Windows machine, one Wi-Fi hop from the BBB:
---
C:\Users\Loren\Documents\Projects\Computing\BeagleBone Black\BBB 
Projects\1-Wire\OWFS Python logging>python StefanoTimingTest.py3 
owserver://10.1.1.4:4304
pyownet: ver. 0.8.2 (C:\Apps\Python33\lib\site-packages\pyownet\__init__.py)
proxy_obj: ownet server at ('10.1.1.4', 4304)
server info: pid 22210, ver. unknown

timeit:
statement: proxy_obj.dir("/")
number: 20
repetitions: 5

** non persistent : 41.69 ms, 45.79 ms, 45.99 ms, 48.34 ms, 49.41 ms,
** persistent     : 42.26 ms, 44.03 ms, 45.68 ms, 45.69 ms, 46.03 ms,
---


Between those two tests was a long learning session. For those who don't know...

In netstat, "0.0.0.0" addresses are accessible from outside machines, 127.0.0.1 
addresses are not!

The localhost setting is in (at least) two places in /etc/owfs.conf: 
! server: server = 10.1.1.4:4304  # localhost:4304 LA151105 allow net access
And: 
server: port = 4304  # localhost:4304  LA151105 allow net access

After making those changes, I found "restart" does not notice them! You have to 
use "force-reload":
ubuntu@arm:~/Lpkg$ sudo /etc/init.d/owserver force-reload
* Restarting 1-Wire TCP Server owserver

Suddenly it works from out on the network! 


So I wonder why persistence makes less than 10% difference here, while on your 
much faster machine it makes 25 to 40%...  

| Loren Amelang | lo...@pacific.net |




------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to