Jump to navigation Jump to search

About this board

Selecting a Redis database ID to use?

Bctrainers (talkcontribs)


I looked over the code (from what i could see for Redis), and did not come across a function or setting that could be set in the array (wgObjectCaches / wgJobTypeConf) section to define what database to store data to. Right now, MediaWiki is storing all redis data in database 0 - which well, isn't quite ideal for my setup. I would like to have it stored in a database that is non-zero.

In doing so, I've attempted using the traditional way of appending /12 to the server array segment in the form of

From $wgObjectCaches['redis'] = array(

'servers'           => array( '' ),

From 'redisServer' within $wgJobTypeConf['default'] = [

  => array( '' ),

This does not work, and causes sessions to fail, and ultimately causes a 503 on the nginx server (running php 7.3 fpm).

So i come here to ask this... is there any support for MediaWiki to use a set database ID on Redis?

2403:5800:9100:BE00:550:55BC:EFE5:644A (talkcontribs)
Reply to "Selecting a Redis database ID to use?"

Redis consuming too much memory - maxmemory_policy?

3 (talkcontribs)

I previously assumed that MediaWiki sets expiration for keys, but seeing the memory usage of redis baloon I realize I was probably wrong - my wiki just isn't that big. Now, Redis' default policy is 'noeviction', but at least mediawiki-vagrant's default is 'volatile-lru'. Which should I use? Does MediaWiki handle expiration at all? TIA.

FreedomFighterSparrow (talkcontribs)

Should have logged in...

SterlingGraceTech (talkcontribs)

Can anyone help with this? I'm experiencing the same issue. Redis has 1 GB configured for memory and crashed a couple weeks after being installed to handle job queue, sessions and cache. I had to dump all keys in redis manually using redis-cli in order to get this to work...

I configured with volatile-lru and 3 weeks later logins start failing again but this time redis logs look normal (ie. just saving to disk every 5 minutes).

Why doesn't mediawiki have better management for expiring keys, this seems like it should be one of the first considerations when planning this functionality. Can the devs weigh in on whether this is on the roadmap or if there's some configuration we're missing?

Can someone explain what the right configuration is for maxmemory-policy?

I worry the most about losing scheduled jobs. Can someone provide a command that can be run from the redis-cli to selectively remove cache and/or session keys but leave the job queue keys alone?

Reply to "Redis consuming too much memory - maxmemory_policy?"

What's a good connectTimeout when 'persistent' => true, ?

Zoglun (talkcontribs)

Assume the php-fpm process last 5000 s long. and I set 'persistent'        => true,

Is it better to set 'connectTimeout' => 5000, instead of default 1s?

Reply to "What's a good connectTimeout when 'persistent' => true, ?"
PJosepherum (talkcontribs)

The instructions do not make clear that in order for Redis to handle the job queue, mediawiki-services-jobrunner is required or else a critical error will occur:

Exception from line 92 of /var/www/html/w/includes/jobqueue/JobQueueRedis.php: Non-daemonized mode is no longer supported. Please install the mediawiki/services/jobrunner service and update $wgJobTypeConf as needed.

I have found the service required, but the instructions are not clear and installation is not intuitive for end-users. Puppet does not appear simple or necessary to install for most users, and it is not immediately obvious that the service is simply a script which needs to be perpetually run.

I am thinking I may be able to develop a solution by modifying the config available at into a systemd service or init script by some other means.

Any ideas or support would be appreciated as Redis has been suggested as a more responsive cache system for use with some of Extension:Semantic MediaWiki's new features.

Toniher (talkcontribs)

I think I managed to make it work with a code like this:

$wgJobTypeConf['default'] = [
        'class'       => 'JobQueueRedis',
        'redisServer' => "",
        'redisConfig' => [
                'connectTimeout' => 1
        'daemonized' => true


Basically by adding daemonized => true.

Kghbln (talkcontribs)

That's great news that you got it working. I will try to set up redis for the sandbox wiki.

FreedomFighterSparrow (talkcontribs)

"mediawiki/services/jobrunner" appears to be Wikimedia's way of continuosly running the job queue; AFAIK it's still possible to run it using cron and/or $wgJobRunRate. So adding 'daemonized' => true should indeed be enough. I'm still testing this.

Reply to "redisJobRunnerService"
Oborseth~mediawikiwiki (talkcontribs)

Is there any explanation on how "automaticFailOver" works? How would one configure this to failover automatically?

This post was posted by Oborseth~mediawikiwiki, but signed as Oborseth.

Reply to "Automatic Failover"
Toniher (talkcontribs)
Reply to "Job queue"
There are no older topics