summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-02-10 13:39:17 +0100
committerdefault <nobody@localhost>2023-02-10 13:39:17 +0100
commit03325d04a5d24dc77140323c8703aee7b63cb9f1 (patch)
tree59e4101409c41eaa571f6abbc8aaf97d3a4018f5 /httpd.c
parentb48a4ddfa6f0090bc3a25bae302dadfeef47663e (diff)
Show the fd rlimit at httpd startup.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index a8a6e5f..cf9dd95 100644
--- a/httpd.c
+++ b/httpd.c
@@ -15,6 +15,8 @@
#include <pthread.h>
#include <semaphore.h>
+#include <sys/resource.h> // for getrlimit()
+
/* nodeinfo 2.0 template */
const char *nodeinfo_2_0_template = ""
@@ -417,6 +419,11 @@ void httpd(void)
srv_log(xs_fmt("httpd start %s:%d %s", address, port, USER_AGENT));
+ struct rlimit r;
+ getrlimit(RLIMIT_NOFILE, &r);
+ srv_debug(0, xs_fmt("available (rlimit) fds: %d (cur)/%d (max)",
+ (int) r.rlim_cur, (int) r.rlim_max));
+
/* initialize the job control engine */
pthread_mutex_init(&job_mutex, NULL);
sem_init(&job_sem, 0, 0);