-
Notifications
You must be signed in to change notification settings - Fork 220
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
Decrease time spent waiting for compilation requests #457
Comments
As of right now, the load average is
The EC2 instance provided by Mozilla is 2x2.30GHz with 8GB of RAM, so it's not a tiny machine.
It's possible, but would require deeper digging to determine what the problem really is. For example, the alternate deployment (https://play.integer32.com/) has a load average of This may mean that the performance bottleneck is mostly centered around disk access. |
I've just run the playground on my machine (kind of beefy i7 with 32 gb of ram) and the hello world snippet takes ~1.3 secs, so I've reproduced the issue locally. I'll try to investigate |
It looks like the root cause is docker. Starting a temporary container takes ~1sec, regardless of the container and the command you run (try Only idea that comes to my mind is this.
Drawbacks are:
I'm not linux security expert but maybe the |
One possible solution to drawback 2 is to run |
I've tried and failed to implement the solution above.
Should you want to take a look at the diff, it's here ffissore@d181e9a |
FWIW, I think this is predicated on disk speed:
|
I'm going to reopen this just to keep track of ways of improving the speed; it's certainly something we'd like! |
Instead of this, I wonder if the Cargo.toml could be copied (foo-Cargo.toml) and then main file name in the new Cargo.toml changed (foo-main.rs). |
An alternative would be a pool of started servers that are started and idling, ready to go once they receive data. |
The pool approach makes sense. I'll give it a try |
After some experimentation, a couple of questions:
The problem with using shared docker containers is that whatever file a snippet creates stays in the container and it's possibly accessible by other users. With the current one-snippet <-> one-container approach, saving files is not a problem. If instead we do want to allow filesystem write access and we do care about not having user generated files around, then the shared container approach is a no-go. Unless we can replace the underlying fs implementation of rust with an in-memory one. Judging from https://github.com/rust-lang/rust/blob/master/src/libstd/sys/mod.rs#L25 the answer is no, but I'm new to rust |
Have you considered asking the community support in terms of mirroring the playground?
At the moment https://play.rust-lang.org/ takes about ~1.5 secs to compile and run a snippet. Could sharing the load across different VMs make it snappier?
The text was updated successfully, but these errors were encountered: