# Delay in cell execution... kinda?

**URL:** <https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287>\
**Category:** JupyterLab\
**Tags:** jupyterlab, help-wanted\
**Created:** [January 30, 2025, 9:18pm UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287 "2025-01-30T21:18:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastram-i](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/pastram-i/32/10583_2.png) [@pastram-i](https://discourse.jupyter.org/u/pastram-i)\
**Post date:** [January 30, 2025, 9:18pm UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287/1 "2025-01-30T21:18:15Z")

</div>

Running Z2JH via EKS on AWS with an EFS file structure. I’m not sure which of these, if any, would be relevant, but I’m willing to provide any other details that may be helpful here; I’m just a little unsure where to start.

Basically - it seems like cell execution has a delay before actually starting to run the code, and I can’t figure out why? See the gif. (Note - there’s no action for ~10 seconds, it may look like the gif freezes, but that’s just he nature of what we’re talking about here).  
 ![ScreenRecording2025-01-30144452](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/3X/7/9/7954081aaa1e55274c926e4d147b0021f35953d1.gif)

You can see when I run the cell, the result isn’t completed for ~10 seconds and yet the run time displayed is `in 3ms`. So it’s not like it ran but just took a while to run (extra load on the node or something), it just ‘held’ the job for a while?

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [January 31, 2025, 5:09pm UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287/2 "2025-01-31T17:09:34Z")

</div>

The timings are for how long it executed on kernel by default. Based on that, the delay might be on server or networking level.

---

<div class="post-metadata">

**Author:** ![pastram-i](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/pastram-i/32/10583_2.png) [@pastram-i](https://discourse.jupyter.org/u/pastram-i)\
**Post date:** [January 31, 2025, 5:20pm UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287/4 "2025-01-31T17:20:58Z")

</div>

Thanks @krassowski -

Is there anything you can recommend for me to investigate which, and in turn what can be done about it?

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [February 1, 2025, 9:05am UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287/5 "2025-02-01T09:05:52Z")

</div>

Running jupyter-server with `--debug` and observing the calls might help reveals something.

---

<div class="post-metadata">

**Author:** ![pastram-i](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/pastram-i/32/10583_2.png) [@pastram-i](https://discourse.jupyter.org/u/pastram-i)\
**Post date:** [February 3, 2025, 7:19pm UTC](https://discourse.jupyter.org/t/delay-in-cell-execution-kinda/32287/6 "2025-02-03T19:19:27Z")

</div>

Not seeing a whole lot that is pointing to anything obvious to me. It can be hard to catch perfectly, with the rest of the logs being spammed and toggling between the logs and execution, but I think I got one execution where nothing was printing when I hit execute and nothing printed until the execution (a “short” delay of ~2-4s).

There’s line’s that show `busy`/`idle`, but those don’t seem to be where the delay is (again, before these lines where nothing was printed.

(I don’t think the kernel UUID is sensitive, but I changed it to \<\> just to be safe since I don’t know)

```Bash
[D 2025-02-03 19:07:44.973 ServerApp] Checking user pastrami with scopes ['access:servers!server=pastrami/', 'read:users:groups!user=pastrami', 'read:users:name!user=pastrami'] against {'access:servers!server=pastrami/', 'access:servers!user=pastrami'}
[D 2025-02-03 19:07:44.973 ServerApp] Allowing user pastrami with scopes {'access:servers!server=pastrami/'}
[D 2025-02-03 19:07:49.774 ServerApp] activity on <>: execute_result
[D 2025-02-03 19:07:49.775 ServerApp] activity on <>: status (idle)
[D 2025-02-03 19:07:49.778 ServerApp] activity on <>: status (busy)
[D 2025-02-03 19:07:49.778 ServerApp] activity on <>: execute_input
[D 2025-02-03 19:07:49.780 ServerApp] activity on <>: status (idle)
[D 2025-02-03 19:07:49.897 ServerApp] activity on <>: status (busy)
[D 2025-02-03 19:07:49.928 ServerApp] activity on <>: execute_input
[D 2025-02-03 19:07:50.382 ServerApp] Checking user pastrami with scopes ['access:servers!server=pastrami/', 'read:users:groups!user=pastrami', 'read:users:name!user=pastrami'] against {'access:servers!server=pastrami/', 'access:servers!user=pastrami'}
[D 2025-02-03 19:07:50.382 ServerApp] Allowing user pastrami with scopes {'access:servers!server=pastrami/'}

```

Maybe there’s something else causing the delay that’s just not parsing logs? FWIW incase it matters - I ran `--debug` through the Z2JH yaml settings.

```yaml
...
singleuser:
  extraEnv:
    NOTEBOOK_ARGS: "--allow-root --debug"
...

```
