ngx_cycle_s:核心结构,启动一个nginx进程的全部信息
struct ngx_cycle_s {
void ****conf_ctx; '保存着全部模块配置的结构体指针'
ngx_pool_t *pool; '内存池'
ngx_log_t *log; 'log模块'
ngx_log_t new_log; '新的log模块'
ngx_uint_t log_use_stderr; /* unsigned log_use_stderr:1; */
ngx_connection_t **files; '链接数组'
ngx_connection_t *free_connections; '空闲链接池的第一个指针,每次事件处理完成。都会从这里面获取新的链接结构去添加新的事件'
ngx_uint_t free_connection_n; '空闲链接池数'
ngx_module_t **modules; '模块列表'
ngx_uint_t modules_n; '模块个数'
ngx_uint_t modules_used; /* unsigned modules_used:1; */
ngx_queue_t reusable_connections_queue; '可重复使用的双向链接队列'
ngx_uint_t reusable_connections_n; '可重复使用的双向链接队列个数'
ngx_array_t listening; '套接字数组'
ngx_array_t paths; '保存nginx所要操做的目录,若是目录不存在。则建立目录失败将致使NGINX启动失败'
ngx_array_t config_dump; '配置缓存'
ngx_rbtree_t config_dump_rbtree;
ngx_rbtree_node_t config_dump_sentinel;
ngx_list_t open_files; '已打开的全部文件列表'
ngx_list_t shared_memory; '共享内存列表'
ngx_uint_t connection_n; '进程中全部链接对象的总数'
ngx_uint_t files_n; 'connection_n 中的总数'
ngx_connection_t *connections; '指向当前进程中的全部链接对象,每一个链接对象应对一个写和读事件'
ngx_event_t *read_events; '读事件、connections表明读事件总数'
ngx_event_t *write_events; '写事件、connections表明读事件总数'
ngx_cycle_t *old_cycle; '旧的cyc,在ngx_init_cycle时的入参'
ngx_str_t conf_file; '配置文件相对于安装目录的路径名称'
ngx_str_t conf_param; 'nginx命令的参数'
ngx_str_t conf_prefix; '配置文件 nginx.conf的目录'
ngx_str_t prefix; 'nginx的安装路径'
ngx_str_t lock_file; '文件锁'
ngx_str_t hostname; '主机名'
};