Comments (9)
Sounds like you are over-saturating your worker. In PHP SDK you can set the worker option withMaxConcurrentActivityExecutionSize
to limit the number of jobs assigned to the worker at the moment of time. Set it to the number of workers you have. If your task is not IO heavy you can set it to a higher value.
You can control this value per task queue, so make sure that if you consume multiple task queues the sum of concurrent activity executions does not exceed the number of available workers.
$worker = $factory->newWorker(
'taskQueue',
\Temporal\Worker\WorkerOptions::new()->withMaxConcurrentActivityExecutionSize(10)
);
from roadrunner-temporal.
@changwuf31 There is a process per worker and the root process for the rr-temporal. For the temporal no extra goroutines. But such methods like GetFreeWorkers
and Make Request
are not atomic. This is not suitable for the temporal, but for the http
plugin. Where you can request info for the free workers, and some other service can make a request before you make it. For the temporal plugin, @wolfy-j suggestion is totally valid, we will cover that case in the documentation and print warning message if you allocate a mismatched number of the rr-temporal workers (activities) and MaxConcurrentActivityExecutionSize
.
from roadrunner-temporal.
You can increase the number of workers in the config or increase max_allocation_time
if that suitable.
from roadrunner-temporal.
I see, yes, we can change the allocate_timeout
, but in our case, we're running this in the kubernetes environment.
Let's say we have pod A and pod B, each has 5 workers,
there are 10 jobs on the temporal server,
and each job require 5 minutes to complete.
So if pod A acquire 7 jobs, and pod B acquire 3 jobs,
then pod A will experience ErrNoFreeWorkers, meanwhile pod B still has free workers.
My suggestion is for a pod to only acquire jobs if there are available workers, I wonder if it is possible ?
We'd prefer for this job to only be retried if the execution failed, not because of no free workers available.
Thank You & Best Regards,
from roadrunner-temporal.
@changwuf31 Got you. At the moment there is no API to check if there are free workers in the pool except for the Workers
RPC call which shows workers status to the console.
This is also easy to implement, but this is not an atomic request. For example:
- You make a request. 2 free workers in the pool.
- You assume there are 2 workers and make a request.
- Between p.1 and p.2 different service made a request and allocate these 2 free workers.
- You make a request keeping in mind, that there are 2 workers and request failed.
from roadrunner-temporal.
I'll add this information to the documentation.
from roadrunner-temporal.
@changwuf31 Got you. At the moment there is no API to check if there are free workers in the pool except for the
Workers
RPC call which shows workers status to the console.
This is also easy to implement, but this is not an atomic request. For example:1. You make a request. 2 free workers in the pool. 2. You assume there are 2 workers and make a request. 3. Between p.1 and p.2 different service made a request and allocate these 2 free workers. 4. You make a request keeping in mind, that there are 2 workers and request failed.
I assume there is only 1 service that make the request, am I mistaken ?
On one pod, there is only one roadrunner-temporal process, or is there a few goroutine that make the request to the temporal server ?
If all workers and workflows operate on one namespace, is this still an issue ?
from roadrunner-temporal.
@changwuf31 I guess that I can close this issue since we provided advice on how to work with such behavior. Can I?
from roadrunner-temporal.
@48d90782 yes, please close it, there is another issue, we're not sure if it is related or not, but we can re-open this later, if it IS related
from roadrunner-temporal.
Related Issues (20)
- [🐛 BUG]: Metric `temporal_activity_schedule_to_start_latency` useless with RR? HOT 14
- [🐛 BUG?]: MaxConcurrentActivityExecutionSize ignored. HOT 6
- [💡 FEATURE REQUEST]: Support LocalActivities
- [🐛 BUG]: Incorrect worker pool recreating HOT 38
- github.com/stretchr/testify-v1.7.2: 1 vulnerabilities (highest severity is: 7.5) - autoclosed HOT 1
- [💡 CHORE]: Move all protos to the buf RR API
- [💡 FEATURE REQUEST]: Overwrite `client-name` and `client-version` in Go client to represent PHP-SDK HOT 3
- [💡 FEATURE REQUEST]: Statsd support for metrics HOT 3
- github.com/uber-go/tally/v4-v4.1.2: 2 vulnerabilities (highest severity is: 7.5) - autoclosed HOT 1
- [🐛 BUG]: Worker after SIGTERM not wait for finish activity HOT 4
- [💡 FEATURE REQUEST]: Support FailureConverter API HOT 2
- github.com/uber-go/tally/v4-v4.1.3: 2 vulnerabilities (highest severity is: 7.5) - autoclosed HOT 1
- github.com/uber-go/tally/v4-v4.1.4: 2 vulnerabilities (highest severity is: 7.5)
- github.com/uber-go/tally/v4-v4.1.5: 2 vulnerabilities (highest severity is: 7.5)
- github.com/uber-go/tally/v4-v4.1.6: 2 vulnerabilities (highest severity is: 7.5)
- [🐛 BUG]: broken load balancing for workflow worker HOT 12
- [🐛 BUG]: Can't cancel workflow from activity - UnhandledCommand for activity, but workflow is completed HOT 7
- github.com/uber-go/tally/v4-v4.1.7: 2 vulnerabilities (highest severity is: 7.5)
- proto_codec_parse_message: invalid character '6' looking for beginning of value HOT 2
- invalid character '1' looking for beginning of value", HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadrunner-temporal.