View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0016236||CentOS-7||curl||public||2019-07-02 14:59||2019-07-02 15:55|
|Target Version||Fixed in Version|
|Summary||0016236: Frequent clone System-Calls with Apache, Perl and CURL with Threaded Resolver|
- Apache 2.4.6 (httpd-2.4.6-88.el7.centos)
- Perl module for Apache (mod_perl-2.0.10-3.el7 from EPEL 7)
- CURL (curl and libcurl both 7.29.0-51.el7)
In this scenario:
- Apache is running in "prefork" MPM mode.
- Certain web-requests are processed by Perl.
- Certain of those result in calls to CURL.
This combination results in frequent 'clone' system-calls, as observed with 'strace' and GDB. GDB reveals that the primary cloner is libcurl. The CentOS 7 CURL .spec file specifies the '--enable-threaded-resolver' option for 'configure'. Rebuilding libcurl with --enable-ares instead of --enable-threaded-resolver eliminates the frequent 'clone' system-calls, but doing so means diverging from the CentOS 7 packages for curl and libcurl.
Is this a supported scenario? Are frequent 'clone' system-calls by libcurl in a multi-process (as opposed to a multi-threaded) server to be expected?
(In this particular scenario, the libcurl invocations are expected to block the processing of the web-request, so starting up one or more threads for DNS resolution and then tearing those threads down seems pretty needless; no useful work is happening on behalf of the web-request until the DNS resolution and the curl-result have been completed.)
|Steps To Reproduce||Configure Apache to handle a web-request foo.cgi with a Perl file that invokes curl to get a resource from www.google.com, then send a continuous, parallel stream of web-requests for foo.cgi for a few minutes. Watch with:|
(strace -T -tt -f $(for i in $(pidof httpd); do echo -n "-p $i "; done) -e trace=clone &); sleep 60; killall strace
|Tags||No tags attached.|
|CentOS is a rebuild of the sources used to create RHEL. We do not modify anything except to remove branding and logos. You will need to submit your request to Redhat via bugzilla.redhat.com and if/when RH accepts it and incorporates it into RHEL and releases a patched version, then CentOS will pick it up and rebuild it.|
|Thank you, TrevorH. I appreciate your time and had quite forgotten this fact.|
|Please close the issue, at your convenience.|
|Red Hat bug: https://bugzilla.redhat.com/show_bug.cgi?id=1726337|