Session mm support

  111688
August 26, 2020 07:37 nikita.ppv@gmail.com (Nikita Popov)
Hi internals,

I've recently found out that compiling PHP with --with-mm has a massive
negative impact on PHP startup performance (approximately 3-4 times
slower), to the point that our CI got approximately 2x slower overall with
it enabled. This is not great.

As I only found out about the existence of this session backend recently,
I'm wondering how widely it is used, and whether we wouldn't be better off
dropping it from php-src. The performance characteristics make it a pretty
big foot-gun.

Regards,
Nikita
  111689
August 26, 2020 07:44 php@beccati.com (Matteo Beccati)
Hi Nikita,

On 26/08/2020 09:37, Nikita Popov wrote:
> Hi internals, > > I've recently found out that compiling PHP with --with-mm has a massive > negative impact on PHP startup performance (approximately 3-4 times > slower), to the point that our CI got approximately 2x slower overall with > it enabled. This is not great. > > As I only found out about the existence of this session backend recently, > I'm wondering how widely it is used, and whether we wouldn't be better off > dropping it from php-src. The performance characteristics make it a pretty > big foot-gun.
I think it might have been used in some deb/rpm packages a very long time ago and I vaguely recall it being somewhat a recommended setting for performance. I have however no recollection of when it stopped being relevant. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/
  111690
August 26, 2020 07:52 alexinbeijing@gmail.com (Alex)
I guess the first question is: Why is it so slow? I don't think that using
shared memory to store data is inherently slower than storing it anywhere
else.

It might be that spending an hour or two profiling and optimizing could
slash this time right down.

On Wed, Aug 26, 2020 at 9:37 AM Nikita Popov ppv@gmail.com> wrote:

> Hi internals, > > I've recently found out that compiling PHP with --with-mm has a massive > negative impact on PHP startup performance (approximately 3-4 times > slower), to the point that our CI got approximately 2x slower overall with > it enabled. This is not great. > > As I only found out about the existence of this session backend recently, > I'm wondering how widely it is used, and whether we wouldn't be better off > dropping it from php-src. The performance characteristics make it a pretty > big foot-gun. > > Regards, > Nikita >
  111698
August 27, 2020 00:04 smalyshev@gmail.com (Stanislav Malyshev)
Hi!

> I've recently found out that compiling PHP with --with-mm has a massive > negative impact on PHP startup performance (approximately 3-4 times > slower), to the point that our CI got approximately 2x slower overall with > it enabled. This is not great.
That's weird. Would be nice to run a profile to see what makes it so slow. From a quick look on the code it just creates a shared memory segment, which shouldn't be that expensive...
> As I only found out about the existence of this session backend recently, > I'm wondering how widely it is used, and whether we wouldn't be better off > dropping it from php-src. The performance characteristics make it a pretty > big foot-gun.
It's probably not that well known, especially as I'm not sure underlying library is well maintained (it has been last updated in 2006 but maybe it's still good and doesn't need any updates?) but I'd give it a chance by at least trying to see what's up. If it proves hard then we may think about dropping it. -- Stas Malyshev smalyshev@gmail.com