Running XLoader workers on a separate server

A separate XLoader worker host takes DataStore loading off your web servers. This page covers what that host needs, how queue names route jobs to it, and how to size timeouts for large files.

On this page

When a separate XLoader worker server is worth running

A separate XLoader worker server moves DataStore loading to its own host, so large file loads stop competing with page traffic on the web servers. Consider an illustrative portal team whose resource uploads take a long time to reach the DataStore while the same web servers also handle dataset pages, search and public API requests. XLoader is the officially supported loader for uploaded or linked files. CKAN places each loading job in Redis, and a worker process picks it up and writes the rows into the DataStore database. Running the worker on the web hosts is the simplest layout and may be enough when uploads are small or infrequent and loads finish without slowing the site. Confirm that with evidence before adding hosts: time loads during your busiest upload windows and watch whether page response times or the job backlog grow while they run.

Teams usually need a separate worker host when several conditions meet: files are large enough that loads run for a long time, many resources are uploaded or linked at once, the public site has heavy traffic in the same hours, or the team wants to restart or upgrade workers without touching the web tier. Treat each condition as something to measure. Record job durations, queue length and web response times across normal days and bulk publishing periods. If loads slow pages or jobs wait in the queue for long stretches, a worker host addresses the problem directly. If the numbers stay flat, a second host adds patching, monitoring and credential work that buys little.

Before you choose the layout, decide which queues each host will consume. The ckanext.xloader.queue_names setting controls the queues a worker listens on, and its default is default. If the web hosts and the new host both listen on that default queue, jobs can run on either machine, so the new host does not isolate loads by itself. Confirm how job routing to a named queue works in your CKAN and XLoader versions before you rely on it. The new host needs a CKAN install, the same CKAN config file, and access to Redis and the database. Check the setup steps in the ckanext-xloader repository before you build the host.

How web servers, Redis, workers and the DataStore database connect

The diagram starts on the web servers, where a user uploads a file and CKAN queues a loading job in Redis. The job waits on the queue named by ckanext.xloader.queue_names, and a dedicated XLoader worker host picks it up. The worker host sits inside the boundary box, reads the job and writes the table into the DataStore PostgreSQL database. The Data API reads from that same database to serve queries. When you review the setup, confirm that the worker can reach Redis and the database, and that its queue names match what the web servers expect.

Upload queues a job in Redis, a separate worker writes to the DataStore database.

Which worker layout and queue settings fit your portal

This table compares three ways to run XLoader loading, from jobs sharing the web servers to workers listening on their own queues. Read each row against your upload volume and how many large files may load at once. The main takeaway: a worker only picks up jobs from the queues it listens on, so ckanext.xloader.queue_names must be the same on the web and worker hosts.

LayoutWhen it fitsUpload waits and resource contentionWhat to confirm
Loading on the web serversSmall portals with few uploads, where one host can serve pages and run loadsLoads compete with page requests for CPU, memory and database connections on the same hostConfirm that large loads finish within your job timeout and that page response times hold during loading
Dedicated worker host on the same networkPortals where loads queue up or slow pages, and you want loads off the web serversUploads wait for the worker to free up, while web servers keep their resources for page requestsConfirm the worker has CKAN, the same CKAN config file, and network access to Redis and the database
Dedicated worker hosts on separate queuesLarge portals with mixed loads, such as very large files kept apart from routine small updatesWaits depend on which queue a job lands in and how many workers listen to that queueConfirm each queue has at least one listening worker and that queue names are set deliberately on every host
Queue name settingEvery layout that uses a workerA job is only picked up by a worker listening on its queue, so a mismatch can leave uploads waitingckanext.xloader.queue_names defaults to 'default' and must match between the web and worker hosts
Job timeout on workersAny layout that loads files larger than your typical uploadWorker resources limit how many large loads run at once, so timeouts may need tuning per hostConfirm the job timeout on each host matches the size of the largest files you expect to load
Redis and database accessEvery worker hostA blocked connection to Redis or the CKAN database stops jobs from startingConfirm each worker reaches the same Redis and database as the web servers through your network rules

What a separate worker host needs installed and reachable

