open_base_dir and Joomla performance

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
User avatar
fatica
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Jan 19, 2007 10:32 pm
Contact:

open_base_dir and Joomla performance

Post by fatica » Tue Jul 06, 2021 1:33 pm

Hi all,

Posting here to raise the visibility of the tremendous impact of the open_base_dir setting in php on Joomla performance. We saw huge performance gains in CPU utilization when removing the open_base_dir restrictions we had previously set.

This rather epic bug report shows the background of this long-standing issue:
https://bugs.php.net/bug.php?id=52312

Obviously there's a security trade-off here, but we saw a nearly 50% drop in average CPU utilization, TTFB, etc. open_base_dir is important to protect security from file inclusions hacks, especially if you're running a lot of untrusted code (e.g. extensions).

This issue crosses all modern versions of PHP. Just an FYI.
You do not have the required permissions to view the files attached to this post.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24986
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: open_base_dir and Joomla performance

Post by pe7er » Tue Jul 06, 2021 2:33 pm

Interesting! Thanks for this info!

Maybe your performance decrease has to do with Realpath cache. I found some bug reports regarding "Realpath cache" which is apparently disabled when open_basedir is set.
Some technical info https://github.com/Whissi/realpath_turbo
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

User avatar
fatica
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Jan 19, 2007 10:32 pm
Contact:

Re: open_base_dir and Joomla performance

Post by fatica » Tue Jul 06, 2021 3:08 pm

Yes, that is the same issue. open_base_dir or safemode kills the realpath cache, effectively halving Joomla performance. This isn't necessarily Joomla specific, but any CMS or application that leverages a lot of files & includes as in Joomla, Magento, etc.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30940
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: open_base_dir and Joomla performance

Post by Per Yngve Berg » Tue Jul 06, 2021 4:44 pm

open_base_dir is not used widely anymore. It's a relic from the past.

Use Linux User Permissions to the folders together with cgi or fpm-cgi web server to php interface. A separate user for each site prevents cross contamination.

User avatar
fatica
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Jan 19, 2007 10:32 pm
Contact:

Re: open_base_dir and Joomla performance

Post by fatica » Tue Jul 06, 2021 7:01 pm

Yes, I am also a relic from the past, but it doesn't mean there aren't scores of articles that recommend enabling open_basedir restrictions as a security measure *including Joomla's own security checklist* and I feel folks should know the cost of that setting in Joomla.


https://docs.joomla.org/Special:MyLangu ... en_basedir


Locked

Return to “Performance - Joomla! 3.x”