How many (front-end user) accounts can Kirby handle!?

I have always wondered when Kirby starts to flinch regarding front-end users, for instance for a membership site or app built with Kirby CMS… :thinking:

Therefore, I developed a very simple benchmark Plug-in to create and find users by URL routes:

The creation of users was kind of time-consuming, but on the other hand, it is not very likely that there will be 10000+ visitors coming on your website at the same time for front-end registration. :sweat_smile:
(Except for your post on Reddit or Co. goes viral. :grimacing:)

Users Creation Time
1 ~0 Second
100 ~9 Seconds
1000 ~1 Minute 25 Seconds
10.000 ~17 Minutes
50.000 ~1 Hour 50 Minutes 25 Seconds

In case you want to play around with 50.000 users without creating them manually by yourself, I uploaded them in a .zip file attached to the assets of the latest release. :v:

I also totally underestimated the writing consumption for Kirby accounts, since every single account yields four elements. One dedicated folder for the user itself and three files! So 50.000 accounts make 200.000 elements - 50.000 folders and 150.000 files. :exploding_head:

… And here are some (non-scientific) results for finding Kirby CMS accounts:

(Accounts can be either searched by Email or by an attribute)
$user = kirby()->user($email);

or

$user = kirby()->users()->findBy('Candidate', $candidate);

:green_circle: = Found
:red_circle: = Not Found

Users :green_circle: by Email * :red_circle: by Email * :green_circle: by Attribute * :red_circle: by Attribute *
1 ~0 ~0 ~0 ~0
100 ~0 ~0 ~0 ~0
1000 ~0 ~0 ~0 ~0
10.000 ~2 ±1 ~3 ±1 ~2 ±1 ~4 ±1
50.000 ~25 ±5 ~35 ±5 ~35 ±7 ~37 ±5

* (in Seconds)

Also some Excel charts for illustration:



Conclusion:

Up to 1.000 front-end accounts should be no problem at all. Even for 10.000, it is okey-ish.
Of course, all the results are depending on your server. I did the test with Kirby´s Starterkit v3.5.7.1 on my local machine with an Intel i5-7300U and 8 GB RAM running laragon.

I hope you find those numbers as interesting as I do! :grin:

Have a great afternoon,
cheers!

Good morning, everyone! :tada:

I’m updating my earlier benchmark. This time, I used a much more powerful device, the latest version of Kirby, and PHP.


Testing Environment

For this benchmark, I used:

  • Hardware: Intel i5-13600K with 32GB RAM
    (Previous test: Intel i5-7300U with 8GB RAM)
  • Software:
    • Kirby Starterkit v4.5.0
    • PHP 8.3.1
    • laragon (as the local environment)

Keep in mind that the hardware upgrade significantly influences the results. However, the numbers still offer valuable insights into Kirby’s performance IMHO.


User Creation Times

Here’s how long it took to create user accounts this time:

Users Creation Time
1 ~0 Seconds
100 ~4 Seconds
1.000 ~44 Seconds
10.000 ~7 Minutes 45 Seconds
50.000 ~1 Hour 18 Minutes 55 Seconds

The new setup clearly excels, especially at scale, when compared to the previous benchmark. The structure is the same: each account generates one folder and three files, resulting in 200.000 elements for 50.000 users.


User Search Performance

This test shows how quickly Kirby could find or not find users by different criteria:

:green_circle: = Found
:red_circle: = Not Found

Users :green_circle: by UUID* :red_circle: by UUID* :green_circle: by Email* :red_circle: by Email* :green_circle: by Attribute* :red_circle: by Attribute*
1 ~0 ~0 ~0 ~0 ~0 ~0
100 ~0 ~0 ~0 ~0 ~0 ~0
1,000 ~0 ~0 ~0 ~0 ~0 ~0
10,000 ~1 ~1 ~1 ~1 ~1 ±1 ~3
50,000 ~7 ~7 ~10 ±2 ~13 ~31 ±3 ~58 ±1

* (in Seconds)




Key Observations

  1. Consistency at Scale
    Search times have become much more consistent compared to the 2021 benchmark. For instance, with 10.000 users, searches now average a constant 1 second, except for unmatched attribute search.
  2. Improved Performance
    Even with 50.000 accounts, the response times are much more stable. This suggests that Kirby’s data structures may have improved.
  3. Hardware Matters
    The upgraded test machine clearly helps, but the combination of the latest Kirby version and PHP enhancements plays a big role too.
  4. Decreased Performance for Unmatched Attribute Searches
    The only area where performance has slightly decreased is in searches for users by attributes when no match is found. While this decline is minor, it’s worth noting for large-scale implementations.

Conclusion

In 2021, I labeled 10,000 accounts as “okay-ish.” With Kirby’s latest version, a current PHP release, and sufficient computing power, I can confidently say it’s now absolutely fine—no flinch. :wink:

Happy New Year! I’m looking forward to more improvements in 2025. Cheers!