Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set single thread/process #541

Closed
barnaclebarnes opened this issue Mar 24, 2025 · 3 comments
Closed

Can't set single thread/process #541

barnaclebarnes opened this issue Mar 24, 2025 · 3 comments

Comments

@barnaclebarnes
Copy link

I have the following setup:

default: &default
  dispatchers:
    - polling_interval: 1
      batch_size: 500
  workers:
    - queues: "*"
      threads: 1
      processes: 1
      polling_interval: 0.1
development:
  <<: *default

test:
  <<: *default

production:
  <<: *default

But that worker is always running three concurrent jobs:

Image

Its configuration shows:

{
  "polling_interval": 0.1,
  "queues": "*",
  "thread_pool_size": 3
}

I can't for the life of me work out how to set this to process a single job at a time. The reason I need to do this is that I'm using a GPU to analyse images using AI and it can only really handle a single image at a time before it blows up with memory constraints.

Any ideas of what I am doing wrong here? I even tried to add thread_pool_size: 3 rot the config but no luck. I'm using the latest version of solid_queue

@rosa
Copy link
Member

rosa commented Mar 25, 2025

Hey @barnaclebarnes, this is very strange. It seems liek your configuration is being ignored and the default is used. Could you let me know where your configuration is located? The file. And then, could also let me know how you're starting Solid Queue, and whether you have the environment variable SOLID_QUEUE_CONFIG set, and to what?

@barnaclebarnes
Copy link
Author

It is a standard rails app deployed to /home/deploy/stqryai/current. I'm using a systemd service to start it:

[Unit]
Description=solid_queue for stqryai
After=syslog.target network.target

[Service]
Type=simple
Environment=RAILS_ENV=production
WorkingDirectory=/home/deploy/stqryai/current
ExecStart=/home/deploy/.rbenv/shims/ruby -- /home/deploy/.rbenv/versions/3.3.4/bin/bundle exec rake solid_queue:start
ExecReload=/bin/kill -TSTP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID

Environment=MALLOC_ARENA_MAX=2

RestartSec=1
Restart=on-failure

SyslogIdentifier=solid_queue

[Install]
WantedBy=default.target

And thanks to your pointer on SOLID_QUEUE_CONFIG. I added that to my systemd script and it now works!

PS: I followed these instructions on deploying using systemd and Capistrano - https://world.hey.com/robzolkos/how-i-deploy-solid-queue-with-capistrano-487b4a31

@barnaclebarnes
Copy link
Author

And the root cause is because I missed the upgrade instructions. I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants