随笔分类 - nginx
摘要:nginx中accept锁主要是为了防止一个新连接的accept事件导致多个进程被唤醒的问题发生。 nginx中的进程只有抢占到accept锁时才会将监听的fd放入epoll中,这样同一时间只有一个进程可以接受新连接的accept事件。工作进程抢占到accept锁后,将监听端口的fd放入epoll中
阅读全文
摘要:1 int ngx_cdecl 2 main(int argc, char *const *argv) 3 { 4 ngx_buf_t *b; 5 ngx_log_t *log; 6 ngx_uint_t i; 7 ngx_cycle_t *cycle, init_cycle; 8 ngx_conf
阅读全文
摘要:在一些系统调用中需要指定时间是用CLOCK_MONOTONIC还是CLOCK_REALTIME。 CLOCK_MONOTONIC是monotonic time,而CLOCK_REALTIME是wall time。 monotonic time字面意思是单调时间,实际上它指的是系统启动以后流逝的时间,
阅读全文
摘要:1 ngx_int_t 2 ngx_os_init(ngx_log_t *log) 3 { 4 ngx_time_t *tp; 5 ngx_uint_t n; 6 #if (NGX_HAVE_LEVEL1_DCACHE_LINESIZE) 7 long size; 8 #endif 9 10 #if
阅读全文
摘要:Server: 1 from flask import Flask, request, jsonify 2 import json 3 import re 4 import os 5 import subprocess 6 7 conf_file_src = '/etc/nginx/nginx.co
阅读全文

浙公网安备 33010602011771号