question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance: one service worker can only process one task per second?

See original GitHub issue

I have a ServiceContainer with only one worker, as below:

config = {
        AMQP_URI_CONFIG_KEY:AMQP_URL,
        MAX_WORKERS_CONFIG_KEY: 1,
}
ServiceContainer(service_class, config)

After sending async calls, I started the service as the consumer. But it turns out that the only one worker can do exactly one task per second, is there something wrong with my configuration?

The service simply returns a number:

class Consumer(object):
    name = 'test'
    @rpc
    def work(self):
        logging.info('hello')
        return 42

logs:

[I 170314 20:39:25 main:26] hello
[I 170314 20:39:26 main:26] hello
[I 170314 20:39:27 main:26] hello
[I 170314 20:39:28 main:26] hello
[I 170314 20:39:29 main:26] hello
[I 170314 20:39:30 main:26] hello
[I 170314 20:39:31 main:26] hello
[I 170314 20:39:32 main:26] hello
[I 170314 20:39:33 main:26] hello
[I 170314 20:39:34 main:26] hello
[I 170314 20:39:35 main:26] hello

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
davidszottencommented, Mar 16, 2017

agreed. @mikegreen7892003 would you like to make a pr bumping it to max_workers + 1? (if not, i’m happy to but it was your idea)

0reactions
davidszottencommented, Apr 20, 2017

hi. in case you’ve not been following the recent discussions you may be interested in https://github.com/nameko/nameko/pull/429#issuecomment-294789346 and the subsequent release of 2.5.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Measuring the Real-world Performance Impact of Service ...
One of the most significant benefits of service workers (from a performance perspective, at least) is their ability to proactively control ...
Read more >
Prevent Service Worker from automatically stopping
If you try to use it for processing, it's likely to block fetch events which is terrible for performance.
Read more >
Scaling Airflow to optimize performance - Astronomer Docs
See which parameters to modify when scaling up data pipelines to make the most of Airflow. Learn about the environment, DAG, and task-level...
Read more >
Elastic Beanstalk worker environments - AWS Documentation
These operations can take only a second or two to complete, but a delay of a few seconds is a lot for a...
Read more >
Workers Guide — Celery 5.2.7 documentation
A single task can potentially run forever, if you have lots of tasks waiting for some event that'll never happen you'll block the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found