DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:scalability

Scalability and Performance

This page tries to collect some information about how DokuWiki scales when it becomes “big” and what the limiting factors are.

95% of everyone considering using DokuWiki will not even need to bother reading this page. Unless you want to run a public wiki for a very popular topic or want to use some very underpowered hardware performance should not be a problem for you.

As of June 2020, the largest known Dokuwiki installation is over 743,000 pages and there are 25 known wikis with over 100,000 pages1).

Limiting Factors

Pages

The number of pages is not limited. Some people have hundreds of thousands pages in their wiki and no problems at all, but it all “depends”.

Your Filesystem will have limits. Commonly there's a limit on how many files can be in a single directory. DokuWiki uses directories for namespaces. So if you namespace your pages you can mitigate the problem. Keep in mind that each revision of a page creates its own file in a directory.

The question how many files can be stored on different file systems was answered here: https://stackoverflow.com/questions/466521/how-many-files-can-i-put-in-a-directory

Of course you are limited by disk space. Of course media files, pages and older revisions will take up space. However the data/cache directory can grow quite big over the years - depending on the wiki size a cache directory of a few Gigabytes is not uncommon. By definition everything in the cache directory is optional so you can delete it's contents on the penalty of a small speed reduction until the cache is refilled.

Inodes

Unix/Linux servers may also have a limit on the number of inodes, which are metadata for each file on the server. Running out of available inodes can interrupt the normal functioning of your server. To reduce the number of inodes used, you can reduce the amount of files used (for example, it might make sense to remove attic files that are over X years old depending on the use case).

Mediafiles

Basically everything said for pages is also true for media files.

Since the media manager does not do paging (currently), it is recommended to make use of namespaces to organize the mediafiles. Loading hundreds of thumbnails is going to be slow.

Mediafiles are resized through PHP's libGD mechanism by default. A more efficient way may be to use ImageMagick via the im_convert option.

In the early days of DokuWiki, search used to be the limiting factor. Back in the day, a search would simply go through all available pages and look for the searched term - the more pages you had, the slower that was.

Today, DokuWiki uses an index based search. That search index makes searching much faster since a term is simply looked up in the index and the results are immediately available. The index is word based, sorted by word lengths. So a search for a full word is faster than a search for a word part (using the * syntax).

In theory, the limiting factor for the index based search is the memory_limit in your PHP setup. Part of the index is a list of all pages in the wiki - this list needs to be loaded completely into RAM. In reality I never heard anyone having this problem.

Disk I/O

DokuWiki relies heavily on files for storing everything. The most significant speed update you can achieve is using an SSD for your setup.

Modern Operating Systems will cache disk access to frequently used files in memory. The more RAM your server has, the more is available to be used as file system cache.

DokuWiki does a lot of scanning for different files that may not exist. For example we check each plugin directory for the existence of a script.js file. Those non-hits may add up to some significant amounts on very busy Setups.

We try to avoid whole directory scans as much as possible, but sometimes it's necessary. The readdircache option may help mitigate the problem somewhat.

The reliance on the filesystem however makes it extremely difficult to run a DokuWiki on multiple servers. For performance reasons, it is not recommended to use a network filesystem.

Disabling access time recording in your filesystem may be a good idea to decrease IO load.

PHP Version

Each and every new PHP version gets better and faster. There is a huge difference between PHP 5 and 7, and some smaller differences between the different minor versions of 7. Always use the best version available to you!

Webserver

The Webserver needs to pass requests to PHP. We recommend using mod_php or FPM for that. FastCGI is slower. Unfortunately FastCGI seems to be the only option when using IIS, so if you can use something else - do so.

Mitigations

The above already gives a few hints on where you may experience bottlenecks. Here is a list of further reading on how to mitigate problems when they occur.

  • use better hardware - sometimes simply upgrading to a better server (more RAM, SSD) is the simplest solution
  • use a dedicated search engine
  • improve end user caching

See also

Experiences

We'd like to collect some real world number of “big” installations here. If you are running a larger installation, please let us know about your setup here. Especially if you ran into scaling problems and solved them.

dokuwiki.org has currently 4859 pages with about 15k pageviews per day on average
still on PHP 5.6, Linux/ext4 with noatime, Apache + FPM
running on a i7-6700 CPU with 64GB of RAM and SSD. That server is running all kinds of other DokuWiki services besides the wiki itself. Everything's fine and snappy.
Andreas Gohr 2019-02-28 12:23
I am also curious if there are other “big” DokuWiki sites in the world, or perhaps DokuWiki.org itself may be a candidate of the trophy. But it seems hard to find evidence or real statistics isn't it?
[Off-topic] I myself is also wondering how such big DokuWiki sites are organized and run.
MilchFlasche 2019-04-02 10:58
devel/scalability.txt · Last modified: 2023-03-11 13:17 by 178.38.198.28

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki