Page MenuHomePhabricator

Experiment with 'default' apc.serializer string reuse
Closed, ResolvedPublic

Description

Strings can be reused by apcu, avoiding memory copy operations and resulting in lower point-in-time memory usage. This requires the 'default' serializer (which is NOT the default due to segfault bugs in the past). Upstream has made various fixes (https://pecl.php.net/package-changelog.php?package=APCu) and it would be nice to see if the crash issues are solved. If so, we might benefit from using it.

A core MediaWiki change is also required, in order to allow this feature.

Event Timeline

Change 671634 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] objectcache: allow native serializer for apcu >= 5.1.20

https://gerrit.wikimedia.org/r/671634

I've asked upstream about how confident they feel about this, given the complex history. Also, even if it is stable, it remains a separate question as to whether it will be faster or not. I'm not sure how the default serializer worked in the past, but one idea that floated around upstream was to use the shared memory (SHM) in a way that would make Zend responsible for reference counting. That seems "ideal" and likely to approximate as closely as possible how HHVM behaved. (Matching it seems unlikely given that HHVM was as fast as it was by never clearing anything from APC so it didn't have to deal with LRU or GC and thus could safely reference the shared memory for any given server instance until restarted.)

Link: https://github.com/krakjoe/apcu/issues/175#issuecomment-897229348

Change 671634 abandoned by Aaron Schulz:

[mediawiki/core@master] objectcache: allow native serializer for apcu >= 5.1.20

Reason:

https://gerrit.wikimedia.org/r/671634

Change 671634 restored by Aaron Schulz:

[mediawiki/core@master] objectcache: allow native serializer for apcu >= 5.1.20

https://gerrit.wikimedia.org/r/671634

aaron changed the task status from Open to Stalled.Oct 4 2022, 7:00 PM

This is unlikely to happen for a long time. We should experiment with other things like igbinary.

Aklapper changed the task status from Stalled to Open.Oct 20 2022, 9:53 AM
Aklapper lowered the priority of this task from Medium to Lowest.

@aaron: That means this task is not stalled ("If a report is waiting for further input (e.g. from its reporter or a third party) and can currently not be acted on"). Thus resetting status.

(Smallprint, as general orientation for task management:
If you wanted to express that nobody is currently working on this task, then the assignee should be removed and/or priority could be lowered instead.
If work on this task is blocked by another task, then that other task should be added via Edit Related Tasks...Edit Subtasks.
If this task is out of scope and nobody should ever work on this, or nobody else managed to reproduce the situation described here, then it should have the Declined status.
If the task is valid but should not appear on some team's workboard, then the team project tag should be removed while the task has another active project tag.)

Krinkle assigned this task to aaron.

Change 671634 merged by jenkins-bot:

[mediawiki/core@master] objectcache: allow use of the "default" apcu.serializer

https://gerrit.wikimedia.org/r/671634