Jump to content

Manual talk:$wgMaxArticleSize

Add topic
From mediawiki.org
Latest comment: 1 year ago by Nicole Sharp in topic testing MaxArticleSize

WMF configuration

[edit]

Configured as follows in WMF InitialiseSettings.php:

'wgMaxArticleSize' => array(
	# Increased from 1024 to 2000 to alleviate problems with template expansion
	# limits in AfD archives -- TS
	'default' => 2000,
),

Leucosticte (talk) 21:05, 24 August 2012 (UTC)Reply

Updated info on WMF config

[edit]

Wikimedia uses MediaWiki's default value (as of Sept 2018, this is 2048). -- ArielGlenn (talk) 12:26, 10 September 2018 (UTC)Reply

Ambiguous and confusing

[edit]

The variable name refers to "ArticleSize", and the prose refers to "the text of the revision" and "page size", all suggesting that this is about file size. But the prose also speaks of post-expand include size, a completely different animal. Since max PEIS is in fact 2048 kB, one might reasonably conclude that this is about PEIS, not file size. But the ambiguity has added some confusion to an already-confused situation, and it should be eliminated by clarification of the prose (I understand that a change to a better variable name could be problematic). Mandruss (talk) 01:21, 26 February 2020 (UTC)Reply

Kilobytes or Kibibytes

[edit]

I did not understand if the limit is 2,048 kilobytes as indicated on this page or 2,048 kibibytes as indicated here. ZandDev (talk) 19:07, 6 April 2022 (UTC)Reply

It's kibibytes, since the article length value is divided by 1024 when comparing with this value. Ciencia Al Poder (talk) 19:55, 6 April 2022 (UTC)Reply

testing MaxArticleSize

[edit]

I was able to use Microsoft Copilot to create a nifty Microsoft Windows 11 PowerShell script that will extract a desired number of digits for pi (the Archimedean constant) to test MaxArticleSize with.

You can download the first 1 billion digits of pi from Archive.org. But most applications will crash if you try to open the 1 GB text file, including the web browser if you try to copy and paste it to MediaWiki. However, the PowerShell script below will access the file and extract the desired number of digits in less than a second with a decent processor and enough RAM. I tested this on the MediaWiki.org Sandbox using the 4 MB text file to copy and paste and encountered the expected error message for MaxArticleSize. Extracting the digits with PowerShell from the downloaded file is I think a little bit easier than number-crunching to compute the desired digits. The actual number of digits is one less than the number of characters since a period is the second character.

$inputFilePath = "D:\pi.txt"
$outputFilePath = "D:\pi4.txt"
$maxChars = 2 * 2048 * 1024
$reader = [System.IO.StreamReader]::new($inputFilePath)
try {
$buffer = New-Object char[] $maxChars
$count = $reader.Read($buffer, 0, $maxChars)
[System.IO.File]::WriteAllText($outputFilePath, -join $buffer[0..($count-1)])
} finally {
$reader.Close()
}
Write-Output "Extraction complete.  Output saved to: $outputFilePath"

Nicole Sharp (talk) 11:51, 15 January 2025 (UTC)Reply