summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-02-10 13:39:17 +0100
committerGravatar default2023-02-10 13:39:17 +0100
commit03325d04a5d24dc77140323c8703aee7b63cb9f1 (patch)
tree59e4101409c41eaa571f6abbc8aaf97d3a4018f5
parentUpdated TODO. (diff)
downloadsnac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.tar.gz
snac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.tar.xz
snac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.zip
Show the fd rlimit at httpd startup.
-rw-r--r--data.c1
-rw-r--r--httpd.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/data.c b/data.c
index 72f90cd..a500b03 100644
--- a/data.c
+++ b/data.c
@@ -15,6 +15,7 @@
15#include <sys/file.h> 15#include <sys/file.h>
16#include <fcntl.h> 16#include <fcntl.h>
17 17
18
18double disk_layout = 2.7; 19double disk_layout = 2.7;
19 20
20 21
diff --git a/httpd.c b/httpd.c
index a8a6e5f..cf9dd95 100644
--- a/httpd.c
+++ b/httpd.c
@@ -15,6 +15,8 @@
15#include <pthread.h> 15#include <pthread.h>
16#include <semaphore.h> 16#include <semaphore.h>
17 17
18#include <sys/resource.h> // for getrlimit()
19
18 20
19/* nodeinfo 2.0 template */ 21/* nodeinfo 2.0 template */
20const char *nodeinfo_2_0_template = "" 22const char *nodeinfo_2_0_template = ""
@@ -417,6 +419,11 @@ void httpd(void)
417 419
418 srv_log(xs_fmt("httpd start %s:%d %s", address, port, USER_AGENT)); 420 srv_log(xs_fmt("httpd start %s:%d %s", address, port, USER_AGENT));
419 421
422 struct rlimit r;
423 getrlimit(RLIMIT_NOFILE, &r);
424 srv_debug(0, xs_fmt("available (rlimit) fds: %d (cur)/%d (max)",
425 (int) r.rlim_cur, (int) r.rlim_max));
426
420 /* initialize the job control engine */ 427 /* initialize the job control engine */
421 pthread_mutex_init(&job_mutex, NULL); 428 pthread_mutex_init(&job_mutex, NULL);
422 sem_init(&job_sem, 0, 0); 429 sem_init(&job_sem, 0, 0);