diff options
| author | 2023-02-10 13:39:17 +0100 | |
|---|---|---|
| committer | 2023-02-10 13:39:17 +0100 | |
| commit | 03325d04a5d24dc77140323c8703aee7b63cb9f1 (patch) | |
| tree | 59e4101409c41eaa571f6abbc8aaf97d3a4018f5 | |
| parent | Updated TODO. (diff) | |
| download | snac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.tar.gz snac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.tar.xz snac2-03325d04a5d24dc77140323c8703aee7b63cb9f1.zip | |
Show the fd rlimit at httpd startup.
| -rw-r--r-- | data.c | 1 | ||||
| -rw-r--r-- | httpd.c | 7 |
2 files changed, 8 insertions, 0 deletions
| @@ -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 | |||
| 18 | double disk_layout = 2.7; | 19 | double disk_layout = 2.7; |
| 19 | 20 | ||
| 20 | 21 | ||
| @@ -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 */ |
| 20 | const char *nodeinfo_2_0_template = "" | 22 | const 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); |