commit 03325d0

default  ·  2023-02-10 12:39:17 +0000 UTC
parent b48a4dd
Show the fd rlimit at httpd startup.
2 files changed,  +8, -0
M data.c
M data.c
+1, -0
1@@ -15,6 +15,7 @@
2 #include <sys/file.h>
3 #include <fcntl.h>
4 
5+
6 double disk_layout = 2.7;
7 
8 
+7, -0
 1@@ -15,6 +15,8 @@
 2 #include <pthread.h>
 3 #include <semaphore.h>
 4 
 5+#include <sys/resource.h> // for getrlimit()
 6+
 7 
 8 /* nodeinfo 2.0 template */
 9 const char *nodeinfo_2_0_template = ""
10@@ -417,6 +419,11 @@ void httpd(void)
11 
12     srv_log(xs_fmt("httpd start %s:%d %s", address, port, USER_AGENT));
13 
14+    struct rlimit r;
15+    getrlimit(RLIMIT_NOFILE, &r);
16+    srv_debug(0, xs_fmt("available (rlimit) fds: %d (cur)/%d (max)",
17+                        (int) r.rlim_cur, (int) r.rlim_max));
18+
19     /* initialize the job control engine */
20     pthread_mutex_init(&job_mutex, NULL);
21     sem_init(&job_sem, 0, 0);