Index Several Search API Solr Servers and Indexes at Once

One session per server or per index

Several servers and indexes

Every drush ost run is a session. A session is named after its server, or after its server and index when you pass --index. Each session has its own log, process ID, state and chunk files, so several sessions can run side by side.

Several servers

List your servers, then name the one you want every time. Left out, --server means the first enabled Solr server, which may not be the one you meant.

drush search-api:server-list

drush ost --server=production_solr --workers=8
drush ost --server=staging_solr --workers=4

drush oss
drush osstop --server=staging_solr

Several indexes of one server

Without --index, a session does the server's indexes one after another. To run two at the same time, start one session per index:

drush ost --index=content_index --workers=6
drush ost --index=taxonomy_index --workers=2
One index, one session
Do not run a server session and an index session for the same index at the same time. Both would take the same waiting items and index them twice.

Share the machine

Workers of all sessions run on the same machine and talk to the same database. Keep the total (8 + 4 in the first example) within what the machine can carry: Workers and batch size.

drush oss shows every running session. drush osstop --server=... stops one; read what it does to the others on drush osstop.

Everyday tasks