Bug #68134

sem_acquire while loop can lead to 100% CPU load

Added by Stefan Hekele over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2015-07-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Faulty function:
typo3/sysext/core/Classes/Locking/Locker.php->acquire

Environment:
RedHat 6.5
Apache 2.4.12
PHP FPM 5.5.6 / 5.5.21 (tested before and after update)
TYPO3 6.2.14 with semaphore locking

Encountered behavior:
After a cache clear via admin interface, a siege run with more than 3-4 users leads to at least one timed out response. The FPM process serving that requests uses 100% CPU till PHP timeout. Using the recommended timeout setting of 240, this quickly leads to an unresponsive server at just medium traffic. A lower timeout setting mitigates the problem.

Expected behavior:
Just like before 6.2, and like 7.3+, the lock acquiration should not be attempted in a loop. After a failed lock, an exception should be thrown, same as the other locking mechanisms.

Proposed change:
https://github.com/plan2net/TYPO3.CMS/commit/055b4f853f1fe44db023da3c2b60c7ef988ef817

Also available in: Atom PDF