Mercurial > hg > nginx
annotate src/os/unix/ngx_setproctitle.h @ 4164:c48662671609 stable-1.0
Merging r4130, r4131, r4135:
Linux AIO related fixes:
*) Fixing Linux AIO syscalls return value handling:
syscall(2) uses usual libc convention, it returns -1 on error and
sets errno. Obsolete _syscall(2) returns negative value of error.
*) Fixing Linux AIO initiatialization: AIO operations are disabled
if kernel does not support them. Previously worker just exited.
*) The "worker_aio_requests" directive.
The default value is 32 AIO simultaneous requests per worker. Previously
they were hardcoded to 1024, and it was too large, since Linux allocated
them early on io_setup(), but not on request itself. So with default value
of /proc/sys/fs/aio-max-nr equal to 65536 only 64 worker processes could
be run simultaneously. 32 AIO requests are enough for modern disks even if
server runs only 1 worker.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 30 Sep 2011 14:12:53 +0000 |
parents | 3ba82806ec9a |
children | d620f497c50f |
rev | line source |
---|---|
509 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_SETPROCTITLE_H_INCLUDED_ | |
8 #define _NGX_SETPROCTITLE_H_INCLUDED_ | |
9 | |
10 | |
11 #if (NGX_HAVE_SETPROCTITLE) | |
12 | |
13 /* FreeBSD, NetBSD, OpenBSD */ | |
14 | |
15 #define ngx_init_setproctitle(log) | |
3285 | 16 #define ngx_setproctitle(title) setproctitle("%s", title) |
509 | 17 |
18 | |
515 | 19 #else /* !NGX_HAVE_SETPROCTITLE */ |
509 | 20 |
515 | 21 #if !defined NGX_SETPROCTITLE_USES_ENV |
509 | 22 |
23 #if (NGX_SOLARIS) | |
24 | |
515 | 25 #define NGX_SETPROCTITLE_USES_ENV 1 |
509 | 26 #define NGX_SETPROCTITLE_PAD ' ' |
27 | |
28 ngx_int_t ngx_init_setproctitle(ngx_log_t *log); | |
29 void ngx_setproctitle(char *title); | |
30 | |
515 | 31 #elif (NGX_LINUX) || (NGX_DARWIN) |
509 | 32 |
515 | 33 #define NGX_SETPROCTITLE_USES_ENV 1 |
34 #define NGX_SETPROCTITLE_PAD '\0' | |
35 | |
36 ngx_int_t ngx_init_setproctitle(ngx_log_t *log); | |
37 void ngx_setproctitle(char *title); | |
38 | |
39 #else | |
509 | 40 |
41 #define ngx_init_setproctitle(log) | |
42 #define ngx_setproctitle(title) | |
43 | |
515 | 44 #endif /* OSes */ |
45 | |
46 #endif /* NGX_SETPROCTITLE_USES_ENV */ | |
47 | |
48 #endif /* NGX_HAVE_SETPROCTITLE */ | |
509 | 49 |
50 | |
51 #endif /* _NGX_SETPROCTITLE_H_INCLUDED_ */ |