Skip to main content

PHP vs Perl

in category Diagnostics -> Perl Applications -> PHP vs Perl. Updated at Fri, 02 Feb 2024 13:00:00 EST

The lifespan of PHP vs Perl. Plus some Drupal bench tests. I was surprised by the results. Drupal wins this one by a long shot for now.


Every few months an update that probably affects some part of your PHP application is pushed out. Whether it's a PHP extension or the binary itself, a Symfony library, Composer, Drupal core or contrib modules, WordPress or it's plugins.. this list never ends. And along with that comes the CVE and the business compliance requirements so that you are more or less required to keep pace with these updates. Your PHP code starts to fail and shows deprecated errors that affect the performance of your project. And those errors, if not fixed, will cause your project to throw fatal errors when PHP does it's next major version upgrade, if not sooner. In other words, it will not run.

It's definitely a boon upfront to install something like Drupal on your web server and, after some fiddling, start publishing pages. Wow, web presence. I recall when WordPress and Drupal were new. They, along with other PHP cms apps were discussed in terms of 'this is great now you don't need to know how to code to build a website'. True, if everything you ever need to do is install modules and plugins, you can probably follow the directions of the small but ever growing community of that cms's users and, voila. That works. You sacrificed some performance to get that big app and all of it's bells and whistles going quickly but it's a very small price to pay for everything. Unless you installed tons of modules/plugins, that could really slow you down and it's not recommended. And if PHP never had a version update, life would be good. Your website would run forever and you could focus on real things like just securing it better, making it pretty, getting your related little services running and connected.. it's a perfect plan. But, we are talking about PHP. And PHP has gone through numerous mutations over the past couple decades as you might very well be aware. Apps that ran flawlessly just several years ago will no longer run and, like many others, instead of actually being able to just focus on running your business and following the original perfect plan outlined above you've had to stop and address website functionality issues instead. You've had to somewhat re-build what was already built, possibly multiple times. You've perhaps even had periods of downtime for certain services. The plugin you loved is obsolete and won't work at all anymore. Your Drupal theme was based on a sub-theme that no longer exists in core. The possibilities are endless. Far from perfect after all. And the cost is sometimes excessive, whether time or money, to always be required to keep things up-to-date per se.

I've worked for companies whose PHP apps, whether custom or pre-built like Drupal or WordPress, fail silently for several months or even a couple years before anyone even notices there is a problem. Employees come and go and the next guy doesn't even know how the application actually worked previously so if data is missing somewhere or a widget fails to display properly no one is the wiser. No one checked the logs. No one bothered to test the scripts. This was a fast, perfect build, remember? You thought had things running perfectly! Who ever thought that when they were coding with PHP5 that PHP7 and 8 would come along and attempt to put a halt to the loose typing that has always plagued PHP? Who even knew what that meant? I surely did not until doing lots of PHP coding and running into these issues over and over again. Alas, the predicament of a PHP app owner. And that predicament is probably not going to change soon. Though PHP8 is 'stricter' in a certain sense than PHP7 (or 5), PHP's past history foretells a similar future. Things are bound to change again and will we be prepared?

When I first started coding, PHP was not on anyone's radar. It did exist from what I can tell, but didn't really come into wide acceptance until about 2003-2004 with the advent of WordPress. I know Drupal existed first, but WordPress got real popular real fast. It was easy. Really easy. Instant website. And there was ModX in 2003. I built a site for someone with ModX in 2003. It was fast, it was cheap. You had to build out the front end yourself, no decent instant themes were offered. You had to get the mail going with your own scripts for the most part. But it was a framework and provided a real good starter framework for a PHP site. Drupal didn't come into my view until about 2005. I was still hearing not very flattering things about PHP through about 2006, that PHP was not secure, that it was unstable. The site I had built with ModX was not a business, it was only a website for a business, pictures, phone number, contact form. Typical old little business website. I could not afford security issues at my website, my personal work, code that I wrote for my own business, remained in Perl. But lots of people did build stuff with that old PHP4, PHP5 because it did work and it mixed easily with html and easy db connections were possible and PHP was truly capable of all sorts of stuff. PHP5 was impressive. But PHP never lost that reputation for being easy to tamper with, even until today. Probably for good reason.

