Bug #70984 [NEW]: Script extreme slow compared to 5.6, MAP_HUGETLB problem?

From: Date: Fri, 27 Nov 2015 12:54:27 +0000
Subject: Bug #70984 [NEW]: Script extreme slow compared to 5.6, MAP_HUGETLB problem?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197458@lists.php.net to get a copy of this message
From:             arjen at react dot com
Operating system: Linux
PHP version:      7.0.0RC8
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Script extreme slow compared to 5.6, MAP_HUGETLB problem?

Description:
------------
Testcase runs in 6.7 sec.
1.7 sec in PHP 5.6.

strace reports lots of ENOMEM (Cannot allocate memory) warnings:

munmap(0x7fd131400000, 2097152)         = 0
mmap(NULL, 2097152, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = -1 ENOMEM (Cannot
allocate memory)
mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fd131400000
madvise(0x7fd131400000, 2097152, MADV_HUGEPAGE) = 0
munmap(0x7fd131400000, 2097152)         = 0
mmap(NULL, 2097152, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = -1 ENOMEM (Cannot
allocate memory)
mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fd131400000
madvise(0x7fd131400000, 2097152, MADV_HUGEPAGE) = 0
[....]

Ultimately the memory allocation succeeds. With bigger javascript inputs
(it's a javascript minifier), running time can be in 10-60 minutes,
compared to 1-5 minutes under 5.6.

The PHP binary is compiled on a host with HUGETLB support, however the
target host (systemd-container) has not Hugepages (configured). 5.6
testing was done with same memory amount. There is enough (normal) free
memory.

cat /proc/meminfo
[..]
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0



Test script:
---------------
https://gist.github.com/arjenschol/49a847c07154b51130b2

Expected result:
----------------
Execution at least as fast as 5.6.

Actual result:
--------------
3-4x slower compared to 5.6.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70984&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70984&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70984&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70984&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70984&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70984&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70984&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70984&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70984&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70984&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70984&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70984&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70984&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70984&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70984&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70984&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70984&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70984&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70984&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70984&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70984&r=mysqlcfg



Thread (16 messages)

« previous php.bugs (#197458) next »