Hi all,
Attached is a simulator of our acquisition system. It only depends on standard modules so anyone should be able to test it.
As suggested by Bryan, the data streaming implementation is based on an embedded Bokeh server. The good news, is that the performance problem - which was at the origin of this post - seems to be solved. So it’s worth the effort to switch to the embedded server. Thanks for that Bryan.
However, I have (at least) one remaining problem with the new implementation. It’s related to a “too many open files” error I got after several restart of the server. Googling the web, it seems to be due to the fact that the connection between the browser and tornado is not properly closed. The error is tedious but simple to reproduce with the attached notebook:
Step-0: execute the 2nd cell of the notebook - you should obtain the following interface:
Step-1: click on the start (play icon) button to load the server and start the data stream
Step-2: (optionally) wait for some data to be delivered
Step-3: click on the close (cross icon) button to close everything and ‘destroy’ the server
Repeat the Step-1 → Step-3 sequence till the ‘too many open files’ error is raised (approx. 15 times on my system):
`INFO:bokeh.server.server:Starting Bokeh server version 0.12.4
WARNING:bokeh.server.server:Host wildcard ‘’ can expose the application to HTTP host header attacks. Host wildcard should only be used for testing purpose. WARNING:bokeh.server.server:Host wildcard '’ can expose the application to HTTP host header attacks. Host wildcard should only be used for testing purpose.
ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error.
INFO:root: Unfortunately, your original traceback can not be constructed.
Bokeh output already redirected to Jupyter notebook
starting Bokeh server…
Traceback (most recent call last):
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/ipywidgets/widgets/widget.py”, line 62, in call
local_value = callback(args, **kwargs)
File “”, line 390, in __on_start_clicked
self._data_streamer.start()
File “”, line 188, in start
self.__start_bokeh_server()
File “”, line 236, in __start_bokeh_server
allow_websocket_origin=[’’]
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/bokeh/server/server.py”, line 143, in init
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/bokeh/server/tornado.py”, line 265, in initialize
File “/Volumes/MacHD/anaconda/lib/python3.5/concurrent/futures/process.py”, line 395, in init
File “/Volumes/MacHD/anaconda/lib/python3.5/multiprocessing/context.py”, line 111, in SimpleQueue
File “/Volumes/MacHD/anaconda/lib/python3.5/multiprocessing/queues.py”, line 329, in init
File “/Volumes/MacHD/anaconda/lib/python3.5/multiprocessing/context.py”, line 66, in Lock
File “/Volumes/MacHD/anaconda/lib/python3.5/multiprocessing/synchronize.py”, line 163, in init
File “/Volumes/MacHD/anaconda/lib/python3.5/multiprocessing/synchronize.py”, line 60, in init
OSError: [Errno 24] Too many open files
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py”, line 1821, inshowtraceback
stb = value.render_traceback()
AttributeError: ‘OSError’ object has no attribute ‘render_traceback’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py”, line 1132, in get_records
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py”, line 313, in wrapped
File “/Volumes/MacHD/anaconda/lib/python3.5/site-packages/IPython/core/ultratb.py”, line 358, in_fixed_getinnerframes
File “/Volumes/MacHD/anaconda/lib/python3.5/inspect.py”, line 1453, in getinnerframes
File “/Volumes/MacHD/anaconda/lib/python3.5/inspect.py”, line 1410, in getframeinfo
File “/Volumes/MacHD/anaconda/lib/python3.5/inspect.py”, line 672, in getsourcefile
File “/Volumes/MacHD/anaconda/lib/python3.5/inspect.py”, line 701, in getmodule
File “/Volumes/MacHD/anaconda/lib/python3.5/inspect.py”, line 685, in getabsfile
File “/Volumes/MacHD/anaconda/lib/python3.5/posixpath.py”, line 361, in abspath
OSError: [Errno 24] Too many open files
`
BTW, is it possible to disable the tornado log? It 'pollutes' the cell with messages which are a bit meaningless for our end users.
Thanks.
EmbedBokehServer.ipynb (19.6 KB)