Skip to content

Simple Puppeteer script to try to measure DDEV performance

License

Notifications You must be signed in to change notification settings

ddev/ddev-puppeteer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddev-puppeteer

Simple Puppeteer script for measuring DDEV performance.

This tries to use a DDEV Drupal 11 project as a measure of performance using a web install of the demo_umami profile.

  • Make sure you have installed chromium somehow, and export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true.
  • If you don't have it installed, use sudo apt install chromium-browser or brew install chromium or whatever is appropriate for your system. On Apple Silicon, brew install chromium --no-quarantine (see blog). These are better than letting puppeteer download its own version of Chromium.
  • Since you have manually installed chromium, export PUPPETEER_EXECUTABLE_PATH="$(which chromium)" to set the path to the chromium executable.
  • Install with npm init && npm i puppeteer async.
  • The project named in ddev-puppeteer.js should be a standard Drupal 11 install as per the DDEV Drupal 11 quickstart
  • Edit site and sitedir in ddev-puppeteer.js.
  • Set up the project with Mutagen or Colima or whatever permutation you like.
  • The project should already be running.
  • Run the test with node ddev-puppeteer.js.

Notes

  • This is using the Drupal demo_umami profile, which takes longer than standard.
  • The script resets php-fpm at the beginning to make sure we start without a PHP OPcache. This may or may not be fair.
  • To see what’s happening in the install you can change puppeteer.launch({headless: true}) to puppeteer.launch({headless: false}).
  • The Drush install is ddev mysql -e "DROP DATABASE IF EXISTS db; CREATE DATABASE db;" && ddev exec killall -USR2 php-fpm && rm -rf web/sites/default/files/* && ddev mutagen sync && time ddev drush si demo_umami -y
  • Links:

Thanks

Thanks so much to @froboy and his inspiring measurements in https://gist.github.com/froboy/f237bf62cfde5350c0849c6e9aab0c71

About

Simple Puppeteer script to try to measure DDEV performance

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •