Manual:$wgRateLimits

From MediaWiki.org
Jump to: navigation, search
Rate limiter: $wgRateLimits
Simple rate limiter options to brake edit floods.
Introduced in version: 1.4.5
Removed in version: still in use
Allowed values:
Default value: (see below)

Other settings: Alphabetical | By Function

Details[edit | edit source]

For this setting to work, it requires memcached.

This setting provides a simple rate limiter to brake floods of edits and other potentially destructive behavior, like sending out emails to other users. It sets a maximum number of actions allowed in the given number of seconds; after that, the violating client receives HTTP 500 error pages until the period elapses. To check if a rate limit has been exceeded, use the User::pingLimiter() function.

For example, to set a maximum of 4 edits per 60 seconds for "newbie" (i.e. non-autoconfirmed) users, add the following:

$wgRateLimits['edit']['newbie'] = array( 4, 60 );
The ip limit applies to both unregistered and "newbie" users. The newbie limit applies by action and user, and the ip limit by action and IP. So if you have many newbies using the same IP address, they all aggregate in the same count for the ip limit.

Default value[edit | edit source]

$wgRateLimits = array(
        'edit' => array(
                'anon' => null, // for any and all anonymous edits (aggregate)
                'user' => null, // for each logged-in user
                'newbie' => null, // for each recent (autoconfirmed) account; overrides 'user'
                'ip' => null, // for each anon and recent account
                'subnet' => null, // ... within a /24 subnet in IPv4 or /64 in IPv6
        ),
        'move' => array(
                'user' => null,
                'newbie' => null,
                'ip' => null,
                'subnet' => null,
        ),
        'mailpassword' => array( // triggering password resets emails
                'anon' => null,
        ),
        'emailuser' => array( // emailing other users using MediaWiki
                'user' => null,
        ),
        'linkpurge' => array( // purges of link tables
                'anon' => null,
                'user' => null,
                'newbie' => null,
                'ip' => null,
                'subnet' => null,
        ),
        'renderfile' => array( // files rendered via thumb.php or thumb_handler.php
                'anon' => null,
                'user' => null,
                'newbie' => null,
                'ip' => null,
                'subnet' => null,
        ),
);

Version differences[edit | edit source]

  • The 'mailpassword' array was added in MediaWiki 1.7.0.
  • The 'emailuser' array was added in MediaWiki 1.10.0.
  • The 'linkpurge' array was added in MediaWiki 1.22.0.
  • The 'renderfile' array was added in MediaWiki 1.22.0.

See also[edit | edit source]

Language: English  • français • русский