Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduced the time for the autosaveInterval from 120sec to 5sec #16893

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Maduflavins
Copy link

References

Code changes

User-facing changes

Backwards-incompatible changes

issue number

#16892

Code changes

changed the autosaveInterval default time from 120secs to 5ecs and updated all defaults to match the new default.

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

…d imports same from the constant file to replace hardcoded scenarios
…d imports same from the constant file to replace hardcoded scenarios
@echarles
Copy link
Member

Is 5s not too low with a risk of putting down the network and server with too many requests if many users are constantly typing?

@Maduflavins
Copy link
Author

Is 5s not too low with a risk of putting down the network and server with too many requests if many users are constantly typing?
you raised a valid point, what time would you suggest?

@echarles
Copy link
Member

you raised a valid point, what time would you suggest?

Difficult to say without real benchmarks. TBH I find 1 minute a good tradeoff, but that is something that I would prefer seeing confirmed in real, as getting more feedbacks from the community.

@Maduflavins
Copy link
Author

you raised a valid point, what time would you suggest?

Difficult to say without real benchmarks. TBH I find 1 minute a good tradeoff, but that is something that I would prefer seeing confirmed in real, as getting more feedbacks from the community.

okay, let's see what the rest of the team suggest

@JasonWeill
Copy link
Contributor

@echarles A five-second timeout would produce, at the very most, 12 "save" command executions per minute per user. Realistically, because it only triggers 5 seconds after the most recent edit, we would see a lot fewer than this. What metrics would we need to collect to determine the impact of saving a file on server performance?

@Maduflavins
Copy link
Author

you raised a valid point, what time would you suggest?

Difficult to say without real benchmarks. TBH I find 1 minute a good tradeoff, but that is something that I would prefer seeing confirmed in real, as getting more feedbacks from the community.

@echarles did you take a look at @JasonWeill comment?

@echarles
Copy link
Member

What metrics would we need to collect to determine the impact of saving a file on server performance?

I would take the biggest notebook you have ever work with, go to a place with a 2 bars wifi and see what it gives.

@krassowski
Copy link
Member

Working with notebooks on remote deployments I often see long delays for save operation (2-5 seconds) because my notebooks can include large visualisations and often are 20-50 MB in size (panel/holoviz dumping all their assets in the outputs are one culprit, SVG publication-quality visualisations are another). Even though I have ultra fast broadband at home the remote Jupyter Hubs often have limited capability to receive data (and upload is usually slower than download).

For example, in the UK the average upload speed is 18,4Mbps (2.3 MB/s). This means that a notebook with 50 MB takes 21s to upload for save (disregarding overheads). I think it is reasonable to change the save interval to once a minute or once every 30 seconds but I agree that once every 5 seconds is not a reasonable value for software which is often deployed on remote cloud or in HPC behind multiple hops of ssh.

I would however be open to having a different default for localhost users. This is if frontend sees that the URL is localhost it could default to 5s.

@echarles
Copy link
Member

echarles commented Nov 5, 2024

I would however be open to having a different default for localhost users. This is if frontend sees that the URL is localhost it could default to 5s.

Running the server on localhost will not always imply that the content is served from localhost, see #16744

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the consensus is that 5 seconds is not the ideal default. Also, the tests are failing due to invalid relative import. Both things should be easy to fix :)

@@ -54,7 +54,7 @@ import { ISignal, Signal } from '@lumino/signaling';
import { Widget } from '@lumino/widgets';
import * as React from 'react';
import { recentsManagerPlugin } from './recents';

import { DEFAULT_AUTOSAVE_INTERVAL } from '../../../notebook/constants';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import like will not work. It should import from @jupyterlab/notebook/lib/constants instead, although lib imports are best avoided.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay noted will change the 5 seconds to 10 seconds then

@krassowski
Copy link
Member

Given the findings in #17017 I think this could be only considered if also making sure that notebooks that have not changed do not trigger auto-save.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce default autosave timeout
4 participants