I did start doing bunches of work with WordPress in 2007. But because of PHP problems, none of those early sites still exist except for the one simple ModX site I had built for my friend in 2003. Probably the simplicity of ModX saved it from the same early demise of many early WordPress websites.

And my Perl websites? They all still run just fine on newer versions of Perl. Yes, even the code I started writing in 1998, for the most part. There have been no CVE issues concerning any Perl modules that my apps might depend on. Perl has had some issues sure, nothing is perfect, but none of those issues ever affected me. CGI was removed from Perl core several years back, that was probably one of the biggest changes. But, rather than having to refactor the Perl apps, I just load CGI as a Perl module now. This app that is this blog is a Perl app I started coding back in 2012. It has taken several different forms since then, variations of the same thing mostly, re-arranging the code, adding new features, removing features etc. but the code base has not needed any 'updates' like PHP code always needs updates. The Perl itself, the Perl binary and core modules have probably gone through 16-18 minor version updates in those 12 years. I create a Bundle::Snapshot of all the modules and run that after a Perl version update and my code always, always runs without a hitch. I have never had to fix the code.

When you add SQL and MySQL, which have both followed a similar development route as PHP, into the picture, things start getting complicated. Suddenly the 'loosely' typed PHP issues become more difficult to track down. SQL has also become more restrictive over the years. There have been far too many cases of SQL injection or tampering of some sort resulting in breaches of networks and systems.

Scalar types, int, float, string, and bool were only introduced with PHP7. Perl has always defined these. With PHP8, even if empty variables are passed into an SQL query, a script will often fail in places. Those empty vars didn't bother PHP7 but the deprecated code warnings were there for a long time and should have been addressed. The ternary operator, ? : , is your best fix for this issue when defining variables from input.

Performance

I always thought my Perl apps outperformed PHP by a longshot. But recently, I loaded Drupal 10 and WordPress 6 on a local server, ran Apache bench against them and was truly impressed. But those were brand new installs with only the initial core modules and theme activated in Drupal 10 and no additional plugins or themes activated in WordPress6. That changed a lot after I did install modules, themes and plugins.

Let's run some tests against the apps installed on our local PI dev server. This is a PI 4 with 8GB RAM.

The dev version of technilogical:

└─$ ab -c1 -n50 http://tech.localnet/                                       
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking tech.localnet (be patient).....done


Server Software:        Apache
Server Hostname:        tech.localnet
Server Port:            80

Document Path:          /
Document Length:        13021 bytes

