<div dir="ltr">hi all: <div>      I use nginx-1.16.0, nginx  is running on X86 embedded devices. The embedded device has 4 CPU, CPU type is: "Intel(R) Atom(TM) CPU D525   @ 1.80GHz".</div><div>When I use "accpet_mutex on", nginx use 1 secod for get static file.</div><div><br></div><div><b>events {<br>    use epoll;<br>    accept_mutex on;<br>    worker_connections  10240;<br>}</b><br></div><div><br></div><div>The debug log is:</div><div>###########################################################################</div><div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 post access phase: 12                                                                                                                              </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 generic phase: 13                                                                                                                                  </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 generic phase: 14                                                                                                                                  </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http script copy: "http://"                                                                                                                        </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http script var: "<a href="http://pcdnapkwsdl2.com.cn">pcdnapkwsdl2.com.cn</a>"                                                                                                        </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http script copy: "/"                                                                                                                              </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http script var: "appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch"                                                         </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http init upstream, client timer: 0                                                                                                                </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 epoll add event: fd:15 op:3 ev:80002005                                                                                                            </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http cache key: "<a href="http://pcdnapkwsdl2.vivo.com.cn">http://pcdnapkwsdl2.vivo.com.cn</a>"                                                                                                  </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http cache key: "/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch"                                                         </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 add cleanup: 00000000026C46C0                                                                                                                      </div><div>2019/11/08 17:08:10 [debug] 2552#2552: shmtx lock                                                                                                                                            </div><div>2019/11/08 17:08:10 [debug] 2552#2552: shmtx unlock                                                                                                                                          </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http file cache exists: 0 e:1                                                                                                                      </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 cache file: "/tmp/storage/youyu/ikcdndata/wangsu2/wan1/p2p_proxy/cache/c/df/468f0ede6aa8ba9073f9a989b8377dfc"                                      </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 add cleanup: 00000000026C4740                                                                                                                      </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http file cache fd: 16                                                                                                                             </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 malloc: 00000000026C48D0:4096                                                                                                                      </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 thread read: 16, 00000000026C48D0, 4096, 0                                                                                                         </div><div>2019/11/08 17:08:10 [debug] 2552#2552: task #0 added to thread pool "default"                                                                                                                </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http upstream cache: -2                                                                                                                            </div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http finalize request: -4, "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811</a></div><div>2019/11/08 17:08:10 [debug] 2552#2552: *1 http request count:2 blk:1                                                                                                                         </div><div>2019/11/08 17:08:10 [debug] 2552#2552: worker cycle                                                                                                                                          </div><div><span style="background-color:rgb(255,250,165)">2019/11/08 17:08:10 [debug] 2552#2552: accept mutex locked                                                                                                                                   </span></div><div><span style="background-color:rgb(255,250,165)">2019/11/08 17:08:10 [debug] 2552#2552: epoll timer: -1                                                                                                                                       </span></div><div><span style="background-color:rgb(255,250,165)">2019/11/08 17:08:11 [debug] 2552#2552: epoll: fd:15 ev:0004 d:00007F026302A3F0                                                                         </span></div><div><span style="background-color:rgb(255,250,165)">2019/11/08 17:08:11 [debug] 2552#2552: *1 post event 00007F0262E48190                    </span>                                                                                                    </div><div>2019/11/08 17:08:11 [debug] 2552#2552: timer delta: 533                                                                                                                                      </div><div>2019/11/08 17:08:11 [debug] 2552#2552: posted event 00007F0262E48190                                                                                                                         </div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 delete posted event 00007F0262E48190                                                                                                               </div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 http run request: "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch</a>?"</div><div>2019/11/08 17:08:11 [debug] 2552#2552: worker cycle                                                                                                                                          </div><div>2019/11/08 17:08:11 [debug] 2552#2552: accept mutex locked                                                                                                                                   </div><div>2019/11/08 17:08:11 [debug] 2552#2552: epoll timer: -1                                                                                                                                       </div><div>2019/11/08 17:08:11 [debug] 2552#2564: run task #0 in thread pool "default"                                                                                                                  </div><div>2019/11/08 17:08:11 [debug] 2552#2564: thread read handler                                                                                                                                   </div><div>2019/11/08 17:08:11 [debug] 2554#255<span style="background-color:rgb(255,250,165)">4: timer delta: 809     </span>            </div><div>2019/11/08 17:08:11 [debug] 2554#2554: worker cycle</div><div>2019/11/08 17:08:11 [debug] 2554#2554: accept mutex lock failed: 02019/11/08 17:08:11 [debug] 2554#2554: epoll timer: 500                                       </div><div>2019/11/08 17:08:11 [debug] 2553#2553<span style="background-color:rgb(255,250,165)">: timer delta: 809</span></div><div>2019/11/08 17:08:11 [debug] 2553#2553: worker cycle</div><div>2019/11/08 17:08:11 [debug] 2553#2553: accept mutex lock failed: 0</div><div>2019/11/08 17:08:11 [debug] 2553#2553: epoll timer: 500</div><div>2019/11/08 17:08:11 [debug] 2555#2555: <span style="background-color:rgb(255,250,165)">timer delta: 811</span></div><div>2019/11/08 17:08:11 [debug] 2555#2555: worker cycle                                           </div><div>2019/11/08 17:08:11 [debug] 2555#2555: accept mutex lock failed: 0                            </div><div>2019/11/08 17:08:11 [debug] 2555#2555: epoll timer: 500                                       </div><div>2019/11/08 17:08:11 [debug] 2552#2564: pread: 4096 (err: 0) of 4096 @0                        </div><div>2019/11/08 17:08:11 [debug] 2552#2564: complete task #0 in thread pool "default"              </div><div>2019/11/08 17:08:11 [debug] 2552#2552: epoll: fd:11 ev:0001 d:000000000086FF20                </div><div>2019/11/08 17:08:11 [debug] 2552#2552: post event 000000000086FEC0</div><div>2019/11/08 17:08:11 [debug] 2552#2552<span style="background-color:rgb(255,250,165)">: timer delta: 343</span></div><div>2019/11/08 17:08:11 [debug] 2552#2552: posted event 000000000086FEC0</div><div>2019/11/08 17:08:11 [debug] 2552#2552: delete posted event 000000000086FEC0                   </div><div>2019/11/08 17:08:11 [debug] 2552#2552: thread pool handler2019/11/08 17:08:11 [debug] 2552#2552: run completion handler for task #0                     </div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 http file cache thread: "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch</a>?"</div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 thread read: 16, 00000000026C48D0, 4096, 0</div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 http upstream cache: 0</div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 posix_memalign: 00000000026C58E0:4096 @16</div><div>2019/11/08 17:08:11 [debug] 2552#2552: *1 http proxy status 200 "200 OK"</div></div><div>###########################################################################</div><div><br></div><div>If  I  don't use "accpet_mutex on" , I can get  http response quickly. The debug log is:</div><div>###########################################################################</div><div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 malloc: 000000000226E8D0:4096                                                                                                                    </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 thread read: 17, 000000000226E8D0, 4096, 0                                                                                                       </div><div>2019/11/08 17:14:34 [debug] 23726#23726: task #0 added to thread pool "default"                                                                                                              </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http upstream cache: -2                                                                                                                          </div><div>2019/11/08 17:14:34 [debug] 23726#23795: run task #0 in thread pool "default"                                                                                                                </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http finalize request: -4, "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_8">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_8</a></div><div>2019/11/08 17:14:34 [debug] 23726#23795: thread read handler                                                                                                                                 </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http request count:2 blk:1                                                                                                                       </div><div>2019/11/08 17:14:34 [debug] 23726#23726: timer delta: 2                                                                                                                                      </div><div>2019/11/08 17:14:34 [debug] 23726#23795: pread: 4096 (err: 0) of 4096 @0                                                                                                                     </div><div>2019/11/08 17:14:34 [debug] 23726#23726: worker cycle                                                                                                                                        </div><div>2019/11/08 17:14:34 [debug] 23726#23795: complete task #0 in thread pool "default"                                                                                                           </div><div>2019/11/08 17:14:34 [debug] 23726#23726: epoll timer: -1                                                                                                                                     </div><div>2019/11/08 17:14:34 [debug] 23726#23726: epoll: fd:16 ev:0004 d:00007F3D265033F0                                                                                                             </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http run request: "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811.patch</a>?</div><div>2019/11/08 17:14:34 [debug] 23726#23726: timer delta: 0                                                                                                                                      </div><div>2019/11/08 17:14:34 [debug] 23726#23726: worker cycle                                                                                                                                        </div><div>2019/11/08 17:14:34 [debug] 23726#23726: epoll timer: -1                                                                                                                                     </div><div>2019/11/08 17:14:34 [debug] 23726#23726: epoll: fd:13 ev:0001 d:000000000086FF20                                                                                                             </div><div>2019/11/08 17:14:34 [debug] 23726#23726: thread pool handler                                                                                                                                 </div><div>2019/11/08 17:14:34 [debug] 23726#23726: run completion handler for task #0                                                                                                                  </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http file cache thread: "/<a href="http://pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811">pcdnapkwsdl2.com.cn/pcdnapkwsdltest.com.cn/appstore/developer/soft/20191008/201910081449521157660_v2_820_811</a>.</div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 thread read: 17, 000000000226E8D0, 4096, 0                                                                                                       </div><div>2019/11/08 17:14:34 [debug] 23726#23726: shmtx lock                                                                                                                                          </div><div>2019/11/08 17:14:34 [debug] 23726#23726: shmtx unlock                                                                                                                                        </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http upstream cache: 0                                                                                                                           </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 posix_memalign: 000000000226F8E0:4096 @16                                                                                                        </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy status 200 "200 OK"                                                                                                                   </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Date: Fri, 08 Nov 2019 07:50:58 GMT"                                                                                         </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Content-Type: application/octet-stream"                                                                                      </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Content-Length: 40492454"                                                                                                    </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Connection: close"                                                                                                           </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Server: AliyunOSS"                                                                                                           </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "x-oss-request-id: 5D9C3B95591574F5686E7B00"                                                                                  </div><div>2019/11/08 17:14:34 [debug] 23726#23726: *1 http proxy header: "Accept-Ranges: bytes"                            </div></div><div>###########################################################################</div><div><br></div><div>How should this problem be analyzed? I am a newcomer to nginx.<br></div><div>Thank you.</div><div><br></div><div><br></div><div><br></div></div>