increase execution time, lift cpu cap, updated docs
This commit is contained in:
parent
35ddde0106
commit
eec7ec26fa
|
@ -1,10 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#docker run --rm -it piston /usr/bin/python -V
|
|
||||||
#docker run --rm -it piston /usr/bin/python3 -V
|
|
||||||
#docker run --rm -it piston /usr/bin/ruby --version
|
|
||||||
#docker run --rm -it piston /usr/bin/nodejs --version
|
|
||||||
|
|
||||||
dir="$( cd "$( dirname "$0" )" && pwd )"
|
dir="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
@ -51,7 +46,6 @@ esac
|
||||||
docker run \
|
docker run \
|
||||||
-m 64m \
|
-m 64m \
|
||||||
--network none \
|
--network none \
|
||||||
--cpus=".2" \
|
|
||||||
--rm \
|
--rm \
|
||||||
--log-driver none \
|
--log-driver none \
|
||||||
-v $filepath:/$file:ro \
|
-v $filepath:/$file:ro \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
gcc -o binary -x c $1
|
gcc -o binary -x c $1
|
||||||
timeout -s KILL 2 ./binary
|
timeout -s KILL 3 ./binary
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
g++ -o binary -x c $1
|
g++ -o binary -x c $1
|
||||||
timeout -s KILL 2 ./binary
|
timeout -s KILL 3 ./binary
|
||||||
|
|
|
@ -6,4 +6,4 @@ go build $file
|
||||||
|
|
||||||
file=${file%%.*}
|
file=${file%%.*}
|
||||||
|
|
||||||
timeout -s KILL 2 ./$file
|
timeout -s KILL 3 ./$file
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
timeout -s KILL 2 nodejs $*
|
timeout -s KILL 3 nodejs $*
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
timeout -s KILL 2 python2 $*
|
timeout -s KILL 3 python2 $*
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
timeout -s KILL 2 python3.6 $*
|
timeout -s KILL 3 python3.6 $*
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
timeout -s KILL 2 ruby $*
|
timeout -s KILL 3 ruby $*
|
||||||
|
|
|
@ -38,7 +38,9 @@ various privilege escalation, denial-of-service, and resource saturation threats
|
||||||
#### Performance
|
#### Performance
|
||||||
One thing that needs investigation is how to spawn containers faster. The Docker daemon is synchronous in its
|
One thing that needs investigation is how to spawn containers faster. The Docker daemon is synchronous in its
|
||||||
container spawning. This means the bottleneck for code execution is how fast containers can start. Environments
|
container spawning. This means the bottleneck for code execution is how fast containers can start. Environments
|
||||||
vary, but, in ours they start at a rate of no more than 1 per second.
|
vary, but, in ours they start at a rate of no more than 1 per second. One possibility is Docker in Docker where by
|
||||||
|
X number of containers stay running all the time and then requests are delivered to each in a round robin and spawn
|
||||||
|
new Piston containers.
|
||||||
|
|
||||||
#### License
|
#### License
|
||||||
Piston is licensed under the MIT license.
|
Piston is licensed under the MIT license.
|
||||||
|
|
Loading…
Reference in New Issue