OPcache per user

Discussion in 'General' started by variable99, Feb 20, 2025.

  1. variable99

    variable99 Member

    Current default OPcache implementation is in-memory, shared. Some of my users expressed concern for performance as shared memory pool can be usurped by other users on the system.
    To solve such problem I can set pool per user:
    Code:
    php_admin_value[opcache.file_cache] = /var/www/user1/opcache
    But is this approach is correct? Where should I store opcache generated files and does open_basedir directive also must be modified?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I have not tried that, you might want to test it. In any case, I would suggest to use the private or temp dir of the website to store them instead.
     
    Last edited: Feb 20, 2025
  3. variable99

    variable99 Member

    If open_basedir allows access to user's tmp, will it allow to access sub-folders in that tmp also?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. open_basedir always includes subfolders. But I do not think that open_basedir is relevant to that setting.
     
  5. variable99

    variable99 Member

    Can confirm, I successfully enabled file cache per user. This mitigates:
    * Cache poisoning;
    * Problems with proper permission isolation in shared environment as SHM model is not fit for that.
     

Share This Page