GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Jit for Opcache · Issue #96 · EngineScript/EngineScript

Jit for Opcache #96

New issue
Copy link
New issue
Copy link
Closed
Closed
Jit for Opcache#96
Copy link

Description

@jakobmelti
jakobmelti
opened on Nov 14, 2025
Issue body actions

Hello, how are you? thank you for your good project,

i have a question how can i enable JIT in opcache?

; A note on OpCache JIT WordPress Performance:
; For typical web applications with I/O-bound workloads (e.g., database queries or API calls), the performance gains from JIT may be minimal.
; JIT is more beneficial for CPU-bound workloads (e.g., heavy computations, number crunching).
; It is recommended to benchmark your specific application with and without JIT enabled to determine its impact.
;opcache.jit=tracing
;opcache.jit_buffer_size=SEDOPCACHEJITBUFFER
;opcache.lockfile_path=/tmp
;opcache.log_verbosity_level=1
;opcache.max_file_size=0
;opcache.mmap_base=
;opcache.opt_debug_level=0
;opcache.preferred_memory_model=
;opcache.preload=
;opcache.preload_user=
;opcache.protect_memory=0
;opcache.restrict_api=
;opcache.validate_permission=0
;opcache.validate_root=0

What should to uncomment ? everything ?

Activity

  1. github-actions commented on Nov 14, 2025

    @github-actions
    github-actionsBot
    on Nov 14, 2025 – with GitHub Actions
    More actions

    Thanks for opening an issue in EngineScript! 🚀

    To help us better understand your issue, please run the following command on your server:

    es.debug

    This command will generate a detailed report including:

    • System information
    • Software versions
    • Configuration settings
    • Service status
    • Network information

    ⚠️ Important Privacy Note
    Before sharing the debug output, please review and remove any sensitive information that you don't want to share publicly. This may include:

    • IP addresses
    • Hostnames
    • Domain names
    • Usernames
    • Passwords or API keys (though es.debug tries to avoid these)

    The debug report is saved to a file (the path will be shown when the command finishes) and formatted specifically for GitHub.
    After reviewing and sanitizing the content, please edit your original issue description to include the debug output, or paste it in a new comment below.

    We'll review your issue soon!

  2. github-actions commented on Nov 14, 2025

    @github-actions
    github-actionsBot
    on Nov 14, 2025 – with GitHub Actions
    More actions

    🤖 Gemini Issue Analysis

    Hello @jakobmelti,

    Thank you for reaching out. As a LEMP stack automation specialist, I'm happy to help you with enabling Opcache JIT. You've correctly identified the configuration section, and your question about which lines to uncomment is a good one.

    You do not need to uncomment everything. For a standard setup, you only need to enable two specific directives.

    Summary of Solution

    To enable Opcache JIT, you need to uncomment and configure opcache.jit and opcache.jit_buffer_size in your PHP configuration file. The other settings are for advanced tuning or debugging and can be left as they are.


    Step-by-Step Instructions

    Here is a detailed guide to get JIT up and running correctly.

    1. Locate and Edit the Opcache Configuration File

    The Opcache settings are usually in a dedicated .ini file. Based on the EngineScript environment, it's likely located here:
    /etc/php/[YOUR_PHP_VERSION]/fpm/conf.d/99-opcache.ini

    • Replace [YOUR_PHP_VERSION] with the version you are using (e.g., 8.4).
    • Open the file for editing with root privileges:
      sudo nano /etc/php/8.4/fpm/conf.d/99-opcache.ini

    2. Modify the JIT Directives

    Find the section you posted in your issue. You only need to change the following two lines:

    • opcache.jit: This directive enables the JIT compiler. The tracing value is highly recommended as it provides a good balance between performance and compilation overhead for web applications.
    • opcache.jit_buffer_size: This allocates a specific amount of memory for the compiled code. JIT will not run without this. The SEDOPCACHEJITBUFFER is a placeholder used by the automation script. You should replace it with a real value. A good starting point for a typical website is 128M.

    Uncomment these two lines and set the buffer size. Your configuration should look like this:

    ; A note on OpCache JIT WordPress Performance: 
    ; For typical web applications with I/O-bound workloads (e.g., database queries or API calls), the performance gains from JIT may be minimal. 
    ; JIT is more beneficial for CPU-bound workloads (e.g., heavy computations, number crunching).
    ; It is recommended to benchmark your specific application with and without JIT enabled to determine its impact.
    opcache.jit=tracing
    opcache.jit_buffer_size=128M
    ;opcache.lockfile_path=/tmp
    ;opcache.log_verbosity_level=1
    ;... (the rest can remain commented out)

    3. Restart PHP-FPM to Apply Changes

    After saving the file, you must restart the PHP-FPM service for the new configuration to be loaded.

    sudo systemctl restart php8.4-fpm

    (Remember to use your specific PHP version in the command.)

    4. Verify JIT is Active

    You can confirm that JIT is enabled in two ways:

    • Using phpinfo(): Create a file named info.php in your website's root directory with the content <?php phpinfo(); ?>. When you access this file in your browser, scroll down to the opcache section. You should see that JIT is On.

      (Remember to delete this file after you're done for security reasons.)

    • Using the command line:

      php -i | grep "opcache.jit"

      The output should show opcache.jit => tracing => tracing and opcache.jit_buffer_size => 134217728 (which is 128M in bytes).

    As the comments in your configuration file correctly state, it's wise to benchmark your application's performance before and after this change to measure the actual impact. Good luck

    Analysis performed by Gemini AI on Fri Nov 14 22:44:37 UTC 2025

  3. PDowney commented on Nov 16, 2025

    @PDowney
    PDowney
    on Nov 16, 2025
    Collaborator
    More actions

    You'll need to uncomment:

    ;opcache.jit=tracing
    ;opcache.jit_buffer_size=SEDOPCACHEJITBUFFER
    

    The calculation method we use for the buffer size is based on the server's total memory size. These can be found below:

    # Calculate pm.max_children based on available memory
      if [[ "${AVAILABLE_MEMORY}" -lt 1200 ]]; then
        PHP_FPM_MAX_CHILDREN=8
        PHP_MEMORY_LIMIT="256M"
        OPCACHE_JIT_BUFFER="64M"
        OPCACHE_INT_BUFFER=16
      elif [[ "${AVAILABLE_MEMORY}" -lt 2200 ]]; then
        PHP_FPM_MAX_CHILDREN=16
        PHP_MEMORY_LIMIT="256M"
        OPCACHE_JIT_BUFFER="64M"
        OPCACHE_INT_BUFFER=16
      elif [[ "${AVAILABLE_MEMORY}" -lt 4200 ]]; then
        PHP_FPM_MAX_CHILDREN=24
        PHP_MEMORY_LIMIT="512M"
        OPCACHE_JIT_BUFFER="96M"
        OPCACHE_INT_BUFFER=64
      else
        PHP_FPM_MAX_CHILDREN=48
        PHP_MEMORY_LIMIT="512M"
        OPCACHE_JIT_BUFFER="128M"
        OPCACHE_INT_BUFFER=64
      fi
    

    As a warning though:

    "For typical web applications with I/O-bound workloads (e.g., database queries or API calls), the performance gains from JIT may be minimal. In such cases, other optimizations, like database indexing or caching, may yield better results."

    If you're running WordPress, you'll likely want to leave JIT disabled and allow that memory to remain available for MariaDB and PHP.

  4. EngineScript
    deleted a comment from github-actions on Nov 17, 2025
  5. PDowney
    pinned this issue on Nov 17, 2025
  6. jakobmelti
    closed this as completedon Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.