Skip to content

Commit 257bc50

Browse files
authored
Update README.md
1 parent 7f954d4 commit 257bc50

1 file changed

Lines changed: 41 additions & 10 deletions

File tree

README.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ An SLEdgeScale serverless function consists of a shared library (\*.so) and a JS
8282

8383
### Start the SLEdgeScale Server
8484
We need to export some environment variables before start the server. The commonly used environment variables are:
85+
8586
`SLEDGE_DISABLE_PREEMPTION`: Disables the timer that sends a SIGALRM signal every 5 ms for preemption. Must disable in SLEdgeScale.
87+
8688
`SLEDGE_DISPATCHER`: Specifies the dispatcher policy. There are seven types of dispatchers:
8789
- SHINJUKU: Requests are enqueued to each dispatcher's typed queue.
8890
- EDF_INTERRUPT: The dispatcher policy used by SLEdgeScale.
@@ -92,27 +94,56 @@ We need to export some environment variables before start the server. The common
9294
- RR: The dispatcher selects a worker in a round-robin fashion.
9395
- JSQ: The dispatcher selects the worker with the shortest queue to enqueue a request.
9496

95-
`SLEDGE_DISABLE_GET_REQUESTS_FROM_GQ`: Disable workers fetching requests from the global queue. Must be disabled if the dispatcher policy is not set to TO_GLOBAL_QUEUE.
97+
`SLEDGE_DISABLE_GET_REQUESTS_FROM_GQ`: Disable workers fetching requests from the global queue. Must be disabled if the dispatcher policy is not set to TO_GLOBAL_QUEUE.
98+
9699
`SLEDGE_SCHEDULER`: Specifies the scheduler policy. There are two types of schedulers:
97100
- FIFO: First-In-First-Out. Must use the TO_GLOBAL_QUEUE dispatch policy when using FIFO.
98101
- EDF: Earliest-deadline-first.
99102

100103
`SLEDGE_FIFO_QUEUE_BATCH_SIZE`: When using the FIFO scheduler, specifies how many requests are fetched from the global queue to the local queue each time the local queue becomes empty.
104+
101105
`SLEDGE_DISABLE_BUSY_LOOP`: Disables the worker’s busy loop for fetching requests from the local or global queue. The busy loop must be enabled if the dispatcher policy is set to `TO_GLOBAL_QUEUE`.
106+
102107
`SLEDGE_DISABLE_AUTOSCALING`: Currently not used;always set to `true`.
103-
`SLEDGE_SIGALRM_HANDLER`: Always set to `TRIAGED` to avoid performance issues.
108+
104109
`SLEDGE_DISABLE_EXPONENTIAL_SERVICE_TIME_SIMULATION`: For the `hash` function, enabling this option allows SLEdgeScale to estimate the function’s execution time based on the input number. For other types of functions, this should be disabled.
110+
105111
`SLEDGE_FIRST_WORKER_COREID`: Specifies the ID of the first core for the worker thread. Cores 0–2 are reserved, so numbering should start from 3.
106-
`SLEDGE_NWORKERS`: Specifies the total number of workers in the system.
107-
`SLEDGE_NLISTENERS`: Specifies the total number of dispachers in the system.
108-
`SLEDGE_WORKER_GROUP_SIZE`: Specifies SLEdgeScale calculates the number of workers in each worker group based on this value.
109-
export SLEDGE_SCHEDULER=$scheduler_policy
110-
#export SLEDGE_DISPATCHER=DARC
111-
export SLEDGE_DISPATCHER=$dispatcher_policy
112-
export SLEDGE_SCHEDULER=$scheduler_policy
113-
#export SLEDGE_DISPATCHER=EDF_INTERRUPT
112+
113+
`SLEDGE_NWORKERS`: The total number of workers in the system.
114+
115+
`SLEDGE_NLISTENERS`: The total number of dispachers in the system.
116+
117+
`SLEDGE_WORKER_GROUP_SIZE`: The number of workers in each worker group. Its value is equal to SLEDGE_NWORKERS / SLEDGE_NLISTENERS
118+
119+
`SLEDGE_SANDBOX_PERF_LOG`: Server log file path
120+
121+
Now use the following example script to start server side:
122+
```sh
123+
declare project_path="$(
124+
cd "$(dirname "$0")/../.."
125+
pwd
126+
)"
127+
echo $project_path
128+
path=`pwd`
129+
export SLEDGE_DISABLE_PREEMPTION=true
130+
export SLEDGE_DISABLE_GET_REQUESTS_FROM_GQ=true
131+
export SLEDGE_FIFO_QUEUE_BATCH_SIZE=5
132+
export SLEDGE_DISABLE_BUSY_LOOP=true
133+
export SLEDGE_DISABLE_AUTOSCALING=true
134+
export SLEDGE_DISABLE_EXPONENTIAL_SERVICE_TIME_SIMULATION=true
135+
export SLEDGE_FIRST_WORKER_COREID=3
136+
export SLEDGE_NWORKERS=1
137+
export SLEDGE_NLISTENERS=1
138+
export SLEDGE_WORKER_GROUP_SIZE=1
139+
export SLEDGE_SCHEDULER=EDF
140+
export SLEDGE_DISPATCHER=EDF_INTERRUPT
114141
export SLEDGE_SANDBOX_PERF_LOG=$path/$server_log
115142

143+
cd $project_path/runtime/bin
144+
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/fib.json
145+
```
146+
116147
Now run the sledgert binary, passing the JSON file of the serverless function we want to serve. Because serverless functions are loaded by SLEdge as shared libraries, we want to add the `applications/` directory to LD_LIBRARY_PATH.
117148

118149
```bash

0 commit comments

Comments
 (0)