A worker host needs a full CKAN installation, and the XLoader extension alone is not enough. The ckanext-xloader project lists four requirements for a separate worker: CKAN installed, the CKAN config file, Redis access and database access. The config file matters most. Copy the file the portal uses, including ckan.plugins and the ckanext.datastore connection settings, so the worker loads the same extensions and reaches the same DataStore database with the same users. Then keep the config file identical on both hosts after every change. A drifted copy can leave the worker writing to a different database from the one the portal reads, and that failure is easy to miss because jobs may still appear to complete.

Install the worker from the same source steps you use for the portal. The CKAN install from source guide lists Python 3.10 or newer, PostgreSQL 12 or newer, Solr and Redis as prerequisites, so confirm the Python version on the worker matches the portal before you start anything. Confirm that Redis is reachable from the worker's network segment and that the worker can open connections to the DataStore database. The worker runs jobs and serves no pages, so it does not need a public web front end. The uWSGI and Nginx layer the guide recommends for production web serving may not belong on that host. Confirm this against your deployment, and ask your platform team whether the worker needs Solr access in your setup.

Setting up a separate XLoader worker server step by step

This sequence brings a separate XLoader worker host online so DataStore loading runs off the web servers. Each step ends with a check you can run, starting with version and connectivity checks and finishing with a test resource loaded into the DataStore. Run the steps in order, because a worker without Redis or database access cannot pick up jobs.

  1. Match the CKAN version on the worker

    Install CKAN on the worker host at the same version as your web servers, including the same major and minor release and the same patch level. Use the source install path in the CKAN documentation and meet its prerequisites, including Python 3.10 or newer and a PostgreSQL client that can reach your database. Mismatched code between hosts makes job failures harder to trace, so confirm the match before you continue. Check: run the CKAN version command on both hosts and confirm the output is identical.

  2. Share the same config file

    Give the worker the same ckan.ini that the web servers read, either by copying the file or mounting it from shared storage. Keep it identical so the database, Redis, site URL and plugin settings match, and confirm that ckanext-xloader is installed on the worker at the same version as the portal. Keep secrets out of version control and set file permissions so only the service account can read the file. Check: run a CKAN command against the file on the worker and confirm it loads without configuration errors and includes the xloader plugin.

  3. Confirm Redis and database connectivity

    From the worker host, test the network path to the Redis server and to the PostgreSQL databases named in the config file. The worker needs Redis to receive jobs and database access to write loaded rows into the DataStore, so both must succeed from this host and from its own network address. Open firewall rules for the worker address if they block it. Check: send a ping to Redis with redis-cli and open a connection to the CKAN and DataStore databases using the credentials in the file. Both should return without errors.

  4. Set queue names on both sides

    Set ckanext.xloader.queue_names in the shared config so the web servers that enqueue XLoader jobs and the worker that consumes them use the same queue. The default value is 'default', and you can keep it unless you run separate queues for DataStore loading. Any change requires a restart of the web servers and the worker. Check: compare the setting in the config file on each host, confirm the value is identical, and record it in your runbook.

  5. Start the CKAN job worker

    Start the CKAN job worker on the separate host under a process supervisor such as systemd, so it restarts after a reboot and its logs go to a known location. Run it with the same config file, using the CKAN jobs worker command for your installed version, and confirm the command syntax in the CKAN documentation first. Check: the worker log should show that it started and is listening on the queue names you set. If it reports a connection error, return to the connectivity step before going further.

  6. Verify a test resource reaches the DataStore

    Create a test dataset on the portal and upload a small CSV file with a few rows so the job finishes quickly. Confirm XLoader is enabled for the resource, then watch the worker log for the job being picked up. Check: the resource should show a successful load in the portal, and a datastore_search call on that resource should return the rows you uploaded. If the job never appears in the worker log, the worker is not listening on the queue set in the config.

Sizing job timeouts for large files

A timeout that works for a small CSV can fail a large file on a slower worker. Each driver below changes how long a load takes, so measure each one in a test load on the worker host you plan to use.

File size and row count

Load time grows with the bytes and rows a job must read and write, so start with the largest resource your portal expects to load. Time a full load of that file on the worker host and record the duration. Then confirm the file size limit and the job timeout option in the ckanext-xloader repository for your CKAN version, and check which limit a large upload reaches first. Leave headroom above the measured time so normal variation does not trigger failures.

XLoader repository

Column count and type guessing

Wide tables take longer to parse and type than narrow tables with the same row count. Load a sample with the widest header you expect and the most mixed column content, and note the duration per thousand rows for comparison. Confirm in the ckanext-xloader repository how type guessing is configured for your version, and whether strict type failures end a job early. A fast failure can hide the true load time, so check the job log for the stage where it stopped.

Database write speed on the worker

Loading writes every row into the DataStore database, so disk throughput, PostgreSQL configuration and network latency between the worker and the database often set the pace. Run the test load from the worker host itself, using the same database connection the production worker will use. Note whether write speed drops as the table grows. Ask your database team to confirm the write user has the rights the load needs, and check the database settings in your CKAN config file.

Jobs sharing one worker

Each worker process handles jobs from the queues it listens on, so one long file can hold up smaller resources queued behind it. Set ckanext.xloader.queue_names deliberately so that large loads can land on their own queue. Measure the queue waiting time for a small resource submitted during a large load. Confirm in the ckanext-xloader repository how your version starts worker processes and whether it runs jobs concurrently on one host.

Download time from the source

For linked resources, the worker fetches the file before it parses anything, so transfer time from a remote host you do not control may count toward the job. Test the load from the worker's network location against the actual source URL, and compare it with a copy stored in your own infrastructure. Confirm in the ckanext-xloader repository whether download and parsing share one timeout, and that the worker has the outbound access and SSL verification the source requires.

How queue names route XLoader jobs to a dedicated worker

A worker only processes jobs from the queues it listens on, and that list is set with ckanext.xloader.queue_names in the CKAN config file. The default value is default, so every host that keeps the default handles the same queue. A separate queue lets you keep large-file jobs apart from smaller ones: a dedicated worker can take the slow loads while smaller resources move through their own queue. Before you add the second host, decide which queue names you will use, which jobs each queue will carry, and how your team will confirm where a job landed. Check the ckanext-xloader repository for how jobs are assigned to a named queue, because that behavior determines what you set on each side.

A queue name mismatch is the most likely way to leave jobs waiting with no visible error. If the web hosts send jobs to one queue name and the worker listens on another, the job sits in a queue that no running worker reads. The resource can stay pending on the portal while nothing reports a failure, so the problem looks like a slow load rather than a configuration fault. Treat the setting as a pair: every queue that receives jobs from the web side must have at least one worker listening to it, and the worker side must list exactly the names the web side uses.

After each config change, check the queue on both sides. On each web host, confirm the value in the CKAN config file that the web process reads. On each worker host, confirm the same key and make sure the worker service has reloaded the file so the new value is active. Then upload a small test file to a test dataset and confirm it reaches the DataStore. If it stays pending, compare the queue names again before you look elsewhere. Write the queue names for each host into your runbook so the next person can run the same comparison.

Security boundaries for the worker host

A separate XLoader worker host reaches the same database and Redis services as your web servers, so it widens the places where data and credentials can be accessed. The five controls below cover network paths, the database role, the shared config file, uploaded files and failure monitoring.

Limit network paths to Redis and PostgreSQL

The worker needs to reach the Redis instance that holds its job queues and the PostgreSQL servers that hold CKAN and DataStore data. Allow those two destinations from the worker host and deny other internal paths your network policy allows you to block. Outbound web access is the exception, because the worker fetches linked resource files, so confirm which external hosts it must reach and limit egress to those.

Confirm the DataStore database role

Loading writes tables into the DataStore database, so the worker must connect with the write user, while the read-only user serves the Data API. Check the database connection settings the worker reads against the roles you created during permissions setup. A worker using the wrong role either fails every load or holds write rights on a role meant only for public queries.

DataStore docs

Control access to the config file

The worker reads the same CKAN config file as the web servers, and that file holds database URLs, Redis settings and secrets. Set file ownership so only the service account that runs XLoader and your administrators can read it, and keep copies out of shared repositories and container images. When you rotate a database password, update the file on every worker host as well as on the web servers.

Treat uploaded files as untrusted input

Every resource file the worker downloads or receives is untrusted input, and parsing is the step where a malformed or hostile file meets the worker's code. Run the worker under an account with no interactive login and write access only to the paths it needs. Keep the maximum file size configured to what your portal requires, and confirm which source hosts the worker may fetch files from.

XLoader repository

Log and monitor worker failures

A stopped worker produces no web errors, so resources can silently stop reaching the DataStore. Send the worker's output to your central logging, alert on repeated job failures and on the worker process stopping, and watch for authentication errors that suggest a changed database password. Before go-live, confirm where your process manager writes output and who receives the alerts.

Common questions before a team runs its own XLoader workers

How much more effort is a worker host than a web server?

A worker host takes about the same setup effort as a web server, but it runs under a different load pattern. It needs a CKAN install that matches the web servers, the CKAN config file, network access to Redis and the database, and a process that listens on the queues you name. It does not need to answer public page requests, so you can size it around loading jobs instead of traffic. Loads are bursty: the host may sit idle for long periods, then use CPU, memory and temporary disk space on a large file. Most of the ongoing effort is keeping the worker's CKAN and extension versions aligned with the web tier, using the same patching discipline you already apply to the web servers.

How long does it take to move XLoader workers off the web servers?

The time depends on how many environments you run, how much of the setup is already automated, and how many queues and file types you need to test. A small portal with one queue and one staging copy moves faster than a multi-environment estate with separate queues for large files, because each queue needs a configuration check and a test load. The main drivers are access approvals from your security and network teams, the time needed to agree a maintenance window for configuration changes and worker restarts, and the number of representative files you test, especially very large or oddly encoded ones. Timeouts for large files usually need several test runs to settle. Ask for a timeline built from your inventory of environments, queues and test files. Fixed-scope engagements have timelines written into the agreed scope before work starts.

What must our portal team provide before a separate worker host is set up?

Your team provides the access and information the work depends on, plus time for testing. Expect to provide shell access or a deployment pipeline to the web servers and the planned worker hosts, the CKAN config file and its environment, connection details for Redis and the PostgreSQL databases, and approval for the network routes between the worker and those services. Provide a test file set that includes your largest files, your most common formats and any files that have failed before, with the results you expect. Schedule a maintenance window for changing the configuration, restarting web and worker services, and checking the job queue afterward. Name one person who can approve configuration changes and one who can review test loads. Your security team should confirm how database credentials are stored and rotated before they are copied to a new host.

Can our internal team set up separate XLoader workers without a partner?

Yes, an internal team with CKAN operations experience can do this alone, because a worker runs the same software and configuration as your web servers. The steps that need care are keeping CKAN and extension versions identical across hosts, setting ckanext.xloader.queue_names consistently so every queue has a listener, confirming Redis and database access from the worker, and testing large files against your job timeouts. Review the ckanext-xloader repository for queue settings and the version you run before you start. A partner adds the most value when the internal team lacks time, has no one who has run background workers in production, or needs the build and runbook documented for later assessments. DeployOpen plans, implements and documents self-hosted platforms in your infrastructure, and the scope is agreed in writing before work starts.

When is one worker host enough for a CKAN portal?

One worker host is enough when a single machine can work through your queue at the rate your publishers expect, with headroom for the largest file you accept. XLoader listens on the queues set in ckanext.xloader.queue_names, and the default queue name is default, so a small portal may run every job on one host. Add a second host when the backlog grows during normal publishing, when a large file holds up smaller ones, or when a single host failure would stop loading for longer than your service needs. Separating queues across hosts lets large files have their own worker. Decide with measurements: watch queue length, job duration, memory and disk during a realistic load before adding capacity. When you add a host, confirm it points at the same Redis and database, and test it with a sample resource, because a host pointed at the wrong services will not pick up the jobs you expect.

What changes for the worker host when we upgrade CKAN?

Every worker host must run the same CKAN version and compatible extension versions as the web servers, so an upgrade moves the worker tier together with the web tier. CKAN patch releases do not break backwards compatibility and leave out schema changes and new features, so they are usually the lowest-risk changes. Minor releases may include backwards-incompatible changes, so read the release notes and check the ckanext-xloader compatibility for the target version before you schedule the window. The CKAN project supports the latest patch of the current minor version and the previous minor version, and older patches lose support once a newer patch is out. Plan the order in which web servers and workers stop and start, test that order beforehand, and rerun a test load after the change. For reference, CKAN's release policy explains the cadence.

What cost components should we ask about in a quote for worker hosts?

The cost of a separate worker tier has four parts, and each has a different payer. The host itself is an infrastructure charge from your cloud provider or data center, and it recurs for as long as the host runs. Engineering time for the install, configuration, queue setup and testing is usually one-time, paid either to your own staff or to a partner under a written scope. Testing time grows with the number of file types and the size of files you accept, and it is also largely one-time. Patching, CKAN upgrades, monitoring and on-call response recur, and you may cover them with internal staff or a retainer for ongoing support. Costs rise with more environments, more queues, larger files and stricter change control. Ask each bidder to split the quote into setup, testing, documentation and recurring support, list the environments covered, and state what your team must provide.

Limits to confirm in your environment

The settings below change with each CKAN release and with the hardware under your workers, so none of them should be copied from another deployment. Confirm each one with the ckanext-xloader repository, your CKAN release notes or your own tests before you set the worker queue, timeout and size limits.

Extension version for your CKAN

Match the ckanext-xloader release to the CKAN minor version running on your web servers, and install the same pairing on the worker host. Versions that drift apart may only fail once a job is picked up, so a worker that starts cleanly does not prove it is compatible. Confirm the pairing in the ckanext-xloader repository before you install. Record both versions on every host so a later CKAN upgrade does not leave the worker behind.

XLoader repository

File size limit and job timeout

These two settings decide which large files reach the DataStore at all. The size limit caps what XLoader will download, and the job timeout caps how long one load may run before the worker stops it. Check defaults and option names for your release in the configuration reference and the extension's release notes. Set the timeout from a test load of your largest file on the worker hardware, then apply the same values on every host that can pick up the job.

Redis and PostgreSQL versions

Your worker must reach Redis and PostgreSQL at versions your CKAN release supports, and those versions can differ from what your other services run. The install-from-source guide sets a minimum PostgreSQL release, so confirm the floor for your version in its notes. Redis is also a hard requirement, so confirm its supported version the same way. Test the worker against the exact Redis and PostgreSQL versions you plan to run before you point production queues at it.

Install from source guide

Network path to Redis and database

The worker needs open network routes to Redis and to the PostgreSQL databases CKAN uses, including the DataStore database that receives loaded tables. A host placed in another subnet, zone or security group can lose those routes without any change to CKAN. Map each service, port and firewall rule between the worker and its dependencies, including any TLS requirements. Run the connection tests from the worker host itself, because a check that succeeds from a web server says nothing about the worker's path. Confirm each route on the worker host before you enable its queues.

Worker processes and queue assignment

How many worker processes your hardware can run depends on the memory, disk and CPU available on the host and on how large each load is. Start from the queue setting, ckanext.xloader.queue_names, which defaults to 'default'. If you split queues between hosts, make sure every queue name that jobs are sent to has at least one listening worker. Measure memory use and load time per file size during a test run, then add processes only while the host keeps headroom. Do not assume a worker count from another deployment.

How DeployOpen scopes and delivers XLoader worker setups

DeployOpen plans and builds the separate XLoader worker host as part of the wider CKAN DataStore setup, inside infrastructure you control. The work starts from a written scope that names the CKAN install, the config file, Redis and database access, and the queues each worker listens on. Each step is documented so your operations team can run and check the worker after handover.

How we scope

  • The written scope lists each worker host, its CKAN install and the config file it reads.
  • We confirm which Redis and PostgreSQL connections each host may reach, and which network paths must stay closed.
  • The scope also sets the ckanext.xloader.queue_names values, so every queue has a worker that listens to it.

How we build

  • We install CKAN on each worker host at the same version as your web servers.
  • We set the config file, Redis and database access, then confirm each worker consumes its assigned queue.
  • We test a sample upload end to end, from the web server job to the DataStore table.

How we hand over

  • Handover includes a runbook covering starting, stopping and restarting each worker process on its host.
  • Your team receives the queue map, the config values used and the connection list for every worker host.
  • Sizing notes for job timeouts on large files are written up so your team can tune them later.

How we support

  • Support runs as a retainer if you want DeployOpen to watch worker health, apply upgrades and handle job failures.
  • Retainers can also cover upgrades of CKAN and XLoader, with each change tested on the worker hosts first.
  • Any new worker host or queue change goes through the same written scope and change record before it goes live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.