diff options
author | Christopher Baines <mail@cbaines.net> | 2024-07-26 21:42:21 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-07-26 21:42:21 +0100 |
commit | e8bd27fdb81fb776109ba4d2a57a1432768f100f (patch) | |
tree | 90a7c4f57f1570c1482f32850f7865dbc140e376 /guix-data-service/web | |
parent | 2a80304e0c6b9c3c6fbb65afe8f2249d9b23fc1c (diff) | |
download | data-service-e8bd27fdb81fb776109ba4d2a57a1432768f100f.tar data-service-e8bd27fdb81fb776109ba4d2a57a1432768f100f.tar.gz |
Try using 2 threads for the server
Diffstat (limited to 'guix-data-service/web')
-rw-r--r-- | guix-data-service/web/server.scm | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/guix-data-service/web/server.scm b/guix-data-service/web/server.scm index 07f05f8..d56066e 100644 --- a/guix-data-service/web/server.scm +++ b/guix-data-service/web/server.scm @@ -134,11 +134,21 @@ (run-fibers (lambda () - (catch 'system-error - (lambda () - (set-thread-name - (string-append "server"))) - (const #t)) + (let* ((current (current-scheduler)) + (schedulers + (cons current (scheduler-remote-peers current)))) + (for-each + (lambda (i sched) + (spawn-fiber + (lambda () + (catch 'system-error + (lambda () + (set-thread-name + (string-append "server " (number->string i)))) + (const #t))) + sched)) + (iota (length schedulers)) + schedulers)) (while (not request-scheduler) (sleep 0.1)) @@ -236,6 +246,6 @@ port. Also, the port used can be changed by passing the --port option.\n" (spawn-port-monitoring-fiber port finished?) (wait finished?)) - #:hz 5 - #:parallelism 1)) + #:hz 0 + #:parallelism 2)) finished?))) |