Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

HA implementation; bring back Dart+Kotlin support #25

Merged
merged 3 commits into from
Oct 3, 2019
Merged

Conversation

emidoots
Copy link
Member

@emidoots emidoots commented Oct 3, 2019

  • Improve stability greatly.
  • Bring back Dart and Kotlin support.
  • Upgrade to Rocket v0.4.
  • Peak memory required increases from 4 GiB previously to 6 GiB. Smaller deployments can specify WORKERS=1 and keep same memory usage but still have better stability.

See commit messages for further details.

Part of sourcegraph/sourcegraph#5406

Stephen Gutekanst added 3 commits October 2, 2019 21:47
This change makes syntect_server resilient to the two classes of problems we've
seen in production usage of it:

1. Some specific language grammar/file pairs can cause syntect to panic
   internally. This is usually because syntect doesn't implement a specific
   sublime-syntax feature in some way and it [panics instead of returning
   result types](trishume/syntect#98).

2. Much rarer, some specific language/grammar file pairs can cause syntect to
   get stuck in an infinite loop internally -- never to return and consuming an
   entire CPU core until it is restarted manually.

Previously we tried to solve #1 through stack unwinding (c5773da), but since
the 2nd issue above also appeared it proved to not be sufficient on its own.
It is still useful, though, because it can do per-request recovery of the first
failure scenario above and as such it will be added back in.

Even without stack unwinding, http-server-stabilizer helps both cases above by
running and monitoring replicas of syntect_server. See the README in
https://github.com/slimsag/http-server-stabilizer for details.

It is important to note that all this does is stop these individual file
failures from harming other requests to syntect_server. They are still issues
on their own, and logging and Prometheus monitoring is now in place for us to
identify when this is occurring and in which file it occurred so we can track
down the issue and make small reproduction cases to file and fix upstream.

Since only one instance of syntect_server was previously running and we now run
multiple, more memory is needed. Each instance requires about 1.1 GB at peak
(depending on which languages are used). The default is now to run 4 workers,
so 4.4 GB is the minimum required and 6 GB is suggested. In the event only one
worker is ran (via setting the env var `WORKERS=1`), stability is still greatly
improved since the 2nd failure case above can only last a short period of time
instead of until the container is restarted manually.

Part of sourcegraph/sourcegraph#5406
@emidoots emidoots merged commit 96e3f14 into master Oct 3, 2019
@emidoots emidoots deleted the sg/stabilizer branch October 3, 2019 04:56
@emidoots
Copy link
Member Author

emidoots commented Oct 3, 2019

Published as:

sourcegraph/syntect_server:96e3f14@sha256:f2b5eb5ef162f349e98d2d772955724b8f2b0bf2925797a049d3752953474a88

emidoots pushed a commit to sourcegraph/deploy-sourcegraph that referenced this pull request Oct 3, 2019
- This PR updates syntect-server to the new HA implementation which internally runs 4 workers.
- Each worker can at peak use ~1.1 GiB, so a 6G memory limit is now suggested.
- The number of workers can be tuned using the env var `WORKERS`. Setting it to `1` would retain the old resource requirements but still be more stable.
- For more details, see the first commit message in sourcegraph/syntect_server#25
emidoots pushed a commit to sourcegraph/deploy-sourcegraph that referenced this pull request Oct 4, 2019
#389)

* Update syntect-server to HA implementation (runs 4 workers internally)

- This PR updates syntect-server to the new HA implementation which internally runs 4 workers.
- Each worker can at peak use ~1.1 GiB, so a 6G memory limit is now suggested.
- The number of workers can be tuned using the env var `WORKERS`. Setting it to `1` would retain the old resource requirements but still be more stable.
- For more details, see the first commit message in sourcegraph/syntect_server#25

* Update syntect-server.Deployment.yaml
emidoots pushed a commit to sourcegraph/deploy-sourcegraph that referenced this pull request Oct 4, 2019
#389)

* Update syntect-server to HA implementation (runs 4 workers internally)

- This PR updates syntect-server to the new HA implementation which internally runs 4 workers.
- Each worker can at peak use ~1.1 GiB, so a 6G memory limit is now suggested.
- The number of workers can be tuned using the env var `WORKERS`. Setting it to `1` would retain the old resource requirements but still be more stable.
- For more details, see the first commit message in sourcegraph/syntect_server#25

* Update syntect-server.Deployment.yaml
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant