Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 767934 - mod_perl refusing to accept threaded MPM
Summary: mod_perl refusing to accept threaded MPM
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-30 06:52 UTC by dan
Modified: 2021-01-31 22:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2021-01-30 06:52:41 UTC
According to https://perl.apache.org/docs/2.0/user/performance/mpm.html, mod_perl 2.0 is perfectly capable running in the thread MPM. but the ebuild is configured to FORCE prefork mpm. This is wrong not only because the page above clearly states that mod_perl works with threads, but also the prefork MPM disallows the http2 module. So you can use prefork OR http2, but not both.

Can we please get the ebuild changed to allow the thread MPM for apache?

Thanks!
Comment 1 Ionen Wolkens gentoo-dev 2021-01-31 04:15:05 UTC
>configured to FORCE prefork mpm
What I see is:
    !ithreads? ( www-servers/apache[-apache2_mpms_event,-apache2_mpms_worker,apache2_mpms_prefork] )

Which means this forcing only happens with USE=-ithreads, could you try setting it? (will be needed on perl as well)

On a side-note, make sure to run "perl-cleaner --reallyall" after flipping that ithreads flag on perl, ebuild will give some warnings too.
Comment 2 dan 2021-01-31 07:17:18 UTC
I see, but since I never specifically set -ithreads that seems counterintuitive. Can't we get the system to default to ithreads UNLESS the ithreads flag is specifically removed (-ithreads)?
Comment 3 Ionen Wolkens gentoo-dev 2021-01-31 15:07:33 UTC
As I understand it interpreter-based threads (ithreads) on perl is rarely needed for modern software, and perl upstream discourage its use[1], and it also cause ABI compatibility issues thus the whole rebuilding issue.

The flag exists for old software that need it, but being default may not be preferable.

[1] https://perldoc.perl.org/threads#WARNING
Comment 4 dan 2021-01-31 22:05:48 UTC
I can see that. The question is, what method allows both mod_perl stability AND http2 support? The Prefork MPM doesn't support http2, and the threads module isn't safe according to the docs on the site. But for mod_perl those seem to be the only options. I suppose you could enable multiple MPMs and then only use one of them. I always preferred threaded approach because it's more efficient. 

Correct me if I'm wrong, but just because ithreads is enabled doesn't necessarily mean that you will automatically use the ithreads method, right? Obviously if I disable the ithreads flag on perl and on mod_perl then mod_perl is going to force prefork, which is what I'm trying to avoid since prefork doesn't support http2. That leaves worker and event. Worker may work, but it's the least efficent of the Apache MPMs. So If I specifically enable the event MPM but leave mod_perl and perl with ithreads enabled in the use so that mod_perl won't try to force prefork, is that going to be safe?
Comment 5 Ionen Wolkens gentoo-dev 2021-01-31 22:29:02 UTC
Being discouraged doesn't mean it can't be used or necessarily unsafe (assuming adequate use by the software). It's just not suitable to be a default, especially given most users don't need ithreads.

If this is what you need, then there should be no problems enabling it beside the one time inconvenience.

Feel free to re-open as unconfirmed if you believe you need more clarification, I'll assign this to the perl team instead that will be more qualified to answer.