Server app unresponsive for several minutes after load

Hi there,

Today I have encountered a behaviour of the bokeh server which I have not seen before, and I hope the clever community here can help me solve. I should begin by saying that this doesn’t strike me as a bug in bokeh, but perhaps a bug in how I am handling the server.

I am working on a fairly small web app (some text, six or so plots, a small datatable, and an image embedded in a div tag, all split up over a few tab panels). I’m working in python 2.7, using bokeh 0.12.4, and have been running this app, in gradually increasing stages of completeness, for several months now.

I don’t claim that it’s very fast or optimised - in fact, I’m certain that it’s not! However, I don’t require ultra-fast operation, so this is usually fine. Today, though, things are very slow!

I launch my app using the following quite standard command line format, which has worked fine in the past.

bokeh serve scriptname.py --port XXXX --host XXX.X.X.X:XX --host domain_name:XX

When I open a connection to the server, my page appears in the browser, with all elements present and correct, in a reasonable amount of time. However, it is not responsive for up to several minutes after this. When I click on a button, for example, nothing happens at once; instead, I wait a few minutes, and then I see the button callback execute as expected (both in the browser, and at the command-line log).

Some things to note:

  1. If several button clicks are made during this hang-time, they all execute one after the other.
  2. Once the intial hang is complete, my interactions work exactly as expected, and everything executes in real time, with no problems.
  3. I am able to push from the server to the client during this hang time, just not the other way around. For example, I have a ‘start’ button for the app, which I have set up so that it is disabled when the document first loads (to encourage the user to read some introductory text). Then, I use a periodic callback to re-enable this button once X seconds have elapsed after the server connection was made. This periodic callback does execute during the hang time, and I can see the button change from disabled to enabled. However, if I click the re-enabled button (or any other button), the callback may not execute for another five minutes!
    I tried using chrome’s dev tools to diagnose what is going on in this hang time, and I attach some screenshots. I am not a web developer, and this is my first experience in using these tools, so any advice is welcome!!

However, what naively sticks out to me is the websocket, which I have highlighted in the screenshots. It always says ‘Connection Start: Stalled’, with a time (shown here) of 5.7 minutes. I have seen this value go up to 8 minutes! This ‘stalled’ time seems to correspond to the length of time that my page stays hung before it becomes responsive.

Can anyone advise whether a ‘Stalled’ websocket status would cause the behaviour I’m seeing? And if so, how to resolve it? Any advice would be gratefully appreciated.

In case it’s relevant, I should note: I attempted to update to bokeh 0.12.6 last night, but found that I couldn’t run my server as normal (unfortunately, I did not copy down the error I encountered, but it had to do with a missing or incorrect websocket_url). So, I reverted to 0.12.4.

I apologise if this is rather unclear, or tangential to the core functionality of bokeh; however, any advice would be greatly appreciated!

Thanks,

Sarah

I forgot to attach the screenshots. Please find here!

···

On Tuesday, July 25, 2017 at 4:08:26 PM UTC+10, Sarah Hegarty wrote:

Hi there,

Today I have encountered a behaviour of the bokeh server which I have not seen before, and I hope the clever community here can help me solve. I should begin by saying that this doesn’t strike me as a bug in bokeh, but perhaps a bug in how I am handling the server.

I am working on a fairly small web app (some text, six or so plots, a small datatable, and an image embedded in a div tag, all split up over a few tab panels). I’m working in python 2.7, using bokeh 0.12.4, and have been running this app, in gradually increasing stages of completeness, for several months now.

I don’t claim that it’s very fast or optimised - in fact, I’m certain that it’s not! However, I don’t require ultra-fast operation, so this is usually fine. Today, though, things are very slow!

I launch my app using the following quite standard command line format, which has worked fine in the past.

bokeh serve scriptname.py --port XXXX --host XXX.X.X.X:XX --host domain_name:XX

When I open a connection to the server, my page appears in the browser, with all elements present and correct, in a reasonable amount of time. However, it is not responsive for up to several minutes after this. When I click on a button, for example, nothing happens at once; instead, I wait a few minutes, and then I see the button callback execute as expected (both in the browser, and at the command-line log).

Some things to note:

  1. If several button clicks are made during this hang-time, they all execute one after the other.
  2. Once the intial hang is complete, my interactions work exactly as expected, and everything executes in real time, with no problems.
  3. I am able to push from the server to the client during this hang time, just not the other way around. For example, I have a ‘start’ button for the app, which I have set up so that it is disabled when the document first loads (to encourage the user to read some introductory text). Then, I use a periodic callback to re-enable this button once X seconds have elapsed after the server connection was made. This periodic callback does execute during the hang time, and I can see the button change from disabled to enabled. However, if I click the re-enabled button (or any other button), the callback may not execute for another five minutes!
    I tried using chrome’s dev tools to diagnose what is going on in this hang time, and I attach some screenshots. I am not a web developer, and this is my first experience in using these tools, so any advice is welcome!!

