making bbPress (and WordPress) work better!

CURL broken in CentOS 7 / RHEL7 for past year

If you suspected maybe WordPress and other PHP apps were slower to ping/trackback sites and other fetches under CentOS 7 than CentOS 6, you aren’t imagining things.

Apparently libCurl (and therefore Curl in PHP) has been broken for over a year now without RedHat applying the available patch and pushing an update.

https://bugs.centos.org/view.php?id=8076

https://bugzilla.redhat.com/show_bug.cgi?id=1130239

patch: https://github.com/bagder/curl/commit/d529f388 (note July 2013)


Basically 150ms-350ms delay is added to every external page fetch. It might even be affecting wp-cron. For one fetch it is not bothersome, but if you have to ping a dozen sites, it adds up to causing a several second delay for no reason.

Hopefully they will address this very soon, meanwhile I’ve found a workaround.

I’ll add more detailed instructions later but for now I’ve discovered that the Fedora Core 19 from RedHat is (mostly) binary compatible with RHEL7 / CentOS7 so we can use the 7.29 from that version that has been patched up to 27 (vs 19) by the very same person at Redhat who applies the RHEL patches.

for people who know what they are doing, download curl, libcurl and libcurl-devel from here:

http://dl.fedoraproject.org/pub/archive/fedora/linux/updates/19/x86_64/curl-7.29.0-27.fc19.x86_64.rpm
http://dl.fedoraproject.org/pub/archive/fedora/linux/updates/19/x86_64/libcurl-7.29.0-27.fc19.x86_64.rpm
http://dl.fedoraproject.org/pub/archive/fedora/linux/updates/19/x86_64/libcurl-devel-7.29.0-27.fc19.x86_64.rpm

and then use YUM or RPM to install
yum install *.fc19.x86_64.rpm
– this way it can be undone later when centos finally updates someday

if you need to undo it, just replace back these versions

http://mirror.centos.org/centos/7/os/x86_64/Packages/curl-7.29.0-19.el7.x86_64.rpm
http://mirror.centos.org/centos/7/os/x86_64/Packages/libcurl-7.29.0-19.el7.x86_64.rpm
http://mirror.centos.org/centos/7/os/x86_64/Packages/libcurl-devel-7.29.0-19.el7.x86_64.rpm

Because they are both 7.29 and no dependencies change, you do NOT need to recompile PHP or any other program that relies on the libcurl libraries.

You can clearly see the change on this graph on the far right from the switch:

1. dns time drops to 4ms reading from the resolver cache instead of 150-350ms
2. connect time drops from 420ms to 74ms
3. time to first byte drops from 489ms to 143ms
4. download speed improves from 40KB/sec to 65KB/sec

curl-fix

3 responses

  1. thanks for heads up – Centmin Mod LEMP has a customcurl.sh addon for curl 7.43+ https://community.centminmod.com/threads/centmin-mod-curl-7-43-custom-rpms.3703/ and it seems curl 7.43+ has the fix 🙂

    September 16, 2015 at 7:54 pm

    • I had seen your fix but since it replaces all those dependencies seemed like a dangerous idea as it might require some thing to be recompiled. The drop-in replacement from FC19 doesn’t need any dependencies messed with and is 100% compatible.

      September 17, 2015 at 3:53 am

  2. Actually, it includes a package to retain all the older dependencies as well

    rpm -ql libcurl7155 libcurl7112 | grep .so
    /usr/lib64/libcurl.so.3
    /usr/lib64/libcurl.so.3.0.0
    /usr/lib64/libcurl.so.2
    /usr/lib64/libcurl.so.2.0.2

    been using it for over a year starting with curl 7.29 for centos 6.x way back but only started using it with curl 7.43+ in past few months 🙂

    September 17, 2015 at 6:39 am

Leave a comment