[{"data":1,"prerenderedAt":720},["ShallowReactive",2],{"navigation":3,"/docs/configuration/customizing-the-image":92,"/docs/configuration/customizing-the-image-surround":715},[4],{"title":5,"path":6,"stem":7,"children":8,"page":39},"Docs","/docs","docs",[9,25,40,60,76,84],{"title":10,"path":11,"stem":12,"children":13,"icon":24},"Getting Started","/docs/getting-started","docs/1.getting-started/1.index",[14,16,20],{"title":15,"path":11,"stem":12},"Introduction",{"title":17,"path":18,"stem":19},"Quick start","/docs/getting-started/quick-start","docs/1.getting-started/2.quick-start",{"title":21,"path":22,"stem":23},"Running from source","/docs/getting-started/running-from-source","docs/1.getting-started/3.running-from-source","i-lucide-rocket",{"title":26,"icon":27,"path":28,"stem":29,"children":30,"page":39},"Configuration","i-lucide-settings-2","/docs/configuration","docs/2.configuration",[31,35],{"title":32,"path":33,"stem":34},"Adding a real database","/docs/configuration/adding-databases","docs/2.configuration/1.adding-databases",{"title":36,"path":37,"stem":38},"Customizing the image","/docs/configuration/customizing-the-image","docs/2.configuration/2.customizing-the-image",false,{"title":41,"path":42,"stem":43,"children":44,"icon":59},"Image variations","/docs/image-variations","docs/3.image-variations/1.index",[45,47,51,55],{"title":46,"path":42,"stem":43},"Choosing a variation",{"title":48,"path":49,"stem":50},"FPM-NGINX","/docs/image-variations/fpm-nginx","docs/3.image-variations/2.fpm-nginx",{"title":52,"path":53,"stem":54},"FrankenPHP","/docs/image-variations/frankenphp","docs/3.image-variations/3.frankenphp",{"title":56,"path":57,"stem":58},"FPM-Apache","/docs/image-variations/fpm-apache","docs/3.image-variations/4.fpm-apache","i-lucide-layers",{"title":61,"path":62,"stem":63,"children":64,"icon":75},"Benchmarks & Methodology","/docs/benchmarks","docs/4.benchmarks/1.index",[65,67,71],{"title":66,"path":62,"stem":63},"Methodology",{"title":68,"path":69,"stem":70},"Reading your results","/docs/benchmarks/reading-your-results","docs/4.benchmarks/2.reading-your-results",{"title":72,"path":73,"stem":74},"Testing from your own machine","/docs/benchmarks/testing-from-your-own-machine","docs/4.benchmarks/3.testing-from-your-own-machine","i-lucide-flask-conical",{"title":77,"path":78,"stem":79,"children":80,"icon":83},"Community Results","/docs/community-results","docs/5.community-results/1.index",[81],{"title":82,"path":78,"stem":79},"Submitting your results","i-lucide-users",{"title":85,"path":86,"stem":87,"children":88,"icon":91},"FAQ","/docs/faq","docs/6.faq/1.index",[89],{"title":90,"path":86,"stem":87},"Frequently asked questions","i-lucide-circle-help",{"id":93,"title":36,"body":94,"description":708,"extension":709,"links":710,"meta":711,"navigation":334,"path":37,"redirect":710,"seo":712,"sitemap":713,"stem":38,"__hash__":714},"docs/docs/2.configuration/2.customizing-the-image.md",{"type":95,"value":96,"toc":698},"minimark",[97,109,114,269,277,281,292,627,633,637,640,678,684,688,694],[98,99,100,101,108],"p",{},"BenchKit is built on the ",[102,103,107],"a",{"href":104,"rel":105},"https://serversideup.net/open-source/docker-php",[106],"nofollow","serversideup/php"," images, and inherits their environment variables. You can change how PHP is configured and run again without rebuilding anything, which is what makes BenchKit useful for learning rather than only for measuring.",[110,111,113],"h2",{"id":112},"common-settings-to-change","Common settings to change",[115,116,122],"pre",{"className":117,"code":118,"filename":119,"language":120,"meta":121,"style":121},"language-yaml shiki shiki-themes github-dark","services:\n  benchkit:\n    image: serversideup/benchkit-laravel:latest\n    ports:\n      - \"80:8080\"\n    environment:\n      # OPcache, which BenchKit turns on by default\n      PHP_OPCACHE_ENABLE: \"1\"\n      PHP_OPCACHE_JIT: \"tracing\"\n      PHP_OPCACHE_MEMORY_CONSUMPTION: \"256\"\n      # PHP itself\n      PHP_MEMORY_LIMIT: \"512M\"\n      # The FPM pool, on the fpm-nginx and fpm-apache variations\n      PHP_FPM_PM_CONTROL: \"dynamic\"\n      PHP_FPM_PM_MAX_CHILDREN: \"20\"\n","docker-compose.yml","yaml","",[123,124,125,138,146,159,167,176,184,191,202,213,224,230,241,247,258],"code",{"__ignoreMap":121},[126,127,130,134],"span",{"class":128,"line":129},"line",1,[126,131,133],{"class":132},"s4JwU","services",[126,135,137],{"class":136},"s95oV",":\n",[126,139,141,144],{"class":128,"line":140},2,[126,142,143],{"class":132},"  benchkit",[126,145,137],{"class":136},[126,147,149,152,155],{"class":128,"line":148},3,[126,150,151],{"class":132},"    image",[126,153,154],{"class":136},": ",[126,156,158],{"class":157},"sU2Wk","serversideup/benchkit-laravel:latest\n",[126,160,162,165],{"class":128,"line":161},4,[126,163,164],{"class":132},"    ports",[126,166,137],{"class":136},[126,168,170,173],{"class":128,"line":169},5,[126,171,172],{"class":136},"      - ",[126,174,175],{"class":157},"\"80:8080\"\n",[126,177,179,182],{"class":128,"line":178},6,[126,180,181],{"class":132},"    environment",[126,183,137],{"class":136},[126,185,187],{"class":128,"line":186},7,[126,188,190],{"class":189},"sAwPA","      # OPcache, which BenchKit turns on by default\n",[126,192,194,197,199],{"class":128,"line":193},8,[126,195,196],{"class":132},"      PHP_OPCACHE_ENABLE",[126,198,154],{"class":136},[126,200,201],{"class":157},"\"1\"\n",[126,203,205,208,210],{"class":128,"line":204},9,[126,206,207],{"class":132},"      PHP_OPCACHE_JIT",[126,209,154],{"class":136},[126,211,212],{"class":157},"\"tracing\"\n",[126,214,216,219,221],{"class":128,"line":215},10,[126,217,218],{"class":132},"      PHP_OPCACHE_MEMORY_CONSUMPTION",[126,220,154],{"class":136},[126,222,223],{"class":157},"\"256\"\n",[126,225,227],{"class":128,"line":226},11,[126,228,229],{"class":189},"      # PHP itself\n",[126,231,233,236,238],{"class":128,"line":232},12,[126,234,235],{"class":132},"      PHP_MEMORY_LIMIT",[126,237,154],{"class":136},[126,239,240],{"class":157},"\"512M\"\n",[126,242,244],{"class":128,"line":243},13,[126,245,246],{"class":189},"      # The FPM pool, on the fpm-nginx and fpm-apache variations\n",[126,248,250,253,255],{"class":128,"line":249},14,[126,251,252],{"class":132},"      PHP_FPM_PM_CONTROL",[126,254,154],{"class":136},[126,256,257],{"class":157},"\"dynamic\"\n",[126,259,261,264,266],{"class":128,"line":260},15,[126,262,263],{"class":132},"      PHP_FPM_PM_MAX_CHILDREN",[126,265,154],{"class":136},[126,267,268],{"class":157},"\"20\"\n",[270,271,274],"tip",{"target":272,"to":273},"_blank","https://serversideup.net/open-source/docker-php/docs/reference/environment-variable-specification",[98,275,276],{},"Every variable in the serversideup/php environment variable specification works in BenchKit. The specification is the full list.",[110,278,280],{"id":279},"settings-without-an-environment-variable","Settings without an environment variable",[98,282,283,284,287,288,291],{},"The specification covers most of what you would reach for, but not everything in ",[123,285,286],{},"php.ini"," has a variable. When you need one that doesn't, add your own ",[123,289,290],{},".ini"," file. You can mount it at runtime or bake it into an image.",[293,294,296,467],"tabs",{"sync":295},"php-ini",[297,298,301,304],"tabs-item",{"icon":299,"label":300},"i-lucide-file-cog","Mount a file",[98,302,303],{},"Nothing to build. Edit the file, restart the container, run again. This is usually what you want, since a BenchKit server is temporary anyway.",[305,306,308,372],"code-tree",{"default-value":307},"zzz-custom-php.ini",[115,309,313],{"className":310,"code":311,"filename":307,"language":312,"meta":121,"style":121},"language-ini shiki shiki-themes github-dark","; Files in conf.d load alphabetically. The zzz prefix puts this after\n; the file serversideup/php writes from your environment variables,\n; so anything set here wins where the two overlap.\n\n; realpath_cache_ttl has a variable (PHP_REALPATH_CACHE_TTL).\n; realpath_cache_size does not, so it belongs here.\n; Both values below are raised from the PHP defaults of 4096K and 5.\nrealpath_cache_size = 16384K\n\nopcache.max_wasted_percentage = 10\n","ini",[123,314,315,320,325,330,336,341,346,351,360,364],{"__ignoreMap":121},[126,316,317],{"class":128,"line":129},[126,318,319],{"class":189},"; Files in conf.d load alphabetically. The zzz prefix puts this after\n",[126,321,322],{"class":128,"line":140},[126,323,324],{"class":189},"; the file serversideup/php writes from your environment variables,\n",[126,326,327],{"class":128,"line":148},[126,328,329],{"class":189},"; so anything set here wins where the two overlap.\n",[126,331,332],{"class":128,"line":161},[126,333,335],{"emptyLinePlaceholder":334},true,"\n",[126,337,338],{"class":128,"line":169},[126,339,340],{"class":189},"; realpath_cache_ttl has a variable (PHP_REALPATH_CACHE_TTL).\n",[126,342,343],{"class":128,"line":178},[126,344,345],{"class":189},"; realpath_cache_size does not, so it belongs here.\n",[126,347,348],{"class":128,"line":186},[126,349,350],{"class":189},"; Both values below are raised from the PHP defaults of 4096K and 5.\n",[126,352,353,357],{"class":128,"line":193},[126,354,356],{"class":355},"snl16","realpath_cache_size",[126,358,359],{"class":136}," = 16384K\n",[126,361,362],{"class":128,"line":204},[126,363,335],{"emptyLinePlaceholder":334},[126,365,366,369],{"class":128,"line":215},[126,367,368],{"class":355},"opcache.max_wasted_percentage",[126,370,371],{"class":136}," = 10\n",[115,373,375],{"className":117,"code":374,"filename":119,"language":120,"meta":121,"style":121},"services:\n  benchkit:\n    image: serversideup/benchkit-laravel:latest\n    ports:\n      - \"80:8080\"\n    environment:\n      # Variables still work alongside the file\n      PHP_OPCACHE_ENABLE: \"1\"\n    volumes:\n      - ./zzz-custom-php.ini:/usr/local/etc/php/conf.d/zzz-custom-php.ini:ro\n      - benchkit-runs:/var/www/html/storage/app/runs\n\nvolumes:\n  benchkit-runs:\n",[123,376,377,383,389,397,403,409,415,420,428,435,442,449,453,460],{"__ignoreMap":121},[126,378,379,381],{"class":128,"line":129},[126,380,133],{"class":132},[126,382,137],{"class":136},[126,384,385,387],{"class":128,"line":140},[126,386,143],{"class":132},[126,388,137],{"class":136},[126,390,391,393,395],{"class":128,"line":148},[126,392,151],{"class":132},[126,394,154],{"class":136},[126,396,158],{"class":157},[126,398,399,401],{"class":128,"line":161},[126,400,164],{"class":132},[126,402,137],{"class":136},[126,404,405,407],{"class":128,"line":169},[126,406,172],{"class":136},[126,408,175],{"class":157},[126,410,411,413],{"class":128,"line":178},[126,412,181],{"class":132},[126,414,137],{"class":136},[126,416,417],{"class":128,"line":186},[126,418,419],{"class":189},"      # Variables still work alongside the file\n",[126,421,422,424,426],{"class":128,"line":193},[126,423,196],{"class":132},[126,425,154],{"class":136},[126,427,201],{"class":157},[126,429,430,433],{"class":128,"line":204},[126,431,432],{"class":132},"    volumes",[126,434,137],{"class":136},[126,436,437,439],{"class":128,"line":215},[126,438,172],{"class":136},[126,440,441],{"class":157},"./zzz-custom-php.ini:/usr/local/etc/php/conf.d/zzz-custom-php.ini:ro\n",[126,443,444,446],{"class":128,"line":226},[126,445,172],{"class":136},[126,447,448],{"class":157},"benchkit-runs:/var/www/html/storage/app/runs\n",[126,450,451],{"class":128,"line":232},[126,452,335],{"emptyLinePlaceholder":334},[126,454,455,458],{"class":128,"line":243},[126,456,457],{"class":132},"volumes",[126,459,137],{"class":136},[126,461,462,465],{"class":128,"line":249},[126,463,464],{"class":132},"  benchkit-runs",[126,466,137],{"class":136},[297,468,471,478,565],{"icon":469,"label":470},"i-simple-icons-docker","Build an image",[98,472,473,474,477],{},"Use this when you want the configuration to travel with the image, or when your host builds from a ",[123,475,476],{},"Dockerfile"," rather than pulling one.",[305,479,480,517],{"default-value":476},[115,481,485],{"className":482,"code":483,"filename":476,"language":484,"meta":121,"style":121},"language-dockerfile shiki shiki-themes github-dark","# The tag you build from decides the web server, exactly as it does\n# when you pull the image directly.\nFROM serversideup/benchkit-laravel:latest\n\nCOPY zzz-custom-php.ini /usr/local/etc/php/conf.d/\n","dockerfile",[123,486,487,492,497,505,509],{"__ignoreMap":121},[126,488,489],{"class":128,"line":129},[126,490,491],{"class":189},"# The tag you build from decides the web server, exactly as it does\n",[126,493,494],{"class":128,"line":140},[126,495,496],{"class":189},"# when you pull the image directly.\n",[126,498,499,502],{"class":128,"line":148},[126,500,501],{"class":355},"FROM",[126,503,504],{"class":136}," serversideup/benchkit-laravel:latest\n",[126,506,507],{"class":128,"line":161},[126,508,335],{"emptyLinePlaceholder":334},[126,510,511,514],{"class":128,"line":169},[126,512,513],{"class":355},"COPY",[126,515,516],{"class":136}," zzz-custom-php.ini /usr/local/etc/php/conf.d/\n",[115,518,519],{"className":310,"code":311,"filename":307,"language":312,"meta":121,"style":121},[123,520,521,525,529,533,537,541,545,549,555,559],{"__ignoreMap":121},[126,522,523],{"class":128,"line":129},[126,524,319],{"class":189},[126,526,527],{"class":128,"line":140},[126,528,324],{"class":189},[126,530,531],{"class":128,"line":148},[126,532,329],{"class":189},[126,534,535],{"class":128,"line":161},[126,536,335],{"emptyLinePlaceholder":334},[126,538,539],{"class":128,"line":169},[126,540,340],{"class":189},[126,542,543],{"class":128,"line":178},[126,544,345],{"class":189},[126,546,547],{"class":128,"line":186},[126,548,350],{"class":189},[126,550,551,553],{"class":128,"line":193},[126,552,356],{"class":355},[126,554,359],{"class":136},[126,556,557],{"class":128,"line":204},[126,558,335],{"emptyLinePlaceholder":334},[126,560,561,563],{"class":128,"line":215},[126,562,368],{"class":355},[126,564,371],{"class":136},[115,566,571],{"className":567,"code":568,"filename":569,"language":570,"meta":121,"style":121},"language-bash shiki shiki-themes github-dark","docker build -t benchkit-custom .\n\ndocker run -p 80:8080 \\\n  -v benchkit-runs:/var/www/html/storage/app/runs \\\n  benchkit-custom\n","Terminal","bash",[123,572,573,592,596,612,622],{"__ignoreMap":121},[126,574,575,579,582,586,589],{"class":128,"line":129},[126,576,578],{"class":577},"svObZ","docker",[126,580,581],{"class":157}," build",[126,583,585],{"class":584},"sDLfK"," -t",[126,587,588],{"class":157}," benchkit-custom",[126,590,591],{"class":157}," .\n",[126,593,594],{"class":128,"line":140},[126,595,335],{"emptyLinePlaceholder":334},[126,597,598,600,603,606,609],{"class":128,"line":148},[126,599,578],{"class":577},[126,601,602],{"class":157}," run",[126,604,605],{"class":584}," -p",[126,607,608],{"class":157}," 80:8080",[126,610,611],{"class":584}," \\\n",[126,613,614,617,620],{"class":128,"line":161},[126,615,616],{"class":584},"  -v",[126,618,619],{"class":157}," benchkit-runs:/var/www/html/storage/app/runs",[126,621,611],{"class":584},[126,623,624],{"class":128,"line":169},[126,625,626],{"class":157},"  benchkit-custom\n",[270,628,630],{"target":272,"to":629},"https://serversideup.net/open-source/docker-php/docs/customizing-the-image/changing-common-php-settings",[98,631,632],{},"The serversideup/php guide to changing PHP settings covers this in more depth, including how to replace the default configuration outright rather than layer on top of it.",[110,634,636],{"id":635},"turning-a-setting-into-an-experiment","Turning a setting into an experiment",[98,638,639],{},"Because these are environment variables, you can measure what any one of them is worth on your own hardware.",[641,642,644,649,656,660,663,667],"steps",{"level":643},"3",[645,646,648],"h3",{"id":647},"run-with-the-setting-off","Run with the setting off",[98,650,651,652,655],{},"Start BenchKit with the setting disabled, for example ",[123,653,654],{},"PHP_OPCACHE_ENABLE=0",", and run a benchmark.",[645,657,659],{"id":658},"run-with-the-setting-on","Run with the setting on",[98,661,662],{},"Restart with the setting enabled and run the same benchmark again.",[645,664,666],{"id":665},"compare-the-two-runs","Compare the two runs",[98,668,669,670,674,675,677],{},"Open both runs in ",[671,672,673],"strong",{},"Compare",". The environment panel shows the ",[123,676,286],{}," values that were in effect for each one, which tells you exactly which change produced the difference.",[679,680,681],"warning",{},[98,682,683],{},"OPcache is the setting that changes the numbers most. With it disabled, PHP recompiles your source on every request, and every other measurement on the page is describing that instead of the thing you meant to test. BenchKit warns you before a run starts if it detects OPcache is off.",[110,685,687],{"id":686},"choosing-the-web-server","Choosing the web server",[98,689,690,691,693],{},"Which web server runs is decided by the image variation you pull, not by an environment variable. See ",[102,692,41],{"href":42},".",[695,696,697],"style",{},"html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":121,"searchDepth":140,"depth":140,"links":699},[700,701,702,707],{"id":112,"depth":140,"text":113},{"id":279,"depth":140,"text":280},{"id":635,"depth":140,"text":636,"children":703},[704,705,706],{"id":647,"depth":148,"text":648},{"id":658,"depth":148,"text":659},{"id":665,"depth":148,"text":666},{"id":686,"depth":140,"text":687},"Tune PHP, OPcache, and the web server with environment variables, or add your own php.ini.","md",null,{},{"title":36,"description":708},{"loc":37},"HiostIazyRmLUp8caG1Dd8wIUI-M8yZafBRRNRrIa9I",[716,718],{"title":32,"path":33,"stem":34,"description":717,"children":-1},"Point BenchKit at MySQL, MariaDB, or Postgres instead of the default SQLite.",{"title":46,"path":42,"stem":43,"description":719,"children":-1},"BenchKit ships the same application on three web servers and every PHP version it supports. The image tag picks both.",1786740096072]