You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment variable will be override by command line arguments if they both present and all command line arguments have its correspond environment variable (e.g. `ES_HTTP_ADDR`). Run `go-judge --help` to see all the environment variable configurations.
661
661
662
-
####Build go judge
662
+
### Build go judge
663
663
664
664
Build by your own `docker build -t go-judge -f Dockerfile.exec .`
665
665
666
-
For cgroup v1, the `go-judge` need root privilege to create `cgroup`. Either creates sub-directory `/sys/fs/cgroup/cpuacct/go_judge`, `/sys/fs/cgroup/memory/go_judge`, `/sys/fs/cgroup/pids/go_judge` and make execution user readable or use `sudo` to run it.
667
-
668
-
For cgroup v2, systemd dbus will be used to create a transient scope for cgroup integration.
669
-
670
-
#### Build Shared object
666
+
### Build Shared object
671
667
672
668
Build container init `cinit`:
673
669
@@ -754,6 +750,14 @@ If a bind mount is specifying a target within the previous mounted one, please e
754
750
755
751
### Notice
756
752
753
+
#### cgroup usage
754
+
755
+
For cgroup v1, the `go-judge` need root privilege to create `cgroup`. Either creates sub-directory `/sys/fs/cgroup/cpuacct/gojudge`, `/sys/fs/cgroup/memory/gojudge`, `/sys/fs/cgroup/pids/gojudge` and make execution user readable or use `sudo` to run it.
756
+
757
+
For cgroup v2, systemd dbus will be used to create a transient scope for cgroup integration.
758
+
759
+
If no permission to create cgroup, the cgroup related limit will not be effective.
760
+
757
761
#### cgroup v2 support
758
762
759
763
The cgroup v2 is supported by `go-judge` now when running as root since more Linux distribution are enabling cgroup v2 by default (e.g. Ubuntu 21.10+, Fedora 31+). However, for kernel < 5.19, due to missing `memory.max_usage_in_bytes` in `memory` controller, the memory usage is now accounted by `maxrss` returned by `wait4` syscall. Thus, the memory usage appears higher than those who uses cgroup v1. For kernel >= 5.19, `memory.peak` is being used.
@@ -762,7 +766,7 @@ When running in containers, the `go-judge` will migrate all processed into `/api
762
766
763
767
When running in Linux distributions powered by `systemd`, the `go-judge` will contact `systemd` via `dbus` to create a transient scope as cgroup root.
764
768
765
-
When running with kernel >= 5.7, the `go-judge` will try faster `clone3(CLONE_INTO_CGROUP)` method.
769
+
When running with kernel >= 5.7, the `go-judge` will try faster `clone3(CLONE_INTO_CGROUP)`and `vfork`method.
766
770
767
771
#### Memory Usage
768
772
@@ -797,37 +801,3 @@ type =
797
801
```
798
802
799
803
Any incomplete / invalid message will be treated as error.
800
-
801
-
### Benchmark
802
-
803
-
By `wrk` with `t.lua`: `wrk -s t.lua -c 1 -t 1 -d 30s --latency http://localhost:5050/run`.
804
-
805
-
However, these results are not the real use cases since the running time depends on the actual program specifies in the request. Normally, the go judge consumes ~1ms more compare to running without sandbox.
0 commit comments