Concurrency Level:      1
Time taken for tests:   17.040 seconds
Complete requests:      50
Failed requests:        0
Total transferred:      663000 bytes
HTML transferred:       651050 bytes
Requests per second:    2.93 [#/sec] (mean)
Time per request:       340.798 [ms] (mean)
Time per request:       340.798 [ms] (mean, across all concurrent requests)
Transfer rate:          38.00 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       0
Processing:    46  340 422.1     50     965
Waiting:       46  336 423.8     50     965
Total:         46  341 422.1     51     966

Percentage of the requests served within a certain time (ms)
  50%     51
  66%    255
  75%    957
  80%    959
  90%    961
  95%    961
  98%    966
  99%    966
 100%    966 (longest request)



Drupal 10.2.0

└─$ ab -c1 -n50  https://drupal10.localnet/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking drupal10.localnet (be patient).....done


Server Software:        Apache
Server Hostname:        drupal10.localnet
Server Port:            443
SSL/TLS Protocol:       TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key:        X25519 253 bits
TLS Server Name:        drupal10.localnet

Document Path:          /
Document Length:        16403 bytes

Concurrency Level:      1
Time taken for tests:   1.547 seconds
Complete requests:      50
Failed requests:        13
   (Connect: 0, Receive: 0, Length: 13, Exceptions: 0)
Non-2xx responses:      13
Total transferred:      629523 bytes
HTML transferred:       609498 bytes
Requests per second:    32.31 [#/sec] (mean)
Time per request:       30.947 [ms] (mean)
Time per request:       30.947 [ms] (mean, across all concurrent requests)
Transfer rate:          397.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   12   1.1     11      15
Processing:     2   19   9.9     24      35
Waiting:        2   18   9.5     23      34
Total:         13   31  10.0     35      49

Percentage of the requests served within a certain time (ms)
  50%     35
  66%     36
  75%     37
  80%     37
  90%     39
  95%     39
  98%     49
  99%     49
 100%     49 (longest request)


It's amazing, the disparity. But the technilogical build has content. Not much, but it does have content that is retrieved from a database. That matters. There is no shopping cart here. Lets see what happens when I install some contrib modules into Drupal.

I added 1 page and 2 short articles. I added 1 comment. I have installed several contrib modules and have everything ready to install the Commerce module and some of it's components.

I used Composer to update to the newest Drupal core, 10.2.2. This my bench test now:

$ ab -c1 -n50  https://drupal10.localnet/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking drupal10.localnet (be patient).....done


Server Software:        Apache
Server Hostname:        drupal10.localnet
Server Port:            443
SSL/TLS Protocol:       TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key:        X25519 253 bits
TLS Server Name:        drupal10.localnet

Document Path:          /
Document Length:        18725 bytes

Concurrency Level:      1
Time taken for tests:   6.642 seconds
Complete requests:      50
Failed requests:        0
Total transferred:      959851 bytes
HTML transferred:       936250 bytes
Requests per second:    7.53 [#/sec] (mean)
Time per request:       132.844 [ms] (mean)
Time per request:       132.844 [ms] (mean, across all concurrent requests)
Transfer rate:          141.12 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       10   11   1.3     11      19
Processing:    68  121 352.9     71    2567
Waiting:       68  120 352.7     70    2564
Total:         79  133 354.0     82    2585

Percentage of the requests served within a certain time (ms)
  50%     82
  66%     83
  75%     84
  80%     85
  90%     87
  95%     88
  98%   2585
  99%   2585
 100%   2585 (longest request)

I've lost some speed. Quite a bit actually and I am just getting started. I get Commerce to mostly install and but when I try to install the checkout component I get this error message:
Unable to install Commerce Checkout due to unmet dependencies: core.entity_view_display.commerce_product_variation.default.summary (commerce_product.commerce_product_variation_type.default)

There is a problem adding products and product variations. I am not sure this Commerce Checkout module is working in Drupal 10.

  1. Create a store
  2. Try to add an order, follow through and create customer
  3. Add order item type
  4. Add order type
  5. Add product variation type
  6. Add product type

After doing all of that I am now getting 'The website encountered an unexpected error. Try again later.' everywhere I turn. I will try to rebuild. Nope, nogo. Check the log:

AH01071: Got error 'PHP message: Uncaught PHP Exception Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorageException: "Table information not available for the 'stores' field." at /srv/www/drupal-10.2.0/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php line 392', referer: https://drupal10.localnet/admin/commerce/config/product-types

My quick easy store just got complicated. https://www.drupal.org/project/commerce/issues/3104218

$ drush pm:list
 --------------------- --------------------------------------------------------- ---------- ------------ 
  Package               Name                                                      Status     Version     
 --------------------- --------------------------------------------------------- ---------- ------------ 
  Core                  Actions UI (action)                                       Disabled   10.2.2      
  Core                  Announcements (announcements_feed)                        Enabled    10.2.2      
  Core                  Automated Cron (automated_cron)                           Enabled    10.2.2      
  Core                  Ban (ban)                                                 Disabled   10.2.2      
  Web services          HTTP Basic Authentication (basic_auth)                    Disabled   10.2.2      
  Core                  BigPipe (big_pipe)                                        Enabled    10.2.2      
  Core                  Block (block)                                             Enabled    10.2.2      
  Core                  Block Content (block_content)                             Enabled    10.2.2      
  Core                  Book (book)                                               Disabled   10.2.2      
  Core                  Breakpoint (breakpoint)                                   Enabled    10.2.2      
  Core                  CKEditor 5 (ckeditor5)                                    Enabled    10.2.2      
  Core                  Comment (comment)                                         Enabled    10.2.2      
  Core                  Configuration Manager (config)                            Enabled    10.2.2      
  Multilingual          Configuration Translation (config_translation)            Disabled   10.2.2      
  Core                  Contact (contact)                                         Enabled    10.2.2      
  Core                  Content Moderation (content_moderation)                   Disabled   10.2.2      
  Multilingual          Content Translation (content_translation)                 Enabled    10.2.2      
  Core                  Contextual Links (contextual)                             Enabled    10.2.2      
  Field types           Datetime (datetime)                                       Enabled    10.2.2      
  Field types           Datetime Range (datetime_range)                           Disabled   10.2.2      
  Core                  Database Logging (dblog)                                  Enabled    10.2.2      
  Core                  Internal Dynamic Page Cache (dynamic_page_cache)          Enabled    10.2.2      
  Core                  Text Editor (editor)                                      Enabled    10.2.2      
  Core                  Field (field)                                             Enabled    10.2.2      
  Core (Experimental)   Field Layout (field_layout)                               Disabled   10.2.2      
  Core                  Field UI (field_ui)                                       Enabled    10.2.2      
  Field types           File (file)                                               Enabled    10.2.2      
  Core                  Filter (filter)                                           Enabled    10.2.2      
  Core                  Forum (forum)                                             Disabled   10.2.2      
  Core                  Help (help)                                               Enabled    10.2.2      
  Core (Experimental)   Help Topics (help_topics)                                 Disabled   10.2.2      
  Core                  History (history)                                         Enabled    10.2.2      
  Field types           Image (image)                                             Enabled    10.2.2      
  Core                  Inline Form Errors (inline_form_errors)                   Disabled   10.2.2      
  Web services          JSON:API (jsonapi)                                        Disabled   10.2.2      
  Multilingual          Language (language)                                       Enabled    10.2.2      
  Core                  Layout Builder (layout_builder)                           Disabled   10.2.2      
  Core                  Layout Discovery (layout_discovery)                       Disabled   10.2.2      
  Field types           Link (link)                                               Enabled    10.2.2      
  Multilingual          Interface Translation (locale)                            Disabled   10.2.2      
  Core                  Media (media)                                             Disabled   10.2.2      
  Core                  Media Library (media_library)                             Disabled   10.2.2      
  Core                  Custom Menu Links (menu_link_content)                     Enabled    10.2.2      
  Core                  Menu UI (menu_ui)                                         Enabled    10.2.2      
  Migration             Migrate (migrate)                                         Disabled   10.2.2      
  Migration             Migrate Drupal (migrate_drupal)                           Disabled   10.2.2      
  Migration             Migrate Drupal UI (migrate_drupal_ui)                     Disabled   10.2.2      
  Core                  MySQL (mysql)                                             Enabled    10.2.2      
  Core                  Node (node)                                               Enabled    10.2.2      
  Field types           Options (options)                                         Enabled    10.2.2      
  Core                  Internal Page Cache (page_cache)                          Enabled    10.2.2      
  Core                  Path (path)                                               Enabled    10.2.2      
  Core                  Path alias (path_alias)                                   Enabled    10.2.2      
  Core                  PostgreSQL (pgsql)                                        Disabled   10.2.2      
  Core                  Password Compatibility (phpass)                           Disabled   10.2.2      
  Core                  Responsive Image (responsive_image)                       Disabled   10.2.2      
  Web services          RESTful Web Services (rest)                               Disabled   10.2.2      
  Core (Experimental)   Single Directory Components (sdc)                         Disabled   10.2.2      
  Core                  Search (search)                                           Enabled    10.2.2      
  Web services          Serialization (serialization)                             Disabled   10.2.2      
  Core                  Settings Tray (settings_tray)                             Disabled   10.2.2      
  Core                  Shortcut (shortcut)                                       Enabled    10.2.2      
  Core                  SQLite (sqlite)                                           Disabled   10.2.2      
  Core                  Statistics (statistics)                                   Disabled   10.2.2      
  Core                  Syslog (syslog)                                           Disabled   10.2.2      
  Core                  System (system)                                           Enabled    10.2.2      
  Core                  Taxonomy (taxonomy)                                       Enabled    10.2.2      
  Field types           Telephone (telephone)                                     Disabled   10.2.2      
  Field types           Text (text)                                               Enabled    10.2.2      
  Core                  Toolbar (toolbar)                                         Enabled    10.2.2      
  Core                  Tour (tour)                                               Disabled   10.2.2      
  Core                  Activity Tracker (tracker)                                Disabled   10.2.2      
  Core                  Update Manager (update)                                   Enabled    10.2.2      
  Core                  User (user)                                               Enabled    10.2.2      
  Core                  Views (views)                                             Enabled    10.2.2      
  Core                  Views UI (views_ui)                                       Enabled    10.2.2      
  Core                  Workflows (workflows)                                     Disabled   10.2.2      
  Core (Experimental)   Workspaces (workspaces)                                   Disabled   10.2.2      
  Field types           Address (address)                                         Enabled    2.0.0       
  Spam control          CAPTCHA (captcha)                                         Enabled                
  Spam control          Image CAPTCHA (image_captcha)                             Enabled                
  Commerce              Commerce (commerce)                                       Enabled    8.x-2.37    
  Commerce              Commerce Cart (commerce_cart)                             Enabled    8.x-2.37    
  Commerce              Commerce Checkout (commerce_checkout)                     Disabled   8.x-2.37    
  Commerce              Commerce Log (commerce_log)                               Enabled    8.x-2.37    
  Commerce              Commerce Number Pattern (commerce_number_pattern)         Enabled    8.x-2.37    
  Commerce              Commerce Order (commerce_order)                           Enabled    8.x-2.37    
  Commerce              Commerce Payment (commerce_payment)                       Enabled    8.x-2.37    
  Commerce              Commerce Payment Example (commerce_payment_example)       Enabled    8.x-2.37    
  Commerce              Commerce Price (commerce_price)                           Enabled    8.x-2.37    
  Commerce              Commerce Product (commerce_product)                       Enabled    8.x-2.37    
  Commerce              Commerce Promotion (commerce_promotion)                   Enabled    8.x-2.37    
  Commerce              Commerce Store (commerce_store)                           Enabled    8.x-2.37    
  Commerce              Commerce Tax (commerce_tax)                               Enabled    8.x-2.37    
  Other                 Components (components)                                   Disabled               
  Development           Devel (devel)                                             Disabled               
  Development           Devel Generate (devel_generate)                           Disabled               
  Other                 Entity (entity)                                           Enabled    8.x-1.4     
  Field types           Entity Reference Revisions (entity_reference_revisions)   Enabled    8.x-1.11    
  Fields                Inline Entity Form (inline_entity_form)                   Enabled    3.0.0-rc19  
  Field Types           JSON2HTML (json2html)                                     Disabled               
  Other                 Pathauto (pathauto)                                       Enabled                
  Filters               PHP Filter (php)                                          Disabled   8.x-1.1     
  Other                 Profile (profile)                                         Enabled    8.x-1.7     
  Other                 State Machine (state_machine)                             Enabled    8.x-1.10    
  Other                 Token (token)                                             Enabled    8.x-1.13    
  Other                 Twig Tweak (twig_tweak)                                   Enabled                
  Views                 Views Custom Table (view_custom_table)                    Disabled               
  Views                 Views JSON Source (views_json_source)                     Enabled                
  Core                  Claro (claro)                                             Enabled    10.2.2      
  Core                  Olivero (olivero)                                         Enabled    10.2.2      
  Core                  Stable 9 (stable9)                                        Disabled   10.2.2      
  Core                  Stark (stark)                                             Disabled   10.2.2      
                        starterkit_theme (starterkit_theme)                       Disabled   10.2.2      
 --------------------- --------------------------------------------------------- ---------- ------------ 

The Drupal 10 build really is broken at this point, I cannot access the admin area and drush will not uninstall Promotions which might be preventing the other modules from installing correctly. So, based on an error message that complained ''In DefaultTableMapping.php line 392: Table information not available for the 'stores' field",
I did this: $ vi core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php and I commented out line 392 and now I can reach the admin area. I will try to uninstall things via the GUI. I got this message when pulling the site up finally: Schema information for module commerce_product was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, commerce_product_update_8212().

I was able to get to the site Status Report and I see this:

Entity/field definitions
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Product

    The Product entity type needs to be installed.

Product attribute value

    The Product attribute value entity type needs to be installed.

Product variation

    The Product variation entity type needs to be installed.

Product type

    The Product type entity type needs to be installed.

Product variation type

    The Product variation type entity type needs to be installed.

Product attribute

    The Product attribute entity type needs to be installed.

I am using Drush Commandline Tool 12.4.3.0 and commands that should work do not seem to work.

Command "upe" is not defined. Command "upec" is not defined.

$ composer require 'drupal/entity_update:^3.0' Now it works, $ vendor/bin/drush upe --show -> commerce_product . Change(s) : 1

Now I am able to do all these entity updates and finally I can see the main Commerce page. Here are the commands I used:

  1. vendor/bin/drush upe commerce_product
  2. vendor/bin/drush upe commerce_product_attribute_value
  3. vendor/bin/drush upe commerce_product_variation
  4. vendor/bin/drush upe commerce_product_type
  5. vendor/bin/drush upe commerce_product_variation_type
  6. vendor/bin/drush upe commerce_product_attribute

Finally, I can run the uninstall command for Promotions via drush and it works. I had to use drush here, I was unable to disable this module via the admin GUI.

$ vendor/bin/drush pm:uninstall commerce_promotion
[success] Successfully uninstalled: commerce_promotion

And if I go to Extend I see that the Commerce Promotions module shows as uninstalled here as well. I'll do this one also: $ vendor/bin/drush pm:uninstall commerce_cart
[success] Successfully uninstalled: commerce_cart
and I'll take a tour through Commerce to check that every page is available in the config. Then I'll try to uncomment the one line in core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php (392) and check again to see if everything is working before proceeding. And even though I have caching disabled I will clear the cache as well.

$ vendor/bin/drush pm:install commerce_cart

In PreExistingConfigException.php line 65:
                                                                                                                                                              
  Configuration objects (core.entity_view_mode.commerce_product_attribute_value.add_to_cart) provided by commerce_cart already exist in active configuration  
                                                                                                                                                              

$ vendor/bin/drush upe --show
 -> ALl Entities are up to date

$ vendor/bin/drush config-delete commerce_product_attribute_value.add_to_cart
 [error]  Config commerce_product_attribute_value.add_to_cart does not exist 
$ vendor/bin/drush config-delete core.entity_view_mode.commerce_product_attribute_value.add_to_cart
$  vendor/bin/drush pm:install commerce_cart
 [success] Successfully enabled: commerce_cart

I can now access /admin/commerce again and everything seems to be working I don't see anymore errors. I did uncomment the DefaultTableMapping.php file, hopefully the error does not return. I will leave Promotions uninstalled, the previous errors seemed to show up with that component. We can manage promotions a different way.

This was a bit of a chore, the install order really should have been handled by the Commerce installer and the missing entities as well. Anyway we are running without errors so let's get back to bench testing before moving forward.

And Drupal 10 looks good!

$ ab -c1 -n50 https://drupal10.localnet/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking drupal10.localnet (be patient).....done


Server Software:        Apache
Server Hostname:        drupal10.localnet
Server Port:            443
SSL/TLS Protocol:       TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key:        X25519 253 bits
TLS Server Name:        drupal10.localnet

Document Path:          /
Document Length:        18754 bytes

Concurrency Level:      1
Time taken for tests:   4.131 seconds
Complete requests:      50
Failed requests:        0
Total transferred:      962300 bytes
HTML transferred:       937700 bytes
Requests per second:    12.10 [#/sec] (mean)
Time per request:       82.629 [ms] (mean)
Time per request:       82.629 [ms] (mean, across all concurrent requests)
Transfer rate:          227.46 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   11   1.1     11      16
Processing:    69   71   1.3     71      75
Waiting:       67   70   1.3     70      74
Total:         79   82   1.7     82      90

Percentage of the requests served within a certain time (ms)
  50%     82
  66%     83
  75%     83
  80%     84
  90%     84
  95%     85
  98%     90
  99%     90
 100%     90 (longest request)

This is also a real good indication that Commerce is properly installed. Commerce is not fully configured though and we have zero stores/products and only 3 pages/articles. I am still impressed with the bench test. This is good news. If this setup remains stable then Drupal appears to have won this match at least for today. Despite all the early problems, and this entire thing did take about 6-8 hours to install Commerce, debug it, fix, get going again up to this point but it would have taken much longer that that to write this shopping cart in Perl. I am sure there are some security issues in the Commerce code, perhaps elsewhere also. We can fix those another day. If the PHP code is written with attention to types it will probably run (mostly/entirely) without issues when PHP9 rolls out. And if I run into this issue in another Drupal 10 build I can follow these steps to fix it pretty quickly.

I'm running Drupal on Apache2 with php-fpm8.3. Your server configuration will affect performance for better or worse. My Apache config can be replaced by Nginx or any other web server you prefer to deploy your PHP apps.

WordPress 6 did not fare so well, by the way, after a shopping cart was installed. It worked great but it was real slow. But that's a story for another day.

Keywords
wordpress, drupal, php cms, php app, perl catalyst, perl mvc, php mvc