Amazon web services AWS step函数能否执行25000次以上?
我目前正在评估可以处理单个文档的AWS状态机。状态机处理单个文档需要5-10分钟Amazon web services AWS step函数能否执行25000次以上?,amazon-web-services,aws-lambda,aws-sdk,aws-step-functions,Amazon Web Services,Aws Lambda,Aws Sdk,Aws Step Functions,我目前正在评估可以处理单个文档的AWS状态机。状态机处理单个文档需要5-10分钟 { "Comment":"Process document", "StartAt": "InitialState", "States": { //the document goes through multiple states here } } C代码通过为每个文档传递一些json来调用状态机。差不多 // max 100 documents publ
{
"Comment":"Process document",
"StartAt": "InitialState",
"States": {
//the document goes through multiple states here
}
}
C代码通过为每个文档传递一些json来调用状态机。差不多
// max 100 documents
public Task Process(IEnumerable<Document> documents)
{
var amazonStepFunctionsConfig = new AmazonStepFunctionsConfig { RegionEndpoint = RegionEndpoint.USWest2 };
using (var amazonStepFunctionsClient = new AmazonStepFunctionsClient(awsAccessKeyId, awsSecretAccessKey, amazonStepFunctionsConfig))
{
foreach(var document in documents)
{
var jsonData1 = JsonConvert.SerializeObject(document);
var startExecutionRequest = new StartExecutionRequest
{
Input = jsonData1,
Name = document.Id,
StateMachineArn = "arn:aws:states:us-west-2:<SomeNumber>:stateMachine:ProcessDocument"
};
var taskStartExecutionResponse = await amazonStepFunctionsClient.StartExecutionAsync(startExecutionRequest);
}
}
}
执行了26000次,没有失败
public static async Task Main(string[] args)
{
AmazonStepFunctionsClient client = new AmazonStepFunctionsClient("my key", "my secret key", Amazon.RegionEndpoint.USWest2);
for (int i = 1; i <= 26000; i++)
{
var startExecutionRequest = new StartExecutionRequest
{
Input = JsonConvert.SerializeObject(new { }),
Name = i.ToString(),
StateMachineArn = "arn:aws:states:us-west-2:xxxxx:stateMachine:MySimpleStateMachine"
};
var response = await client.StartExecutionAsync(startExecutionRequest);
}
Console.WriteLine("Press any key to continue");
Console.ReadKey();
}
公共静态异步任务主(字符串[]args)
{
AmazonStepFunctionsClient=新的AmazonStepFunctionsClient(“我的密钥”,“我的密钥”,Amazon.RegionEndpoint.USWest2);
对于(int i=1;i我认为您的理解不对。25000个限制用于状态机执行历史记录。您已经测试了26000个状态机执行。状态机执行限制为1000000个开放执行
状态机最多可以运行1年,在此期间,其执行历史记录不应超过25000
希望有帮助。可能重复@bwest查看我的更新1你能找到解决方案吗?这是否意味着你可以不超过25k个并发运行的步骤函数?我认为100万个执行限制将是并发运行步骤函数。可能这意味着在任何给定时间最多可以有100万个正在进行中,但其中只有25k个正在执行,其余的在等待下一步?
public static async Task Main(string[] args)
{
AmazonStepFunctionsClient client = new AmazonStepFunctionsClient("my key", "my secret key", Amazon.RegionEndpoint.USWest2);
for (int i = 1; i <= 26000; i++)
{
var startExecutionRequest = new StartExecutionRequest
{
Input = JsonConvert.SerializeObject(new { }),
Name = i.ToString(),
StateMachineArn = "arn:aws:states:us-west-2:xxxxx:stateMachine:MySimpleStateMachine"
};
var response = await client.StartExecutionAsync(startExecutionRequest);
}
Console.WriteLine("Press any key to continue");
Console.ReadKey();
}