Skip to main content

Project kernels

Hex projects are powered by kernels that run your code and manage compute resources.

What is a kernel?

kernel is a core component of a computer's operating system. It acts as a bridge between the hardware and software, managing compute resources and providing essential services to other parts of the OS and applications.

A kernel is required for each active session of a Hex project, where a session can be:

Kernel status and actions

In the Notebook view, the Kernel Status indicator in the lower-right and the Kernel Actions menu next to it can help you monitor and manage the kernel powering your Notebook session.

Kernel status

Notebook kernels are started when you begin a Notebook session by running your project or by restarting your kernel. A yellow "Starting" status will be followed by a green "Running" status to indicate the kernel has started and is running.

Notebook kernels are stopped automatically if no cells are run for the duration of the idle timeout period. You can manually stop your kernel with the 'Stop' action in the Kernel Status menu. A yellow "Stopping" status will be followed by a red "Stopped" status.

warning

Closing your browser tab or navigating away from your project will not stop your kernel. If you are using an advanced compute profile, you should manually "Stop" your kernel when you are done working.

In some cases, your kernel status may display "Pending", meaning that your user has reached the 25 concurrent kernel limit and the project is waiting for a free kernel. This is most often due to running many projects using the Hex API.

Kernel actions

  • Restart will restart the kernel.
  • Restart and run all will restart the kernel and re-execute all cells in the project.
  • Run all without cached results will clear the project cache and re-execute all cells in the project using the current kernel.
  • Interrupt will cancel cell execution but will not stop the kernel.
  • Stop will stop the kernel, which terminates compute utilization and erases all stored variables.
  • Clear outputs will clear the outputs from all cells in the project. This action can be useful to free up memory in cases where a particular cell generated a very large output.
warning

Restarting or stopping the kernel will erase the stored value of all python variables. If you have irreplaceable data stored in a python variable that you know cannot be reproduced next time you run the app, you should save that somewhere before restarting or stopping the kernel.

Kernel timeouts

Idle timeout

Project kernels powering Notebook and App sessions will be stopped automatically after a certain amount of idle time. A kernel is considered idle when no cells are running.

  • Notebook session kernels have a default idle timeout of 1 hour, which can be adjusted per-project.
  • Published App session kernels have an idle timeout of 15 minutes, which cannot be changed.
  • Schedule run and API session kernels are stopped immediately after run completion.
info

Community tier is limited to a 5-minute idle timeout on Published App sessions.

Execution timeout

Project kernels are stopped automatically if a project run exceeds 24 hours of runtime. This means any "run" action must be able to execute all cells within 24 hours, or the kernel will timeout before the run completes.

Concurrent active kernel limit

A single Hex user can have a maximum of 25 concurrent kernels. If you hit this limit, you can manually stop kernels using the steps below. The following contribute to this limit:

  • Notebook sessions - attributed to whoever started the existing kernel, lasts until manually stopped or timing out
  • Scheduled run sessions - attributed to the project owner, stopped after scheduled run completes
  • Publish preview sessions - attributed to whoever initiates the publish event, lasts until run completes
  • API run sessions - attributed to the creator of the API token, stopped after run completes
info

Workspaces on a free trial or free Community tier may be subject to additional workspace-wide concurrent kernel limits. These limits help us to ensure an optimal experience for all Hex users. If you hit a workspace kernel limit, you can manually stop kernels, wait for kernels to stop, or upgrade to a paid plan.

Manually stopping active kernels

To make more kernels immediately available for your workspace or user, you can:

  • Stop active or idle Notebook kernels by clicking "Stop" from the Run all dropdown.
  • Stop active or idle published app kernels by clicking "Stop" from the More menu (3 dots) in the top right corner, or by closing the published app tab or browser window.