本文共 1794 字,大约阅读时间需要 5 分钟。
Nginx??????Web???????????????????????????????????????Nginx???????????????
???????Nginx???????????????????
-p???????????ngx_prefix????????-c?????????????ngx_conf_file?-g???????????ngx_conf_params?-s?????????????ngx_signal????NGX_PROCESS_SIGNALLER??????????????ngx_time_init()?????????????????????ngx_cached_err_log_time?ngx_cached_http_time?????ngx_time_update?????????
????????????????ngx_regex_init()?????????????ngx_log_init()????????????????????SSL???ngx_ssl_init()????????HTTPS???
??????ngx_create_pool()??????1024B?????????ngx_save_argv()????????ngx_argv?????????
??????????????????????????????????
?????????ngx_spawn_process()?????????????????????socketpair()??UNIX?????????????????ioctl()?fcntl()????I/O???
?????????????????????proc(cycle, data)???????????ngx_worker_process_cycle()?
?????????????????????????CPU?????????????????????????????
???????ngx_add_channel_event()???????????????????????ngx_channel_handler()?????recvmsg()?????????????
????????????????????????ngx_process_events_and_timers()????
ngx_process_events()?? epoll??????????? accept_mutex ??ngx_event_process_posted()???????????????????????????????ngx_terminate?ngx_quit?????????????????
ngx_event_process_posted()???????????????
voidngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted){ ngx_queue_t *q; ngx_event_t *ev; while (!ngx_queue_empty(posted)) { q = ngx_queue_head(posted); ev = ngx_queue_data(q, ngx_event_t, queue); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "posted event %p", ev); ngx_delete_posted_event(ev); ev->handler(ev); }} ???????????????????????
Nginx??????????????????????????????????????????????????????????Nginx??????????
转载地址:http://whcfk.baihongyu.com/