Comments (3)
Hello @ShaneKilkelly,
thank you for bringing this up with the team!
There is already logic in place to prevent two compile requests from running in parallel on the same project/project+user directory 1. The other commands do not create new files and should be safe to run without any additional locking.
What's left is the creation and usage of container which need to be guarded from the container garbage collector. Note that #141 is important in this context. A parallel creation can be detected in the status code of 409
2, parallel calls on container.start
result in a 304
3 - there is no need for a lock here.
In order to support the switching of the texlive image and more broader container option changes, I would suggest to keep the suffix in the container name. A hash of the container options, but without the command now.
The command timeout and kill logic both need some tweaking to support the reuse of container.
The timeout is currently implemented in JS with a setTimeout
handler and a container.kill
call. We could use timeout(1)
from coreutils 4 instead. It signals a passed timeout with an exit code of 124
and forwards any exit codes on the happy route.
The kill logic is used only by the compile request? We could keep track of the Docker exec instance ID
5 which can be used to query the PID of the spawned process 6.
Now that I finished my studies - yay - my sharelatex setup is just under synthetic load and serving as a distributed system to experiment/work with. I will probably see no performance impact from this, but I will observe slightly better response times on paper 😉 and eventually notice it when working on the frontend/editor.
from clsi.
Hi! Thanks for doing the investigation on this, it's nice to see some concrete numbers!
We've had a quick discussion with the team and decided that the reason we didn't go for this pattern was that it would have it's own resource trade-offs (keeping containers alive in an idle-loop even while they're not necessarily active).
At the moment we have logic to re-use an existing container if it's present on the system, so the initial cold-start cost should only be paid rarely, and most actions should be relatively fast (as you've discovered).
Another thing that comes to mind, which would need to be investigated, is the kind of locking and synchronization logic that might need to be introduced to prevent overlapping commands from clobbering each other in the one container.
I think we'll park this for the time being and keep it in mind for optimizing our production load in the future. In the meantime, do you have a sense of how this would change the performance characteristics on your own system under normal workloads?
from clsi.
Hi!
Thank you for taking the time to write up this issue.
We are in the process of migrating to a monorepo at https://github.com/overleaf/overleaf and will mark this repository read-only soon.
You can read more about the monorepo migration at overleaf/overleaf#923.
We are going to close this issue now to avoid any confusion about the inability to comment further.
If you believe this issue still needs addressing, please create a new issue at https://github.com/overleaf/overleaf.
Thanks again!
from clsi.
Related Issues (20)
- Acceptance tests fail HOT 1
- A valid Gruntfile could not be found. HOT 5
- Internal Server Error - top level object should have a compile attribute HOT 5
- Compiling on Overleaf, but using favorite Desktop IDE? HOT 2
- Support pandoc HOT 2
- Can't compile tex files containing images HOT 1
- Support custom timezones HOT 6
- how to invoke LaTeX with the -shell-escape flag HOT 1
- [email protected] install fails on [email protected] HOT 2
- qpdf not installed HOT 1
- Timeout received while compiling document HOT 2
- sqlite error: "SQLITE_BUSY: database is locked" HOT 4
- Run clsi as revice fails with 'Headers already sent' HOT 5
- LuaTeX/ConTeXt Support HOT 3
- How to bind port 3013 to external IP,such as 0.0.0.0 ? HOT 2
- Smoke tests not compiled for Docker image in ho-dockerise branch HOT 2
- Failing compiling. Wrong pointer type HOT 1
- Hack: pandoc HOT 2
- Multiple issues in dependancies install HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clsi.