However, what naively sticks out to me is the websocket, which I have highlighted in the screenshots. It always says ‘Connection Start: Stalled’, with a time (shown here) of 5.7 minutes. I have seen this value go up to 8 minutes! This ‘stalled’ time seems to correspond to the length of time that my page stays hung before it becomes responsive.

Can anyone advise whether a ‘Stalled’ websocket status would cause the behaviour I’m seeing? And if so, how to resolve it? Any advice would be gratefully appreciated.

In case it’s relevant, I should note: I attempted to update to bokeh 0.12.6 last night, but found that I couldn’t run my server as normal (unfortunately, I did not copy down the error I encountered, but it had to do with a missing or incorrect websocket_url). So, I reverted to 0.12.4.

I apologise if this is rather unclear, or tangential to the core functionality of bokeh; however, any advice would be greatly appreciated!

Thanks,

Sarah

Hi,

Unfortunately I haven't seen or heard of anything like this. Are you using Tornado 4.5+ by any chance? If so you would need to downgrade Tornado (or upgrade Bokeh to 0.12.6). Tornado 4.5 introduced a change that made it incompatible with all version of Bokeh before 0.12.6. If that is not the problem, then it's going to be hard to suggest much concrete without code to reproduce the issue.

FWIW I should also mention I'd be more interested in figuring out any problems keeping you off 0.12.6 than diagnosing an old release.

Thanks,

Bryan

···

On Jul 25, 2017, at 01:15, Sarah Hegarty <[email protected]> wrote:

I forgot to attach the screenshots. Please find here!

On Tuesday, July 25, 2017 at 4:08:26 PM UTC+10, Sarah Hegarty wrote:
Hi there,

Today I have encountered a behaviour of the bokeh server which I have not seen before, and I hope the clever community here can help me solve. I should begin by saying that this doesn't strike me as a bug in bokeh, but perhaps a bug in how I am handling the server.

I am working on a fairly small web app (some text, six or so plots, a small datatable, and an image embedded in a div tag, all split up over a few tab panels). I'm working in python 2.7, using bokeh 0.12.4, and have been running this app, in gradually increasing stages of completeness, for several months now.

I don't claim that it's very fast or optimised - in fact, I'm certain that it's not! However, I don't require ultra-fast operation, so this is usually fine. Today, though, things are very slow!

I launch my app using the following quite standard command line format, which has worked fine in the past.

bokeh serve scriptname.py --port XXXX --host XXX.X.X.X:XX --host domain_name:XX

When I open a connection to the server, my page appears in the browser, with all elements present and correct, in a reasonable amount of time. However, it is not responsive for up to several minutes after this. When I click on a button, for example, nothing happens at once; instead, I wait a few minutes, and then I see the button callback execute as expected (both in the browser, and at the command-line log).

Some things to note:
  • If several button clicks are made during this hang-time, they all execute one after the other.
  • Once the intial hang is complete, my interactions work exactly as expected, and everything executes in real time, with no problems.
  • I am able to push from the server to the client during this hang time, just not the other way around. For example, I have a 'start' button for the app, which I have set up so that it is disabled when the document first loads (to encourage the user to read some introductory text). Then, I use a periodic callback to re-enable this button once X seconds have elapsed after the server connection was made. This periodic callback does execute during the hang time, and I can see the button change from disabled to enabled. However, if I click the re-enabled button (or any other button), the callback may not execute for another five minutes!
I tried using chrome's dev tools to diagnose what is going on in this hang time, and I attach some screenshots. I am not a web developer, and this is my first experience in using these tools, so any advice is welcome!!

However, what naively sticks out to me is the websocket, which I have highlighted in the screenshots. It always says 'Connection Start: Stalled', with a time (shown here) of 5.7 minutes. I have seen this value go up to 8 minutes! This 'stalled' time seems to correspond to the length of time that my page stays hung before it becomes responsive.

Can anyone advise whether a 'Stalled' websocket status would cause the behaviour I'm seeing? And if so, how to resolve it? Any advice would be gratefully appreciated.

In case it's relevant, I should note: I attempted to update to bokeh 0.12.6 last night, but found that I couldn't run my server as normal (unfortunately, I did not copy down the error I encountered, but it had to do with a missing or incorrect websocket_url). So, I reverted to 0.12.4.

I apologise if this is rather unclear, or tangential to the core functionality of bokeh; however, any advice would be greatly appreciated!

Thanks,
Sarah

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a2036843-776e-491e-88f8-290decf66037%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<overall.PNG><websock_frames.PNG><websock_headers.PNG><websock_timing.PNG>

Hi Bryan,

Thanks very much for your response!

My tornado is 4.4.1, so that should be alright.

I’ll note that there’s no real problems keeping me off 0.12.6 - I run 0.12.6 locally, and have been meaning to upgrade the old 0.12.4 installation on our server. However, when I did so, I found that pages didn’t display - instead, just a red ‘bokeh error’ box with the warning ‘missing websocket URL’.

I couldn’t find much explanation of what this value should be, and didn’t want to experiment too much before touching base with my admin.

If you can advise on a missing websocket URL error, that would be great! In the meantime time, I will do some more investigation, and try to put together a minimal working example to demonstrate the issue, and reply shortly

Many thanks,

Sarah

···

On 26 Jul 2017 00:12, “Bryan Van de ven” [email protected] wrote:

Hi,

Unfortunately I haven’t seen or heard of anything like this. Are you using Tornado 4.5+ by any chance? If so you would need to downgrade Tornado (or upgrade Bokeh to 0.12.6). Tornado 4.5 introduced a change that made it incompatible with all version of Bokeh before 0.12.6. If that is not the problem, then it’s going to be hard to suggest much concrete without code to reproduce the issue.

FWIW I should also mention I’d be more interested in figuring out any problems keeping you off 0.12.6 than diagnosing an old release.

Thanks,

Bryan

On Jul 25, 2017, at 01:15, Sarah Hegarty [email protected] wrote:

I forgot to attach the screenshots. Please find here!

On Tuesday, July 25, 2017 at 4:08:26 PM UTC+10, Sarah Hegarty wrote:

Hi there,

Today I have encountered a behaviour of the bokeh server which I have not seen before, and I hope the clever community here can help me solve. I should begin by saying that this doesn’t strike me as a bug in bokeh, but perhaps a bug in how I am handling the server.

I am working on a fairly small web app (some text, six or so plots, a small datatable, and an image embedded in a div tag, all split up over a few tab panels). I’m working in python 2.7, using bokeh 0.12.4, and have been running this app, in gradually increasing stages of completeness, for several months now.

I don’t claim that it’s very fast or optimised - in fact, I’m certain that it’s not! However, I don’t require ultra-fast operation, so this is usually fine. Today, though, things are very slow!

I launch my app using the following quite standard command line format, which has worked fine in the past.

bokeh serve scriptname.py --port XXXX --host XXX.X.X.X:XX --host domain_name:XX

When I open a connection to the server, my page appears in the browser, with all elements present and correct, in a reasonable amount of time. However, it is not responsive for up to several minutes after this. When I click on a button, for example, nothing happens at once; instead, I wait a few minutes, and then I see the button callback execute as expected (both in the browser, and at the command-line log).

Some things to note:

  • If several button clicks are made during this hang-time, they all execute one after the other.
  • Once the intial hang is complete, my interactions work exactly as expected, and everything executes in real time, with no problems.
  • I am able to push from the server to the client during this hang time, just not the other way around. For example, I have a 'start' button for the app, which I have set up so that it is disabled when the document first loads (to encourage the user to read some introductory text). Then, I use a periodic callback to re-enable this button once X seconds have elapsed after the server connection was made. This periodic callback does execute during the hang time, and I can see the button change from disabled to enabled. However, if I click the re-enabled button (or any other button), the callback may not execute for another five minutes!

I tried using chrome’s dev tools to diagnose what is going on in this hang time, and I attach some screenshots. I am not a web developer, and this is my first experience in using these tools, so any advice is welcome!!

However, what naively sticks out to me is the websocket, which I have highlighted in the screenshots. It always says ‘Connection Start: Stalled’, with a time (shown here) of 5.7 minutes. I have seen this value go up to 8 minutes! This ‘stalled’ time seems to correspond to the length of time that my page stays hung before it becomes responsive.

Can anyone advise whether a ‘Stalled’ websocket status would cause the behaviour I’m seeing? And if so, how to resolve it? Any advice would be gratefully appreciated.

In case it’s relevant, I should note: I attempted to update to bokeh 0.12.6 last night, but found that I couldn’t run my server as normal (unfortunately, I did not copy down the error I encountered, but it had to do with a missing or incorrect websocket_url). So, I reverted to 0.12.4.

I apologise if this is rather unclear, or tangential to the core functionality of bokeh; however, any advice would be greatly appreciated!

Thanks,

Sarah

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a2036843-776e-491e-88f8-290decf66037%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<overall.PNG><websock_frames.PNG><websock_headers.PNG><websock_timing.PNG>
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/749AC793-4825-4059-8390-221BF9F8E7E1%40continuum.io.