Bug 61927

Summary: Excessive sendfile() calls
Product: Apache httpd-2 Reporter: Alex Gacovski <alex.gacovski>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal CC: lukasz.cybula
Priority: P2    
Version: 2.4.27   
Target Milestone: ---   
Hardware: PC   
OS: FreeBSD   
Attachments: Truss output from apache process.

Description Alex Gacovski 2017-12-25 12:11:44 UTC
Created attachment 35628 [details]
Truss output from apache process.

When apache attempts to send a file using the sendfile() syscall and the socket buffer is full, apache does not wait for the socket buffer to be ready for writing but will constantly call sendfile() causing high cpu usage.

OS: FreeBSD 11.1-RELEASE x64.
HTTPD: Apache 2.4.27 from precompiled freebsd fresh ports.
MPM: Prefork.