I get an error when I try to open my Amazon SageMaker Jupyter notebook in my browser.
Resolution
If you try to open a Jupyter notebook in your browser and get an error, then take the following actions:
- On the Amazon SageMaker console, confirm that the notebook instance status is InService. If the status is Pending, then the notebook instance isn't ready yet.
- Clear your browser cache, or try a different browser.
- Check the Jupyter logs for errors.
If you still can't open the Jupyter notebook, then restart the notebook instance. To keep notebook instance software updated, it's a best practice to regularly restart notebook instances. When you restart, the notebook instance moves to a new underlying host that helps resolve HTTP 503 and 504 errors in your browser.
Note: The /home/ec2-user/SageMaker file system is the only persistent storage on the notebook instance. When you restart, you lose all other data.
To restart a notebook instance, complete the following steps:
- Open the Amazon SageMaker console.
- In the navigation pane, choose Notebook instances.
- Select the circle next to the notebook instance name.
- Choose the Actions dropdown list, and then choose Stop.
- Wait for the notebook instance to reach the Stopped status.
- Choose the Actions dropdown list, and then choose Start.
- Open the notebook instance URL.
The following common issues can cause an overloaded notebook instance.
Too many open sessions
On the Jupyter dashboard, check the Running tab. When you have many active sessions and notebooks, notebooks take longer to load and might time out in the browser. To resolve this issue, shut down unnecessary notebook or terminal sessions.
High CPU or memory utilization
To check CPU or memory utilization, complete the following steps:
-
Open the Jupyter dashboard, and then choose the Files tab.
-
Choose New, and then choose Terminal.
-
Check memory utilization:
free -h
-
Check CPU utilization:
top
If CPU or memory utilization is high and you can't free up more resources, then switch to a larger notebook instance type.
Complete the following steps:
- Stop the notebook instance.
- Choose the Actions dropdown list, and then choose Update settings.
- Choose a new notebook instance type, and then choose Save.
Note: For a list of available instance types in each AWS Region, see Amazon SageMaker pricing.
- Choose the Actions dropdown list, and then choose Start.
- Open the notebook instance URL.
High disk utilization
To check disk utilization, complete the following steps:
-
Open the Jupyter dashboard, and then choose the Files tab.
-
Choose New, and then choose Terminal.
-
Start a shell session and check disk utilization:
df -h
-
Check the disk utilization for filesystem /home/ec2-user/SageMaker.
If disk utilization is high, then remove temporary files from the /home/ec2-user/SageMaker directory.
Or, complete the following steps to increase the Amazon Elastic Block Store (Amazon EBS) volume size:
- Stop the notebook instance.
- Choose the Actions dropdown list, and then choose Update settings.
- Enter a new volume size, and then choose Save.
Note: The default Amazon EBS volume size is 5 GB. You can increase the volume size up to 16 TB.
- Choose the Actions dropdown list, and then choose Start.
- Open the notebook instance URL.